Added the description of HOOK_EXPLOSIVETIMER to hookscripts.txt.

Edited the example script.
Updated version number.
This commit is contained in:
NovaRain
2018-07-10 06:09:23 +08:00
parent b4b1698345
commit 09c9c5cce0
4 changed files with 25 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.0.7
;v4.1
[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -1,9 +1,16 @@
/*
Example implementation of the algorithm of the game engine setting the timer of explosives.
Example implementation of the algorithm of how the game engine sets the explosive timer.
*/
#include "..\..\scripting_docs\headers\sfall.h"
#include "..\..\scripting_docs\headers\define_lite.h"
// from CONDTION.H
#define ROLL_CRITICAL_FAILURE (0)
#define ROLL_FAILURE (1)
#define ROLL_SUCCESS (2)
#define ROLL_CRITICAL_SUCCESS (3)
procedure start;
procedure start begin
+13
View File
@@ -518,3 +518,16 @@ Obj arg2 - the object being used
int arg3 - the animation code being used (see ANIM_* in Animcomd.h)
int ret1 - overrides the animation code (pass -1 if you want to skip the animation)
-------------------------------------------
HOOK_EXPLOSIVETIMER (hs_explosivetimer)
Runs after setting the explosive timer. You can override the result.
int arg1 - the time in ticks set in the timer
Obj arg2 - the explosive object
int arg3 - the result of engine calculation of whether the timer was set successfully: 1 - failure, 2 - success (similar to ROLL_* in Condtion.h)
int ret1 - overrides the time of the timer (maximum 18000 ticks)
int ret2 - overrides the result of engine calculation: 1 - failure, 2 - success, any other value - use engine handler