Add Burst-Automatic fire mode to gun
Posted: Wed Jan 26, 2011 12:58 am
To add three-shot burst to a weapon, which is extremely simple to do, just add this text to the weapon's Objects.con:
[Objects/HandWeapons/GunName/Objects.con]
ObjectTemplate.heatAddWhenFire 2
ObjectTemplate.coolDownPerSec 50
ObjectTemplate.timeDelayOnOverHeat 0.4
Here's a break-down of which line of code does what:
ObjectTemplate.heatAddWhenFire 2
Every gun seems to have an overheat limit of 5 units. So when the "heatAddWhenFire" adds up units [this code being 2 units per shot] and reaches 5 units, the gun is then overheated.
ObjectTemplate.coolDownPerSec 50
This is the cool-off time for the weapon. So this line will cause the overheat to lose 50 units per second. For automatic weapons, this line will not take effect until the gun stops firing.
ObjectTemplate.timeDelayOnOverHeat 0.4
This is how many seconds the player has to wait, after fully overheating the weapon, for the cool-down process to start. In this case, that would be 0.4 seconds.
A more organized place to put it is right below the Deviation section.
It's just an Overheat function, that breaks the shots into increments of three.
You can change the "timeDelayOnOverHeat" to your liking. It is the time period between bursts.
[Objects/HandWeapons/GunName/Objects.con]
ObjectTemplate.heatAddWhenFire 2
ObjectTemplate.coolDownPerSec 50
ObjectTemplate.timeDelayOnOverHeat 0.4
Here's a break-down of which line of code does what:
ObjectTemplate.heatAddWhenFire 2
Every gun seems to have an overheat limit of 5 units. So when the "heatAddWhenFire" adds up units [this code being 2 units per shot] and reaches 5 units, the gun is then overheated.
ObjectTemplate.coolDownPerSec 50
This is the cool-off time for the weapon. So this line will cause the overheat to lose 50 units per second. For automatic weapons, this line will not take effect until the gun stops firing.
ObjectTemplate.timeDelayOnOverHeat 0.4
This is how many seconds the player has to wait, after fully overheating the weapon, for the cool-down process to start. In this case, that would be 0.4 seconds.
A more organized place to put it is right below the Deviation section.
It's just an Overheat function, that breaks the shots into increments of three.
You can change the "timeDelayOnOverHeat" to your liking. It is the time period between bursts.