Not a member yet? Why not Sign up today
Create an account  

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Modding the new simple weapons

#1
The new simple weapons (coming from the After Cataclysm mod) can be extensively configured, here is how you can configure them:

These are designed so that it's possible to have multiple barrels firing together or in sequence, rotating barrels, different pieces moving together, etc.


These are designed so that it's possible to have multiple barrels firing together or in sequence, rotating barrels, different pieces moving together, etc.
All that without the need of modifying the code.

Here is the common part of the configuration:
There are several types of simple weapons in the AC mod, this is the description of the configuration common to all these types.
The structure of a weapon is:

Code:
--> base                        The mesh of the block itself, doesn't move, it's the turret's base part
     +--> Shield                The SubObjects which will only rotate aroung the vertical axis, basically it's the turret's body part
           +--> Gun             The Subobjects which only elevate, it's the base of the gun itself
                 +--> Barrel    The moving part of the gun, this one can only have recoil
                 +--> Gatling   The moving part of the gun, this one can only rotate
It is possible to have several of each of these objects.
For additional 'base' objects you need to use a SubObjects with the 'DecorativeOnly' toggle set.

Global variables:
Code:
  . Caliber             The caliber of the guns in mm (default value: 20)
  . RotationSpeed       The rotation speed of the whole gun in degrees/s (default value: 30)
  . BarrelsPerObject    The number of barrels per GUN, used to avoid having several SubObjects when we want to have several guns moving the same way (default value: 1)
  . BarrelSpacing       Used only when 'BarrelsPerObject' is strictly higher than 1, to define the distance between 2 guns in meters (default value: 0)
  . AlternateBarrels    Set to 'true' to indicate that the barrels must alternate their fire, 'false' to indicate that they must fire together (default value: false)
  . Capacity            Indicates the number of shells in a magazine, if set to '1' then the gun has no magazine (default value: 1)
  . BurstReload         The reload time of the magazine, during that time no shell must be fired or the reload will have to start again from the beginning, in seconds (default value: 0)
  . MinElevation        The minimum elevation in degrees (default value: -20)
  . MaxElevation        The maximum elevation in degrees (default value: 75)
  . MaxAzimuth          The maximum azimuth angle in degrees (default value: 180)
  . FlashOverride       The size of the muzzle flash (default value: Caliber)
  . ShotsPerBarrel      The number of shells fired per barrel (default value: 1)
  . HasLaserTargeter    Does the weapon have a laser targeter? Used only when APS shells are used (default value: false)

In order to have more configuration possibilities, SubObject-specific variables have been designed, they are in the description of the SubObject using the following syntax:
[Type]([V1]=[value],[V2]=[value],[V3]=[value])

Code:
  . Type    The type of the object (SHIELD, GUN, BARREL, GATLING)
  . Vx      The name of the variable, one letter only (see all variables below)
  . Value   The value to set into the variable

 
SHIELD variables:
None

GUN variables:
Code:
  . D   The distance to spawn the shell (default value: 0)
  . H   The height to spawn the shell (default value: 0)
  . F   The distance to spawn the flash (by default it will be the same as the distance to spawn the shell, but for large guns we want the shell to be spawned out of the bouding box of the gun while we want the flash to be displayed just out of the barrel itself)
  . I   The index of the gun, to be able to identify it. Must be unique (default value: 0)

 
BARREL variables:
Code:
  . D   The recoil distance (default value: associated gun flash distance (F variable) / 10)
  . T   The time to get back to the initial position after the recoil (default value: ReloadTime / 2)
  . I   The index of the gun to attach the barrel to (default value: 0)


GATLING variables:
Code:
  . B   The number of barrels (default value: 1)
  . I   The index of the gun to attach the gatling to (default value: 0)

Example: GUN(D=2,H=-0.029,F=1.45,I=0)
In this example, the object is a GUN, the shell will spawn 2m from the GUN, with a height of -0.029m, the flash will be displayed at a distance of 1.45m and a height of -0.029m, the index of the associated barrel is '0' (this variable was optional as it's the default value)


Here is the 'simple shells' specific configuration:
These simple weapons fire simple shells, requiring no configuration from the player.
The class to use is 'WorldWarCannon'.
Here are the additional variables:
Code:
  . ProjectileSpeed     The velocity of the projectile when fired in m/s (default value: 400)
  . KineticDamage       The kinetic damage of the shell (default value: 100)
  . ArmourPiercing      The AP of the shell (default value: 5)
  . Accuracy            The inaccuracy of the shell (default value: 2)
  . AmmoUse             The quantity of ammo consumed per shell fired (default value: 10)
  . ExplosiveDamage     The explosive damage of the shell (default value: 100)
  . ExplosiveRadius     The explosion radius of the shell in meters (default value: 5)
  . ShellLifeTime       The shell life time in seconds (default value: 5)
  . RecoilForce         The recoil force when a shell is fired (default value: 100)
  . ShellModel          The shell model to use, 'enumProjectileMeshType' (default value: 'autocannonshell')
  . UseTimedFuse        Does this shell has a time fuse? (default value: false)
  . TracerRed           Red component of the tracer color (default value: 1)
  . TracerGreen         Red component of the tracer color (default value: 0.8)
  . TracerBlue          Red component of the tracer color (default value: 0)


Here is the 'APS shells' specific configuration:
These simple weapons will fire APS shells, so the player must assign ammo controllers to it.
The class to use is 'WorldWarCannonCustomShells'.
Here are the additional variables:

Code:
  . InaccuracyBonus     The inaccuracy bonus (default value: 1.0f)
  . MaxShellLength      The maximum shell length the weapon cann load in meters (default value: 0.5)
  . BarrelLength        The weapon's barrel length in meters (default value: 1)



Note: this manual may evolve over time
Reply



Messages In This Thread
Modding the new simple weapons - by Gladyon - 2019-08-12, 05:14 PM
RE: Modding the new simple weapons - by Skyer - 2019-08-12, 08:42 PM
RE: Modding the new simple weapons - by Gladyon - 2019-08-14, 06:09 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)