-
Notifications
You must be signed in to change notification settings - Fork 5
Models
A model describes a set of parts and how they fit together. Firearms can be matched to models that accurately describe their internal parts. The mod will only recognize firearms that have been matched to a model.
These models are currently in the game and can be used when adding support for a new firearm. Just match the gun to the model that best represents how it's made. If there is no suitable model, you will have to make a new one (see below).
- PistolReceiver
- PistolSlide
- PistolBarrel
- RevolverReceiver
- RevolverCylinder
- ShotgunReceiver
- ShotgunForend
- ShotgunBoltCarrier
- ShotgunBolt
- ShotgunForend
- ShotgunBarrel
- M16UpperReceiver
- M16BoltCarrier
- M16FiringPin
- M16Bolt
- M16BoltCarrier
- M16LowerReceiver
- BoltActionReceiver
- BoltActionBolt
To improve realism and accuracy, a new model sometimes needs to be created in order to better represent a firearm.
Most pistols are currently matched to GenericPistol which means they all share the same slides and barrels. A custom Glock 17 item can use the same slide and barrel as the M9 because it's close enough, but sometimes a new model is needed because a gun is too different. The TEC-9 for example is probably different enough that it should use its own model with some of its own parts. This means planning a new model that describes a realistic breakdown of the TEC-9, and creating new items that are used by the model.
Keep in mind that every unique part that a gun has to use makes it more difficult to repair. If a gun uses common parts, it is easier to repair.
To add support for a firearm, use this line of code:
CoavinsFirearms.Include('Base.Bush_XM15', 'M16Rifle')
The first param is your item type, the second is the name of the model you want to use for your gun.
If you do this, your gun will be able to be disassembled and will return the parts specified in the model you chose, and those parts will be required in order to assemble the gun again.
You will want to do this in a separate mod within your workshop item so you don't have to add this mod as a dependency to your entire mod.