How to add completely different weapon to a unit?

Everything about mods can be found here.

How to add completely different weapon to a unit?

Postby Mach » 13 Jan 2018, 12:48

For example a continuous beam weapon to mantis? And have it have GC beam effect?
Posts: 16
Joined: 30 Jan 2017, 19:30
Has liked: 3 times
Been liked: 2 times
FAF User Name: Mach

Re: How to add completely different weapon to a unit?

Postby JoonasTo » 13 Jan 2018, 13:10

Completely new weapons need to be defined in the UXXXXXX_script.lua file in "\hook\units\UXXXXXX" folder. Then these weapons can be used in the blueprints file.
User avatar
Posts: 362
Joined: 08 Feb 2015, 01:11
Has liked: 10 times
Been liked: 62 times
FAF User Name: JoonasTo

Re: How to add completely different weapon to a unit?

Postby CSI » 13 Jan 2018, 13:23

There are several steps for this :
- if you want the weapon to be visible on the unit model (example : a new turret, a missile rack, etc), you will need to edit the SCM file with blender to add what you want. It can be difficult if youhave no experience with 3D modeling.
- if the weapon doesn't exist in the base game, you need to create your own particles, emitters, or projectile files.
- if you want your Mantis to overwrite the original one, then place it in /yourmod/hook/units/URL0107, if you want a brand new unit place it in /yourmod/units/codename.
- in the unit script, add your new weapon(s) in the Weapons list, like this
Code: Select all
Weapons = {
LaserArms = Class(CDFLaserHeavyWeapon) {},
GCBeam = Class(ADFPhasonLaser) {},
And don't forget to import the new weapon before :
Code: Select all
local ADFPhasonLaser = import ('/lua/aeonweapons.lua').ADFPhasonLaser

- in the unit blueprint, just paste the GC weapon then edit what you want. The Label field must match the name of the weapon in the unit script (here : GCBeam). And the RackBones must match the part of the unit model from where the beam will be fired, if you want it to fire from the same bone as the original Mantis shoots its little red lasers, then juste copy the RackBones field from this weapon. And when the weapon is "turreted", you will also need to edit TurretBoneMuzzle, Pitch and Yaw to match your unit.

I think that's it
Posts: 100
Joined: 09 Apr 2017, 18:59
Has liked: 18 times
Been liked: 5 times
FAF User Name: CSI

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 3 guests