A mod for classic Serious Sam: The Second Encounter v1.07 that adds a lot of options for multiplayer games including coop mode support for singleplayer maps.
Pre-load and compile scripts related to fire and fire patterns and store them in action lists of CWeaponStruct.
Execute in Fire() or AltFire() procedures within a wait() block that will wait for the returning event from the script (it will use a callback function with specific CPlayerWeapon entity ID as a reference that sends EFinishFiring or similar event to it).
To prevent weapons from being stuck in the procedure, check if the script has been executed correctly and release the weapon from the wait() block if not.
Alternatively have a pre-defined fire speed (in the weapon config) that can also have a random time variable.
Example:
"FireTime" : 1.0,
"FireTimeRND" : 0.2,
"AutoSuspendFire" : true,
This will set wait time between 1.0 and 1.2 in a special variable that's also passed by value into the script before execution.
If the script is still running when the waiting ends, its thread should be suspended automatically unless "AutoSuspendFire" or similar option is set to false.
Pre-load and compile scripts related to fire and fire patterns and store them in action lists of CWeaponStruct.
Execute in Fire() or AltFire() procedures within a wait() block that will wait for the returning event from the script (it will use a callback function with specific CPlayerWeapon entity ID as a reference that sends EFinishFiring or similar event to it). To prevent weapons from being stuck in the procedure, check if the script has been executed correctly and release the weapon from the wait() block if not.
Alternatively have a pre-defined fire speed (in the weapon config) that can also have a random time variable. Example:
"FireTime" : 1.0, "FireTimeRND" : 0.2, "AutoSuspendFire" : true, This will set wait time between 1.0 and 1.2 in a special variable that's also passed by value into the script before execution. If the script is still running when the waiting ends, its thread should be suspended automatically unless "AutoSuspendFire" or similar option is set to false.