Added a note for argnum in set_sfall_arg().

Fixed incorrect set_sfall_arg usage in the example.
Removed a redundant line in sfall opcode list.txt.
This commit is contained in:
NovaRain
2017-07-25 23:10:14 +08:00
parent 6a0a93836e
commit fc930ff7fb
2 changed files with 7 additions and 8 deletions
+6 -6
View File
@@ -42,7 +42,7 @@ Returns all hook arguments as a new temp array.
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
> void set_sfall_arg(int argnum, int value)
Changes argument value. This is usefull if you have several hook scripts attached to one hook point (see below).
Changes argument value. The argument number (argnum) is 0-indexed. This is usefull if you have several hook scripts attached to one hook point (see below).
> void register_hook(int hooktype)
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be execuded in a current global script. You can use all above functions like normal.
@@ -58,13 +58,13 @@ Example: let's say we have a Mod A which reduces all "to hit" chances by 50%. Th
Mod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script:
set_sfall_arg(original_chance / 2);
set_sfall_arg(0, (original_chance / 2));
This basically changes hook argument for the next script. Mod B code:
original_chance = get_sfall_arg;
set_sfall_return(original_chance * 1.5);
set_sfall_arg(original_chance * 1.5);
set_sfall_arg(0, (original_chance * 1.5));
So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use "set_sfall_arg" in both hooks).
@@ -447,7 +447,7 @@ Also happens on other screens, like barter.
NOTE: FID has following format: 0x0ABBCDDD, where A is object type, BB - animation code (always 0 in this case), C - weapon code, DDD - FRM index in LST file.
int arg1 - the vanilla fid calculated by the engine according to critter base FID and armor/weapon being used
int arg1 - the vanilla fid calculated by the engine according to critter base FID and armor/weapon being used
int ret1 - overrides the calculated FID with provided value
@@ -457,7 +457,7 @@ HOOK_COMBATTURN (hs_combatturn.int)
Runs before and after each turn in combat (for both PC and NPC).
int arg1 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ended abruptly (by script or by pressing Enter during PC turn)
int arg1 - event type: 1 - start of turn, 0 - normal end of turn, -1 - combat ended abruptly (by script or by pressing Enter during PC turn)
int arg2 - critter doing the turn
int arg3 - unknown boolean argument
@@ -469,7 +469,7 @@ HOOK_CARTRAVEL (hs_cartravel.int)
Runs continously during worldmap travel on car.
int arg1 - vanilla car speed (between 3 and 8 "steps")
int arg1 - vanilla car speed (between 3 and 8 "steps")
int arg2 - vanilla fuel consumption (100 and below)
int ret1 - car speed override (pass -1 if you just want to override fuel consumption)
+1 -2
View File
@@ -208,9 +208,8 @@
0x81e3 - void reset_critical_table(int crittertype, int bodypart, int level, int valuetype)
0x81e4 - int get_sfall_arg()
0x823d - void set_sfall_arg(int arg, int value)
0x823c - array get_sfall_args()
0x823d - void set_sfall_arg(int arg, int value)
0x823d - void set_sfall_arg(int argnum, int value)
0x81e5 - void set_sfall_return(int value)
0x81ea - int init_hook()