Page 1 of 1

Add Burst-Automatic fire mode to gun

Posted: Wed Jan 26, 2011 12:58 am
by Swaffy
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.

Re: [Easy] Add Burst-Automatic fire mode to gun

Posted: Wed Jan 26, 2011 1:05 am
by fo0k
It would be really useful if you could explain why this works and what each line of code means? that will help people understand simple tutorials and allow them to alter these variables with some basis of understanding why they achieve the desired result.