I want to change the AP costs of the unarmed special attacks. For that I'll use the hookscript hs_calcapcost.int. The problem is I've never done any Fallout2 scripting before and don't know the syntax, how scripts get initialized, what's allowed and what's not, etc. I want to have a global script that checks every other frame to see if the character does not have a weapon equipped, and if so, allows the calcapcost hookscript to run. Here's how the scripts looks so far:
So, there's probably plenty of things that's wrong with this. Would anyone care to point out exactly what? Also, if they were right, could I just compile them, put them in the scripts folder and they'd run?
Code:
//gl_F2WRUnarmedAP.int
procedure start;
#include "..\headers\define.h"
procedure modAP;
procedure start begin
// This should make the script run every 3 frames to check equipped weapons
set_global_script_repeat(3);
end
procedure modAP begin
// I have NO idea if this is correct syntax
// If the object at the dude's active hand is currently nothing (unarmed), then let the hook run
if (critter_inven_obj(dude_obj, active_hand) == NULL)
// How does this work?
register_hook(2);
end
end
Code:
//hs_calcapcost.int
procedure start begin
variable type;
if (hook_init == 0) then begin
type:=get_sfall_arg;
type:=get_sfall_arg;
if (type == 6) or (type == 8)
set_sfall_return(4);
end
if (type == 7) or (type == 9)
set_sfall_return(5);
end
end
end
So, there's probably plenty of things that's wrong with this. Would anyone care to point out exactly what? Also, if they were right, could I just compile them, put them in the scripts folder and they'd run?