Add Burst-Automatic fire mode to gun

Lots of cool and useful tips to mod either serverside or clientside
Post Reply
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Add Burst-Automatic fire mode to gun

Post 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.
Last edited by Swaffy on Tue Sep 06, 2011 9:06 pm, edited 2 times in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post 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.
Post Reply