Created
July 11, 2022 23:44
-
-
Save mrowrpurr/78ff2f71bf76c8dcaebbc4e7ce07e325 to your computer and use it in GitHub Desktop.
sfall opcodes.txt - From sfall resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can find this in the sfall modders pack | |
// This gist is only for quick resource lookup | |
// This file is not mine | |
// Get it from here: https://sourceforge.net/projects/sfall/ | |
// VANILLA OPCODES AND MACROS (generated from russian HLP file and google-translated): | |
int action_being_used - returns the skill ID used on the object, which is called in the script command | |
ObjectPtr dude_obj - returns a pointer to Player | |
int fixed_param - returns the value of the fixed parameter passed to a script | |
ObjectPtr obj_being_used_with - returns a pointer to the object currently being used on this object | |
int random (int min, int max) - returns a random number between min ... max inclusive | |
void scr_return - sets the return value of the script to use the C-code engine | |
int script_action - returns the number of the event handler for the action which triggered the script | |
void script_overrides - C-engine reports that the script overrides the default behavior of the object | |
ObjectPtr self_obj - returns a pointer to an object in a script which is executed | |
ObjectPtr source_obj - returns a pointer to the object that caused the handler | |
ObjectPtr target_obj - returns a pointer to the object on which the action takes place | |
void add_timer_event (ObjectPtr obj, int time, int info) - add an event timer | |
void rm_timer_event (ObjectPtr who) - clears all event timer, "hanging" on the property | |
void rm_fixed_timer_event (ObjectPtr who, int fixed_val) - clears the event timer, "hanging" on the property, with a given value of the parameter fixed_val | |
ObjectPtr create_object_sid (int pid, int tile_num, int elev, int sid) - create an object | |
int destroy_object (ObjectPtr obj) - destroys the object | |
int destroy_mult_objs (ObjectPtr item, int count) - destroys the specified number of copies of the object | |
boolean obj_is_locked (ObjectPtr what) - checks whether the object is locked | |
boolean obj_is_open (ObjectPtr what) - checks whether the specified Object is open | |
boolean obj_on_screen (ObjectPtr what) - checks to see whether the object on the game screen | |
void set_obj_visibility (ObjectPtr obj, boolean visibility) - sets the visibility flag of the object | |
void obj_set_light_level (ObjectPtr obj, int intensity, int distance) - makes the object light source | |
int obj_art_fid (ObjectPtr obj) - returns the ID of the frame (FID) of the object | |
int obj_item_subtype (ObjectPtr obj) - returns a subtype of the object | |
string obj_name (ObjectPtr what) - returns the name of the object | |
int obj_pid (ObjectPtr obj) - returns the identifier of the prototype (pid) of the object | |
int obj_type (ObjectPtr obj) - returns the object type | |
int | string proto_data (int pid, int data_member) - returns the data from the prototype object | |
void jam_lock (ObjectPtr lockableObj) - jammed object that it is impossible to open for about 24 hours of play | |
void obj_close (ObjectPtr what) - tries to close the object | |
void obj_lock (ObjectPtr what) - trying to lock object | |
void obj_open (ObjectPtr what) - tries to open the object | |
void obj_unlock (ObjectPtr what) - trying to unlock an object | |
void use_obj (ObjectPtr obj) - use the object | |
void use_obj_on_obj (ObjectPtr item, ObjectPtr targetObj) - use the command object item at the object targetObj | |
ObjectPtr create_object (int pid, int tile_num, int elev) - create an object | |
int critter_add_trait (ObjectPtr who, int trait_type, int trait, int amount) - Critter adds the specified property | |
void critter_mod_skill (ObjectPtr who, int skill, int amount) - change the value by the amount of skill critter amount | |
void critter_rm_trait (ObjectPtr who, int trait_type, int trait, int amount) - remove trait / Perk | |
int critter_state (ObjectPtr who) - return the state of the object | |
boolean drug_influence (ObjectPtr who) - checks if the critter under the influence of drugs | |
int get_critter_stat (ObjectPtr who, int stat) - return the value of the characteristic | |
int get_pc_stat (int pcStat) - returns the value of the characteristics of the player | |
int get_poison (ObjectPtr who) - return the level of poisoning critter | |
void give_exp_points (int points) - add the player experience points | |
int has_skill (ObjectPtr who, int skill) - check the level of specific skills | |
int has_trait (int trait_type, ObjectPtr who, int trait) - return the value of the specified property | |
boolean is_skill_tagged (int skillNum) - check if a given skill is marked as tagged | |
int player_kill_count (int type) - the number of dead critters player | |
int set_critter_stat (ObjectPtr who, int stat, int amount) - change the characteristics of the critter on the value amount | |
void critter_dmg (ObjectPtr who, int dmg_amount, int dmg_type) - Critter given cause damage in a predetermined manner | |
void critter_heal (ObjectPtr who, int amount) - treats / removes a specified number of hit points | |
void critter_injure (ObjectPtr who, int how) - Critter causes damage (broken leg, broken arm, blind, 'check', etc.) | |
void poison (ObjectPtr who, int amount) - change the level of poisoning critter | |
void radiation_dec (ObjectPtr who, int amount) - reduce exposure critter | |
void radiation_inc (ObjectPtr who, int amount) - increase exposure critter | |
boolean critter_is_fleeing (ObjectPtr who) - checks whether the critter escapes from the battlefield | |
void critter_set_flee_state (ObjectPtr who, boolean flee_on) - set a flag FLEE (running away from the battlefield) | |
void critter_stop_attacking (ObjectPtr who) - set a flag indicating that the critter does not want to continue the fight | |
void critter_damage (ObjectPtr who, int dmg_amount) - Critter given cause damage | |
int critter_skill_level (ObjectPtr who, int skillNum) - return the current level of skills | |
redefinition has_skill (ObjectPtr who, int skillNum) | |
void critter_uninjure (ObjectPtr who, int how) - removes the critter damage (broken leg, broken arm, etc.) | |
int obj_get_rot (ObjectPtr who) - returns the gaze direction (0 ... 5) | |
boolean obj_is_visible_flag (ObjectPtr what) - checks whether the object is visible | |
int who_carry_amount (ObjectPtr who) - returns the current weight of the object who | |
void add_mult_objs_to_inven (ObjectPtr who, ObjectPtr item, int count) - add a few units of a given item in the inventory | |
void add_obj_to_inven (ObjectPtr who, ObjectPtr item) - add the item to your inventory object | |
int item_caps_adjust (ObjectPtr obj, int amount) - changes the amount of money the object | |
void move_obj_inven_to_obj (ObjectPtr srcObj, ObjectPtr destObj) - moves the inventory object in the inventory object srcObj destObj | |
int rm_mult_objs_from_inven (ObjectPtr who, ObjectPtr obj, int count) - removes multiple instances of the specified object from the inventory of another object | |
void rm_obj_from_inven (ObjectPtr who, ObjectPtr obj) - udalyaёt object from the inventory of another object | |
ObjectPtr (int) critter_inven_obj (ObjectPtr who, int where) - returns a pointer to the object in the slot inventory or the total number of objects in the inventory | |
ObjectPtr inven_cmds (ObjectPtr who, int inven_cmd, int slotNum) - returns a pointer to the object in the inventory | |
int item_caps_total (ObjectPtr obj) - returns the current amount of money in the inventory object | |
ObjectPtr obj_carrying_pid_obj (ObjectPtr who, int pid) - returns a pointer to an object with a matching prototype pid, which is the object who | |
int obj_is_carrying_obj_pid (ObjectPtr obj, int pid) - returns the number of objects with matching prototype pid, which are in the inventory of obj | |
void drop_obj (ObjectPtr obj) - Critter orders, in a script that is performing this function to reset the object to the ground | |
void inven_unwield (ObjectPtr who) - Critter command to remove any weapons / items from both hands | |
void obj_drop_everything (ObjectPtr who) - Critter team to throw out all the items from the inventory at his feet | |
void pickup_obj (ObjectPtr obj) - Critter, the script is called, this function raises the specified object from the ground | |
void wield_obj_critter (ObjectPtr who, ObjectPtr obj) - equips critter who object obj | |
int inven_count (ObjectPtr what) - returns the number of items in the inventory object | |
ObjectPtr inven_ptr (ObjectPtr what, int slotNum) - returns a pointer to an object in the specified slot | |
void wield_obj (ObjectPtr obj) - equips critter, the script is called, the object obj | |
int do_check (ObjectPtr who, int check, int modifier) - performs a random check ("die roll") on the basic characteristics critter | |
int how_much (int val) - returns the evaluation result of a random inspection ("dice roll") | |
boolean is_critical (int val) - checks whether the result of a random inspection ("dice roll") critical | |
boolean is_success (int val) - checks whether the result of a random inspection ("dice roll") successful | |
int roll_vs_skill (ObjectPtr who, int skill, int modifier) - performs a random check ("die roll") on the ability (skill) | |
boolean using_skill (ObjectPtr who, int skill) - check on the use of "active skills" | |
int critter_attempt_placement (ObjectPtr who, int hex, int elev) - place the critter at a given position | |
int elevation (ObjectPtr obj) - returns the level at which the specified object | |
int move_to (ObjectPtr obj, int tile_num, int elev) - move the object | |
boolean obj_can_hear_obj (ObjectPtr src_obj, ObjectPtr dst_obj) - check whether one object is to hear the other | |
boolean obj_can_see_obj (ObjectPtr src_obj, ObjectPtr dst_obj) - check whether one object to see another | |
int rotation_to_tile (int srcTile, int destTile) - referral to a hex destTile from hexa srcTile | |
boolean tile_contains_obj_pid (int tile, int elev, int pid) - check whether a given hex object with the specified PID | |
ObjectPtr tile_contains_pid_obj (int tile, int elev, int pid) - returns a pointer to the first object at a given hex | |
int tile_distance (int tile1, int tile2) - returns the distance between two hexes | |
int tile_distance_objs (ObjectPtr obj1, ObjectPtr obj2) - returns the distance between two objects | |
boolean tile_in_tile_rect (int tile1, int tile2, int tile3, int tile4, int tile) - determines if the point (hex) rectangle | |
int tile_num (ObjectPtr obj) - returns the number of hexes on which the object is located | |
int tile_num_in_direction (int start_tile, int dir, int distance) - hexa number, located at a distance predetermined in a predetermined direction from said hexa | |
int cur_map_index - the index of the current map | |
int cur_town - the index of the current city | |
int days_since_visited - the number of days that have passed since last player card | |
boolean is_loading_game - check whether the game is loaded at the moment | |
void load_map (string map_name, int param) - Specifies the maps download | |
boolean map_first_run - check starts if the current card for the first time | |
boolean map_is_known (int mapNum) - checks whether the card is known at the specified index | |
void override_map_start (int x, int y, int elev, int rot) - force the player's position when loading maps | |
void set_exit_grids (int markElev, int mapID, int elevation, int tileNum, int rotation) - specify settings for all exit points for a given level of scratch card | |
void set_light_level (int level) - set the level of illumination map | |
void set_map_music (int map_id, string acmFileName) - sets the background music for the specified card | |
void set_map_start (int x, int y, int elev, int rot) - force the position of the player on the next boot card | |
boolean tile_is_visible (int tile) - check, see if the specified hex | |
void tile_set_center (int tileNum) - center the screen on a given hex | |
boolean town_known (int townArea) | |
int car_current_town - returns the number of the card on which the machine | |
int car_give_to_party - team player and party members to put in the car and open the world map | |
int car_give_gas (int amount) - fill the car a given amount of fuel | |
void kill_critter (ObjectPtr obj, int death_frame) - kill the critter and identify the remains of image | |
void kill_critter_type (int pid, int death_frame) - kills all the critters with the given PID and defines the image remains | |
void override_map_start_hex (int tile_num, int elev, int rot) - force the player's position when loading maps | |
void mark_world_subtile_visited (int xPos, int yPos, int radius) - mark the tile map of the world as visited | |
void wm_area_set_pos (int areaIdx, int xPos, int yPos) - set the world coordinates for the specified city | |
int wm_get_subtile_state (int xPos, int yPos) - the state of the tile world map | |
int worldmap_xpos - returns the x coordinate of the current location on the world map | |
int worldmap_ypos - returns the y coordinate of the current location on the world map | |
void mark_area_known (int mark_type, int area, int mark_state) - establish the status of the location | |
void town_map - request to move to the city map | |
void world_map - request to go to the world map | |
void mark_on_map (int area) - mark the city on the map | |
void unmark_on_map (int area) - not to mark the city on the map | |
void attack (ObjectPtr who) - makes the critter, the script is called, to attack the specified object | |
void attack_complex (ObjectPtr who, int called_shot, int num_attacks, int bonus, int min_damage, int max_damage, int attacker_results, int target_results) - makes the critter, the script is called, to attack the specified object with different modifiers | |
void attack_setup (ObjectPtr who, ObjectPtr victim) - makes a critter who attack victim | |
Boolean combat_is_initialized - checks if combat is in the process | |
void terminate_combat - team combat system to stop the fight | |
string message_str (int msg_list, int msg_num) - returns a string message to the number of the file msg | |
void display_msg (string message) - displays a message on the information display | |
void float_msg (ObjectPtr who, string msg, int type) - create a "floating" message (above Critter) | |
void dialogue_reaction (int mood) - animates an emotional reaction in the dialogue | |
void dialogue_system_enter - automatic invocation of the dialogue system | |
void end_dialogue - complete dialogue | |
void giq_option (int iq_test, int msg_list, int msg_num, procedure target, int reaction) - display options in the dialog | |
void gsay_message (int msg_list, int msg_num, int reaction) - displays a replica of the NPC, do not imply any response from the player | |
void gsay_option (int msg_list, int msg_num, procedure target, int reaction) - display options in the dialog box without checking intelligence | |
void gsay_reply (int msg_list, int msg_num) - displays a replica of the NPC | |
void start_gdialog (int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx) - to start a dialogue | |
void gsay_start - ctavitsya before calling start a dialogue | |
void gsay_end - ctavitsya after the call to start a dialogue | |
void gdialog_mod_barter (int modifier) - Entering barter with the specified modifier | |
void gdialog_set_barter_mod (int mod) - sets the current value of the modifier barter | |
string mstr (int msg_num) - returns a string message from a predefined file msg | |
string g_mstr (int msg_num) - returns a string message from a file of standard messages | |
void display_mstr (int msg_num) - displays a message on the information display | |
void floater (int msg_num) - creates a "floating" message on the object in the script which called | |
void floater_rand (int min_msg_num, int max_msg_num) - creates random "floating" message on the object in the script which called | |
void gen_floater (ObjectPtr who, int msg_num) - standard output "floating" messages | |
void gdialog_barter - Entering barter | |
void start_dialogue (ObjectPtr who, int mood) - to start a dialogue | |
void GOption (int msg_num, procedure target, int iq_test) - withdraw answer with a positive emotional reaction using a predefined message file | |
void NOption (int msg_num, procedure target, int iq_test) - withdraw answer with a neutral emotional reaction using a predefined message file | |
void BOption (int msg_num, procedure target, int iq_test) - withdraw answer with a negative emotional reaction using a predefined message file | |
void GLowOption (int msg_num, procedure target) - withdraw answer with a positive emotional reaction to a character with low intelligence, using a predefined message file | |
void NLowOption (int msg_num, procedure target) - withdraw answer with a neutral emotional reaction to a character with low intelligence, using a predefined message file | |
void BLowOption (int msg_num, procedure target) - withdraw answer with a negative emotional reaction to a character with low intelligence, using a predefined message file | |
void GMessage (int msg_num) - displays a replica of the NPC with a positive emotional reaction, does not imply any response from the player | |
void NMessage (int msg_num) - displays a replica of the NPC with a neutral emotional response does not imply any response from the player | |
void BMessage (int msg_num) - displays a replica of the NPC with a negative emotional reaction, does not imply any response from the player | |
void Reply (int msg_num) - displays a replica of a predefined PS file msg | |
void Reply_Rand (int msg_num_start, int msg_num_end) - displays a random NPC replica of the specified range | |
void party_add (ObjectPtr who) - attaches to the player party member | |
ObjectPtr party_member_obj (int pid) - returns a pointer to a party member for PID | |
int party_member_count (int countHidden) - returns the number of party members in a team player | |
void party_remove (ObjectPtr who) - disconnect the player from the party member | |
void game_ui_disable - block the user interface (control) | |
void game_ui_enable - unlock user interface (control) | |
boolean game_ui_is_disabled - check the status of the user interface | |
void endgame_movie - lose the final movie | |
void endgame_slideshow - lose the final slideshow | |
void play_gmovie (int movieNum) - play video | |
void gfade_in (int time) - the restoration of the screen after quenching | |
void gfade_out (int time) - screen blanking | |
int metarule (int meta_switch, int meta_par) - function works with a variety of gaming options, has a huge number of variations | |
int metarule3 (int meta3_switch, int meta3_par1, int meta3_par2, int meta3_par3) - another feature of working with a variety of options for the game, is different from the number of arguments metarule | |
int combat_difficulty - returns the complexity of the fight, set in the game settings | |
int difficulty_level - returns the complexity of the game, set in the settings | |
boolean language_filter_is_on - check the filter mat | |
int running_burning_guy - returns the running-burning-guy, set in the game settings | |
int violence_filter_setting - the current level of violence | |
void elevator (int elevator_ID) - opens a window lift with a given ID | |
void signal_end_game - signal system to complete the game | |
int weapon_dmg_type (ObjectPtr weapon) - returns the type of damage caused by weapon weapon | |
Boolean critter_can_barter (ObjectPtr who) - check for the ability to trade with the critters who | |
int critter_kill_type (ObjectPtr who) - returns the type of critter killed by type | |
int set_car_carry_amount (int amount) - set the maximum weight of the load for the machine | |
int car_carry_amount - returns Makimalno weight of the load for the machine | |
int mark_map_entrance_state (int map_idx, int state) - set the state of the input map (off / on) for all levels | |
int mark_map_entrance_elev_state (int map_idx, int elev, int state) - set the state of the input map (off / on) for the specified level | |
ObjectPtr tile_get_next_critter (int tile_num, int elev, ObjectPtr last_critter) - returns a pointer to the next critter on a given hex | |
int art_change_fid_num (ObjectPtr who, int fid) - change the base number FID (frame ID) | |
int game_ticks (int seconds) - the transformation of a second -> tick | |
int game_time - returns the current game time in ticks (the time elapsed from the start of the game) | |
void game_time_advance (int amount) - increases the game time (the time elapsed from the start of the game) for a specified number of ticks | |
int game_time_hour - returns the current time in the format HHMM | |
int game_time_in_seconds - returns the current game time (the time elapsed from the start of the game) in seconds | |
int get_day - returns the current number | |
int get_month - returns the current month | |
void CreateWin (string win_name, int x, int y, int width, int height) - creates a window with the name win_name | |
void DeleteWin (string win_name) - hides and removes the specified window | |
void SelectWin (string win_name) - selects the specified window (make it active) | |
void ShowWin - displays the active window on the screen (see. also SelectWin) | |
void ScaleWin (string win_name, int x, int y, int width, int height) - changes the position and size of the window with zoom window contents | |
void ResizeWin (string win_name, int x, int y, int width, int height) - changes the position and size of the window with zoom window contents | |
void LoadPaletteTable (string palfilename) - download palette | |
void Display (string pcxfilename) - pcx image display in the active window | |
void DisplayRaw (string pcxfilename) - pcx image display in the active window | |
void DisplayGFX (string pcxfilename, int x, int y, int width, int height) - pcx image display in the active window | |
void FillWin3x3 (string pcxfilename) - displays the picture in a format pcx in the active window (see. SelectWin), if the size of the images and the windows do not match, then tries to "pave" window somehow perfectly monstrous way. The color palette is converted automatically. | |
void FillWin (int R, int G, int B) - to fill in the active window (see. SelectWin) specified color | |
void FillRect (int x, int y, int width, int height, int R, int G, int B) - to fill in the specified color specified rectangle | |
void AddButton (string btn_name, int x, int y, int width, int height) - create a button with the name btn_name | |
void DeleteButton (string btn_name) - removes button btn_name | |
void AddButtonGFX (string btn_name, string downpcx, string uppcx, string overpcx) - binds to the button btn_name graphics for cases of "pressed", "depressed" and "mouse over the button" | |
void AddButtonProc (string btn_name, procedure button_on, procedure button_off, procedure button_press, procedure button_release) - connects to the button btn_name procedures for handling events | |
void AddButtonText (string btn_name, string text) - creates the button label text btn_name | |
void AddRegion string reg_name {int x, int y, int x, int y, int x, int y, ...} - add arbitrary domain name reg_name | |
void DeleteRegion (string reg_name) - remove domain reg_name | |
void AddRegionProc (string reg_name, procedure on, procedure off, procedure press, procedure release) - links with the region reg_name procedures for handling events | |
void ActivateRegion (string reg_name, int reg_proc) - perform one of the related area reg_name procedures (see. AddRegionProc) | |
Print Print text with the current settings on the screen | |
void GotoXY (int x, int y) - sets the current coordinates of x and y | |
void Print (string text) - displays the text with the current settings on the screen | |
void Format (string text, int x, int y, int width, int height, int attrib) - to display text in a specified region | |
void PrintRect (string text, int width, int tab) - text to display text in the current position (see. GotoXY) | |
void SetFont (int font) - sets the font | |
void SetTextFlags (int flags) - various flags text | |
void SetTextColor (int R, int G, int B) - sets the text color | |
void HideMouse - hide the mouse | |
void ShowMouse - show mouse | |
void MouseShape (sting pcxfilename, int x, int y) - changing the shape of the cursor | |
void AddNamedEvent (string event_name, procedure callback_proc) - associate the event with the name of the procedure event_name handler | |
void SignalNamed (string event_name) - raise an event named event_name | |
void ClearNamed (string event_name) - delete the specified event | |
snd_handler soundplay (string file, int mode) - plays a sound file | |
void sounddelete (snd_handler handler) - remove (disable) the sound created with soundplay | |
void soundstop (snd_handler handler) - to stop playing the sound created with soundplay | |
void soundpause (snd_handler handler) - pause the sound created with soundplay | |
void soundresume (snd_handler handler) - resume playback sound stopped soundpause | |
void soundrewind (snd_handler handler) - in the idea rewind to the beginning, but the effect is not observed (F2 v1.02d eng) | |
void SayReplyWindow (int x, int y, int width, int height, string pcxfilename) - specify settings window replicas NPC | |
void SayOptionWindow (int x, int y, int width, int height, string pcxfilename) - specify settings window responses Player | |
void SayReplyTitle (string title) - set the window title replicas NPC (the text that will appear at the top of the window) | |
void SayBorder (int x, int y) - indent the text output | |
void SaySetSpacing (int spacing) - set the line spacing options in the box, the responses (see. SayOptionWindow) | |
void SayMessageTimeout (int delay) - delay in seconds for SayMessage (message will not be able to remove the mouse, will be held until a specified time) | |
void SetHighlightColor (int R, int G, int B) - sets the color of the backlight | |
void SayOptionColor (int R, int G, int B) - fills the window responses player in this color | |
void SayReplyColor (int R, int G, int B) - fills the window replicas NPC specified color | |
void SayOptionFlags (int flags) - window flags responses Player | |
void SayReplyFlags (int flags) - window flags replicas NPC | |
void SayStart - the entrance to the interactive mode | |
void SayEnd - closes the dialog mode | |
void SayQuit - set a flag out of the dialogue | |
void SayGotoReply (string reply_name) - go to the specified replica NPC | |
void SayReply (string reply_name, string reply_text) - display the window replica replica NPC (see. SayReplyWindow) | |
void SayOption (string option_text, string reply_name) or | |
void SayOption (string option_text, procedure target) - to bring in the answer box responses player (see. SayOptionWindow) | |
void SayMessage (string message_title, string message_text) - display the window replicas message, retractable mouse (see. SayReplyWindow and SayMessageTimeout) | |
void AddKey (char key_code, procedure callback_proc) - associate the specified key with the procedure handler | |
void DeleteKey (char key_code) - related to cancel the procedure for the specified key | |
void FadeIn (int delay) - slowly restore screen | |
void FadeOut (int delay) - slowly pay off the screen | |
string SelectFileList (string title, string mask) - display a file selection dialog | |
void spawn (string int_file_name) - causes (raises) the specified script | |
void fork (string int_file_name) - causes the specified script | |
void Cancel (procedure procedure_name) - cancels the call waiting on the stack of procedure, if this procedure in the stack not, does nothing | |
void CancelAll - cancels all pending call stack procedures | |
void wait (int time) - stops the game at a specified time | |
int anim_action_frame (ObjectPtr who, int frame) - returns the animation action of a given object animation | |
boolean anim_busy (ObjectPtr who) - Checking the status of object animation | |
void art_anim (int fid) - returns the type of animation for a given FID | |
void anim (ObjectPtr who, int anim, int direction) - plays the specified animation for a given object in a given direction | |
void animate_move_obj_to_tile (ObjectPtr who, int tile, int speed) - animation move the object to the specified hex | |
void animate_stand_obj (ObjectPtr obj) - plays the animation with the number 0 for a given object | |
void animate_stand_reverse_obj (ObjectPtr obj) - plays the animation with the number 0 for a given object backwards | |
void explosion (int where, int elevation, int damage) - produce an explosion | |
void reg_anim_animate (ObjectPtr what, int anim, int delay) - adds a single turn animation | |
void reg_anim_animate_forever (ObjectPtr what, int anim, int delay) - adds to all single animation that will run "forever" | |
void reg_anim_animate_reverse (ObjectPtr what, int anim, int delay) - adds a single turn animation, which will be played backwards | |
void reg_anim_func (int par1, int par2) - work with a list of animations | |
void reg_anim_obj_move_to_obj (ObjectPtr who, ObjectPtr dest_obj, int delay) - add a queue object animation going to another | |
void reg_anim_obj_run_to_obj (ObjectPtr who, ObjectPtr dest_obj, int delay) - adds to the queue animation podbeganiya one object to another | |
void reg_anim_obj_move_to_tile (ObjectPtr who, int dest_tile, int delay) - adds to the queue object animation, coming to a given hex | |
void reg_anim_obj_run_to_tile (ObjectPtr who, int dest_tile, int delay) - adds to the queue object animation, running to the target hex | |
void play_sfx (string sfxFileName) - Plays the specified sound effect | |
void sfx_build_char_name (ObjectPtr who, int anim_num, int gsound_character_extra) - generates a string - the name of the file acm, which is used by reg_anim_play_sfx. Used to produce sound effects related to the critter. | |
void sfx_build_weapon_name (int gsound_sfx_weapon_action_type, ObjectPtr what, int hit_mode, ObjectPtr who) - generates a string - the name of the file acm, which is used by reg_anim_play_sfx. Is used to get the sound effects of weapons. | |
void reg_anim_play_sfx (ObjectPtr who, string sfx_name, int delay) - adds to the queue Play the sound | |
void animate_move_to_tile (int tile) - animation "go to the specified hex" | |
void animate_move_to_tile_force (int tile) - animation "go to the specified hex" (current animation while suspended) | |
void animate_rotation (int direction) - animation change the direction of gaze | |
void animate_run_to_tile (int tile) - animation running on a given hex | |
void animate_run_to_tile_force (int tile) - animation running on a given hex (current animation while suspended) | |
void animate_set_frame (int newFrame) - replace the current animation frame for a given | |
void animate_stand - plays the animation with the number 0 | |
void animate_stand_reverse - plays the animation with the number 0 backwards | |
void face_critter (ObjectPtr Obj1, ObjectPtr Obj2) - expand the object to the object 1 person 2 | |
void reg_anim_begin () - start compiling a list of animations | |
void reg_anim_clear (ObjectPtr object) - clear the list of animations | |
void reg_anim_end () - to finish compiling a list of animations and the beginning of a given sequence | |
int global_var (unsigned int var_index) - returns the value of the specified global variable | |
void set_global_var (unsigned int var_index, int value) - assign a value to a global variable | |
int local_var (unsigned int var_index) - returns the value of the specified local variable | |
void set_local_var (unsigned int var_index, int value) - assign a value to a local variable | |
int map_var (unsigned int var_index) - returns the value of a given variable maps | |
void set_map_var (unsigned int var_index, int value) - assign a value to a variable card | |
void inc_global_var_amt (int var_index, int amt) - increase the value of a global variable to the number amt | |
void inc_global_var (int var_index) - increment a global variable | |
void dec_global_var_amt (int var_index, int amt) - to reduce the value of a global variable to the number amt | |
void dec_global_var (int var_index) - decrement the global variable | |
void inc_map_var_amt (int var_index, int amt) - increase the value of the card on the number amt | |
void inc_map_var (int var_index) - increment variable maps | |
void dec_map_var_amt (int var_index, int amt) - reduce the value of the card on the number amt | |
void dec_map_var (int var_index) - decrement the variable map | |
void inc_local_var_amt (int var_index, int amt) - increase the value of a local variable to the number amt | |
void inc_local_var (int var_index) - increment a local variable | |
void dec_local_var_amt (int var_index, int amt) - to reduce the value of the local variable to the number amt | |
void dec_local_var (int var_index) - decrement local variable | |
int gvar_bit (int var_index, int bit_num) - check the status of the specified bit of this global variable | |
int mvar_bit (int var_index, int bit_num) - check the status of the specified bit specified variable maps | |
int lvar_bit (int var_index, int bit_num) - check the status of the specified bit specified local variable script | |
int INV (int bit_num) - inversion bit mask | |
void set_gvar_bit_on (int var_index, int bit_num) - set the specified bit in the specified global variable 1 | |
void set_mvar_bit_on (int var_index, int bit_num) - set the specified bit in the specified variable map 1 | |
void set_lvar_bit_on (int var_index, int bit_num) - set the specified bit of this local variable in the script 1 | |
void set_gvar_bit_off (int var_index, int bit_num) - set the specified bit in the specified global variable 0 | |
void set_mvar_bit_off (int var_index, int bit_num) - set the specified bit in the specified variable card 0 | |
void set_lvar_bit_off (int var_index, int bit_num) - set the specified bit of this local variable in the script 0 | |
void debug_msg (string text) - displays a message box debug message | |
// VANILLA OPCODES (from falloutmods.wikia.com) - will override above | |
int action_being_used() - Script Returns the current skill () being used on a script object. | |
void add_obj_to_inven(ObjectPtr who, ObjectPtr item) - Adds an object (item) to another object’s (who’s) inventory. Note that this only works with objects of type Item. | |
void add_mult_objs_to_inven(ObjectPtr who, ObjectPtr item, int count) - Adds (count) instances of an object (item) to another object’s (who’s) inventory. Note that this only works with objects of type Item. | |
void add_timer_event(ObjectPtr obj, int time, int info) - Adds a timed event call to the queue, at a given time offset, to call an object’s (obj) script. Info is used to let scripts differentiate between timed event calls so that they can be hooked in multiple times. Info is read back by the script using the fixed_param operator. Note that time is in ticks (you can use game_ticks(seconds_num) to get the time in ticks from time in seconds). | |
void anim(ObjectPtr who, int anim, int direction) - Sets up a single-frame animation (anim) for the object (who) that runs in the given direction. | |
int anim_action_frame(ObjectPtr who, int frame) - Returns the action frame of the given art frame on a given object (who). This can be used as the delay in an animation registration sequence. | |
boolean anim_busy(ObjectPtr who) - Returns True if object (who) is currently animating, otherwise False. This can be used to determine if a given object has completed an animation. | |
void animate_move_obj_to_tile(ObjectPtr who, int tile, int speed) - Sets up an animation for a critter (who) to walk to a given tile (hex) at a given speed (speed). Speed (walk/run) can also have a flag attached (see define.h) to force the object (who) to stop it’s current animation (for instance, if it was already walking somewhere) and then walk/run to the new location (tile). | |
void animate_rotation(0-5 direction) - Changes the orientation (facing) of the self-object to the given direction. Note: In Fallout 1 this can be done with the anim() command. An example: | |
void animate_run_to_tile(int tile) - Sets up an animation for the self-object to RUN to a given tile (hex). | |
void animate_set_frame(int newFrame) - Changes the current animation frame of the self-object to the given frame # (newFrame). This can be used to make lights go to broken lights or to alarm/siren lights, for example. Should be used in place of animate_stand for 2-frame anims. animate_stand void Anim Sets up an animation for the currently focused object (self) to run it’s stand animation. This can be used to open doors, open container items (Refridgerator, for example) or to run a critter’s fidget animation. | |
void animate_stand_obj(ObjectPtr obj) - Sets up an animation for an object (obj) to run it’s stand animation. This can be used to open doors, open container items (Refridgerator, for example) or to run a critter’s fidget animation. animate_stand_reverse void Anim Sets up an animation for the currently focused object (self) to run it’s stand animation in reverse. This is used only for non-critters, to cause them to close (close doors, open containers, etc.) | |
void animate_stand_reverse_obj(ObjectPtr obj) - Sets up an animation for an object (obj) to run it’s stand animation in reverse. This is used only for non-critters, to cause them to close (close doors, open containers, etc.) | |
void art_anim(int fid) - Returns the animation that this fid represents (ANIM_stand, ANIM_pickup, etc.). | |
void attack(ObjectPtr who) - Causes the focused object (self) to attempt to attack an object (who). Note that this is a macro to attack_complex() below. | |
void attack_complex(ObjectPtr who, int called_shot, int num_attacks, int bonus, int min_damage, int max_damage, int attacker_results, int target_results) - Causes the current object (self – must be a critter) to attempt to attack a critter (who) with various parameters modifying the combat: | |
void attack_setup(ObjectPtr who, ObjectPtr victim) - Sets up an attack from who on victim, without expecting this script to be involved. Can be used to setup attacks on critters from the map script. car_current_town int Map Returns the current town area the car can be found at. Area #’s can be found in scripts\headers\maps.h car_give_to_party int Map Gives the car to the party, and takes them to the worldmap. | |
int car_give_gas(int amount) - Gives the car a given amount (amount) of gas. | |
int combat_difficulty() - Returns the current Combat difficulty level of the game (defined in the options screen). | |
int combat_is_initialized() - Returns True if the system is currently in combat mode, False otherwise. | |
int create_object(int pid, int tile_num, 0-2 elev) - Creates a new object of prototype (pid), placing it at a given tile # and at a given elevation. If the prototype indicates a script should be attached, then it will be. | |
int create_object_sid(int pid, int tile_num, 0-2 elev, int sid) - Creates a new object of prototype (pid), placing it at a given tile # and at a given elevation. If sid is not -1, then it indicates that the default script should be overriden by this new script #. | |
int critter_add_trait(ObjectPtr who, int trait_type, int trait, int amount) - Adds a particular trait (trait) of a given type (trait_type) to a particular critter (who). Possible traits under the SPECIAL system are limited to: | |
int critter_attempt_placement(ObjectPtr who, int hex, 0-2 elev) - Attempts to place a critter at a given destination hex & elevation, if it fails, then it tries to find a nearby hex that is that is as near as possible to the start hex. No LONGER checks to see if the hex is visible on-screen. | |
void critter_damage(ObjectPtr who, int dmg_amount) - Inflicts damage on a critter (who) of a given amount, killing it if necessary. | |
void critter_heal(ObjectPtr who, int amount) - Heals a critter for a given amount (if given a value above their MaxHP will go up to their maximum HP). [Note: can also input negative amounts, causing the critter to be hurt for that amount. This is useful because it bypasses all resistances and thresholds. Sduibek (talk) 18:03, August 4, 2012 (UTC)] | |
int critter_injure(ObjectPtr who, int how) - Injures a given critter (who) by crippling given limbs/body parts (defined by DAM_CRIP_ARM_LEFT, DAM_BLIND, etc. in define.h) | |
ObjectPtr critter_inven_obj(ObjectPtr who, int where) - Returns a pointer to an object that is in a given spot (NULL if none). The appropriate values for where are: INVEN_TYPE_WORN, INVEN_TYPE_RIGHT_HAND, and INVEN_TYPE_LEFT_HAND. | |
int critter_is_fleeing(ObjectPtr who) - Returns True if the critter object (who) has its FLEE flag set. | |
int critter_mod_skill(ObjectPtr who, int skill, int amount) - Modifies a given skill in a given critter object (who) by a given amount. Note: this currently is only valid on the player (obj_dude) object. | |
int critter_rm_trait(ObjectPtr who, int trait_type, int trait, int amount) - Removes a particular trait (trait) of a given type (trait_type) from a particular critter (who). (See critter_add_trait.) | |
int critter_set_flee_state(ObjectPtr who, Boolean flee_on) - Sets the FLEE flag on or off. This controls whether the critter flees during combat. | |
int critter_skill_level(ObjectPtr who, int skillNum) - Returns the current skill level of a particular object’s (who) skill (skillNum). | |
int critter_state(ObjectPtr who) - Returns the state of a given critter object (from combat data), used to determine if a critter is dead, unconscious, etc. | |
int critter_stop_attacking(ObjectPtr who) - Flags the critter object (who) as no longer wishing to be active in combat. cur_map_index int Map Returns the index # of the current map, to be matched with the define-constant in define.h. cur_town int Map Returns the index # of the current town, to be matched with the define-constant in define.h. days_since_visited int Map Returns the number of days since this map was last visited, or (-1) if it has never been visited before.void debug_msg(string text) - Prints a string to the debug monitor. Should be used exclusively for debug information, instead of display_msg()! The user will never see these messages unless they have debugging enabled and activated. If they have debugging enabled and DEBUGLOG set, the messages will only show up in debug.log file. | |
int destroy_object(ObjectPtr obj) - Destroys an object (obj), which will cause it’s script to be called in the destroy_proc section if the object is *NOT* the calling object. | |
int destroy_mult_objs(ObjectPtr item, int count) - Destroys count number of instances of an item object. This function will figure out which inventory this item is in (if it isn’t on the ground). If it is on the ground, of course, there is only one instance of this object, so only one will be destroyed. | |
void dialogue_reaction(int mood) - Set up a reaction animation in the dialogue system. dialogue_system_enter void Dialog Tells the dialog system that this object is requesting the talk system. This is used when the script wants to start dialog instead of waiting for the player to initiate it. The script will be called back in its talk_proc section. difficulty_level int Returns the current Game difficulty level of the game (defined in the options screen). | |
void display_msg(string message) - Displays a string on the in-game PDA display (lower-left hand corner). | |
int do_check(ObjectPtr who, int check, int modifier) - Do a check/test-roll versus one of the various basic traits (strength, perception, etc.). Note: these cannot generate Critical Success or Critical Failure as they are a basic X==Y check. | |
void drop_obj(ObjectPtr obj) - Causes the critter self-object to remove a given object (obj) from it’s inventory and place it on the ground at its hex. This animates the self_obj. | |
int drug_influence(ObjectPtr who) - Returns True if a given critter object (who) is currently under any drug influences, False otherwise. dude_obj (ObjectOtr) Returns a pointer to the dude object (the player). | |
int elevation(ObjectPtr obj) - Returns the current elevation being displayed. | |
void end_dialogue() - Terminates the dialogue system. endgame_movie void Meta Plays the endgame movie. | |
void endgame_slideshow() - Plays the endgame slideshow. The slideshow will fade in to its palette, so it is proper to call gfade_out(1) and then expect this command to fix the palette for you. | |
int explosion(int where, 0-2 elevation, int damage) - Sets up an explosion at a given tile number (where) on a given elevation, that will cause damage in a radius. fixed_param int Returns the value of the scripts fixed parameter. This is used with add_timer_event, for instance, to pass the info parameter back to the script.void float_msg(ObjectPtr who, str msg, int type) - Attempts to create a floating-text message (str) attached to an object (who) using colors dictated by type. There are two special types, WARNING and SEQUENTIAL. WARNING is used to print a message centered on the screen (such as for end-of-quest notifications), and SEQUENTIAL will cycle through the colors, in an attempt to give critters different-colored messages to differentiate them. | |
int game_ticks(int seconds) - Returns the number of game ticks equal to a given # of seconds. | |
int game_time() - Returns the current game time in ticks. | |
void game_time_advance(int amount) - Advances the current game time by (amount) ticks. | |
int game_time_hour() - Returns the current hour of the day in a normal format, but without the colon. For example, the current starting game time is 721 (which is 7:21 am). | |
void game_ui_disable() - Disables game user-interface input from the player (to ‘lock-out’ the player). You *MUST* make sure to re-enable the UI at some point afterwords. | |
void game_ui_enable() - Re-enables game user-interface input from the player. This *MUST* be called relatively soon after disabling the UI or the player will be stuck, unable to do anything. | |
int game_ui_is_disabled() - Returns True if the game UI is currently disabled (the player is currently ‘locked-out’), and False otherwise. | |
int gdialog_barter() - Tells the dialog system to switch to the barter screen. (Sets the barter modifier to 0). | |
int get_critter_stat(ObjectPtr who, int stat) - Returns the value of a desired attribute/stat in a critter object (who). get_day int Time Returns the current day of the month. | |
int gdialog_mod_barter(+/- percent modifier) - Tells the dialog system to switch to the barter screen, using a given modifier. get_month int Time Returns the current month of the year. | |
int get_pc_stat(int pcStat) - Returns the value of a desired pc-only stat of the obj_dude. These are found in define.h all starting with “PCSTAT_”. | |
int get_poison(ObjectPtr who) - Returns the value of a given critters’ (who) poison level. NOTE: In Fallout 1 this gives an error message. | |
void gdialog_set_barter_mod(int mod) - Sets the current modifier for barter to a given percentage (mod). Used to make barter easier/harder, even if the player initiates barter (as opposed to the script starting it.) | |
void gfade_in(int time) - Does a palette fade to black. The Time parameter is currently not actually used. | |
void gfade_out(int time) - Does a palette fade from black to the game palette. The Time parameter is currently not actually used. | |
void giQ_Option(int iq_test, int msg_list, int msg_num, procedure target, int reaction) - Sets up an option-choice for a reply block if the player’s IQ statistic is equal to or greater than a given value (iq_test), getting the string from the message file (msg_list) and message number (msg_num), which will cause a given reaction (reaction), and if chosen will jump to the given (target) procedure. | |
void give_exp_points(int points) - Adds experience points (points) to the player’s total. These points may then be used by the player to enhance skills, etc. | |
int global_var(unsigned int var_index) - Returns the value of a global variable # (var_index). | |
void gSay_End(unsigned int var_index) - Ends a dialog sequence, which will bring up the sequence (actually display it). | |
void gSay_Message(int msg_list, int msg_num, int reaction) - Sets up a sayMessage, which is a reply with just a [Done] option. The msg_list determines which message file to look in, and the msg_num determines which line to use from the file. | |
void gSay_Option(int msg_list, int msg_num, procedure target, int reaction) - Sets up an option-choice for a reply block, getting the string from the message file (msg_list) and message number (msg_num), which will cause a given reaction (reaction), and if chosen will jump to the given (target) procedure. | |
void gSay_Reply(int msg_list, int msg_num) - Sets up a reply block (what the *CRITTER* says). gSay_Start void Dialog Starts a new dialog sequence. | |
int has_skill(ObjectPtr who, int skill [0 to 17]) - This returns the level of the skill of the target critter. (0 to 200 for Fallout 1), (0 to 300 for Fallout 2) | |
int has_trait(int trait_type, ObjectPtr who, int trait) - Returns the value of a given critter object’s (who) trait of a given Trait_type (see define.h). This can be used to determine if the player has a particular Perk, AI Packet, team num, current rotation, or Trait (finesse, bruiser, etc.). | |
int how_much(int val) - Returns the value of a completed skill vs. skill contest (how much the rolls differed by). This requires that you first call one of the contest roll commands, such as roll_vs_skill, skill_contest, etc.. | |
int inven_count(ObjectPtr what) - Returns the count of how many inventory slots are filled on a given object (what). | |
ObjectPtr inven_ptr(ObjectPtr what, int slotNum) - Returns a pointer to the object in slot # (slotNum) in a given object (what). | |
int is_critical(int val) - Returns True if a given contest roll result is a critical result, otherwise False. | |
boolean is_loading_game() - Map Returns True if the game is currently loading, False otherwise. This is used so that bad things don’t happen on game load because a script is doing map_enter setup stuff. | |
int is_skill_tagged(int skillNum) - Returns True if a given skill is tagged. | |
int is_success(int val) - Returns True if a given contest roll result value is a success, otherwise False. Can generate Critical Success or Critical Failure as well. | |
int item_caps_adjust(ObjectPtr obj, int amount) - Modifies the current caps count in an object (obj) by a given amount (amount). Can be positive or negative. | |
int item_caps_total(ObjectPtr obj) - Returns the current caps total in a given object’s (obj) inventory. | |
int jam_lock(ObjectPtr lockableObj) - Jams a lock, which prevents the player from picking the lock for approximately 24 hours. Meant to be used when a player critically fails to pick a lock. | |
void kill_critter(ObjectPtr obj, int death_frame) - Kills a critter (obj) outright, placing it in the chosen death frame. Note: this does NOT animate the critter, and does NOT refresh the screen! It is meant to be used in scripts run when entering/exiting a map (map_init/map_exit). | |
void kill_critter_type(int pid) - Kills all critters of a given type (pid) outright. See kill_critter above. NOTE: This can result in the "frozen bodies" issue! kill_critter should always be used instead if possible, for this reason. Frozen bodies causes no actual gameplay issues, but it looks unrealistic and ridiculous. | |
boolean language_filter_is_on() - Returns True if the language filter is currently filtering harsh language, False otherwise. | |
void load_map(string or int map_name, int start_location) - Loads a new map (map_name), removing all scripts currently running and passing on the entrance location (start_location) to the new map’s map_init script. Can also use the number representing the map in the map list (for example, between 0 to 64 in Fallout 1) | |
int local_var(unsigned int var_index) - Returns the value of a local variable of given index # (var_index). If the user is not allowed local vars up to this number in the list of critters, this can generate errors. (see debug.log) | |
int map_first_run() - Returns True if the current map is being run for the first time (in other words, this map was not loaded from a save-game). | |
int map_is_known(int mapNum) - Returns True if a given map index (mapNum) is known, False otherwise. | |
int map_known(int mapNum) - Returns True if a given map # (mapNum) is known, False otherwise. | |
int map_var(unsigned int var_index) - Returns the value of a map-global variable of a given index # (var_index). | |
string message_str(int list, int msg_num) - Returns a string from the message module for a given list and a given # (msg_num). | |
int move_to(ObjectPtr obj, int tile_num, 0-2 elev) - Immediately moves an object (obj) to the given tile number and elevation on the current map. | |
int move_obj_inven_to_obj(ObjectPtr srcObj, ObjectPtr destObj) - Moves an object’s (srcObj) entire inventory into another object’s (destObj) inventory. | |
ObjectPtr obj_art_fid(ObjectPtr obj) - Returns the fid # (used to index art) of a given object (obj). | |
ObjectPtr obj_being_used_with() - Returns a pointer to the object being used on another object. | |
boolean obj_can_hear_obj(ObjectPtr src_obj, ObjectPtr dst_obj) - Returns True if the source object (src_obj) is capable of hearing the destination object (dst_obj). This includes distance factors, current activity (standing/walking/running), and skill use (stealth/etc.). | |
boolean obj_can_see_obj(ObjectPtr src_obj, ObjectPtr dst_obj) - Returns True if the source object (src_obj) has line-of-sight (LOS) with the destination object (dst_obj). This also takes into account perception & stealth rolls of the objects are critters. | |
ObjectPtr obj_carrying_pid_obj(ObjectPtr who, int pid) - Returns an Object pointer to an instance of an object of type pid if an object (who) is carrying an object of that type. | |
void obj_close(ObjectPtr what) - Attempts to close a given object (what) if it is of an openable type. | |
void obj_drop_everything(ObjectPtr who) - Causes a critter object (who) to drop all objects in it’s inventory and drop it on the ground at its feet. | |
boolean obj_is_carrying_obj_pid(ObjectPtr obj, int pid) - Returns the quantity of objects with matching prototype index #’s (pid) carried in the inventory of another object (obj). | |
int obj_is_locked(ObjectPtr what) - Returns True if a given object (what) is a locked object, False if it is unlocked or not a lockable object. | |
int obj_is_visible_flag(ObjectPtr who) - Returns True if a given object (who) is turned on (visible), False otherwise. | |
int obj_is_open(ObjectPtr what) - Returns True if a given object (what) is an open object, False if it is closed or not an openable object. | |
int obj_item_subtype(ObjectPtr obj) - Returns the subtype of an object of type 'item'. Examples would be food, armor, weapons, etc. | |
void obj_lock(ObjectPtr what) - Attempts to lock a given object (what) if it is of a lockable type. | |
void obj_name(ObjectPtr what) - Returns a string representing the name of the given object (what). | |
int obj_on_screen(ObjectPtr what) - Returns True if a given object (what) is currently being drawn on-screen, False if it is not. | |
void obj_open(ObjectPtr what) - Attempts to open a given object (what) if it is of an openable type. | |
int obj_pid(ObjectPtr obj) - Returns the prototype id # (pid) of an object (obj). | |
void obj_set_light_level(ObjectPtr obj, 1-100 intensity, 0 - 8 distance) - Set the light level for an object to a given intensity (percentage of possible maximum intensity), and distance of light in hexes. | |
int obj_type(ObjectPtr obj) - Returns the type of an object (obj). This would be ‘Item’, ‘Wall’, ‘Scenery’, etc. | |
void obj_unlock(ObjectPtr what) - Attempts to unlock a given object (what) if it is of a lockable type. | |
void override_map_start(int x, int y, 0-2 elev, 0-5 rot) - Used when loading a new map, this forces the player (obj_dude) to start at a particular location and rotation when first coming up. | |
void party_add(ObjectPtr who) - Adds a given critter (who) into the list of party members. This will also setup those objects so that they will not be saved in maps, and certain other things. | |
ObjectPtr party_member_obj(int pid) - Returns an ObjectPtr to a party member that matches a given pid. If that critter isn’t currently a member of the party, then it will return NULL. | |
ObjectPtr party_member_count(int countHidden) - Returns the count of the currently in-party party members. (countHidden) determines whether or not to count the hidden members (hangers-on). | |
void party_remove(ObjectPtr who) - Removes a given critter (who) from the list of party members. This will also change those objects so that certain object- and map-level things will respond differently to them. | |
void pickup_obj(ObjectPtr obj) - Causes the critter self-object to animate and attempt to pick up a given object (obj). If used in regard to a critter, this flag is pinged when a steal detect fails. In other words when detected stealing, pickup_obj is called for the person you were stealing from. | |
void play_gmovie() - Plays one of the Fallout movies (full-screen, compressed, etc.). | |
void play_sfx() - Starts a new sound effect to be played on the queue. | |
void poison(ObjectPtr who, int amount) - Modifies the critter's poison level by a given amount. Positive numbers increase their level of poisoning, negative numbers decrease it. | |
int|string proto_data(int pid, int data_member) - Returns the value of a data-member of a given prototype (pid). | |
void radiation_dec(ObjectPtr who, int amount) - Decrements a critter’s radiation counter by a given amount. NOTE: This should only be done to the player (obj_dude) in Fallout due to design restrictions! | |
void radiation_inc(ObjectPtr who, int amount) - Increments a critter’s radiation counter by a given amount. NOTE: This should only be done to the player (obj_dude) in Fallout due to design restrictions! | |
int random(int min, int max) - Returns a random value between (min) and (max), inclusive. | |
void reg_anim_animate(ObjectPtr what, int anim, int delay) - Adds a single, in-place animation on an object (what) to an animation sequence-list, at a given delay from the previous animation (delay should always be -1)! | |
void reg_anim_animate_forever(ObjectPtr what, int anim, int delay) - Adds a single, in-place animation on an object (what) to an animation sequence-list, at a given delay from the previous animation (delay should always be -1)! This animation will animate continuously until something in the system interrupts it. To be used *very* sparingly, for instance Gizmo’s sign and the ‘pray’ signs in the children of the cathedral (which will have to be toned down). | |
void reg_anim_animate_reverse(ObjectPtr what, int anim, int delay) - Adds a single, in-place reversed animation on an object (what) to an animation sequence-list, at a given delay from the previous animation (delay should always be -1)! reg_anim_begin void Anim Tells the system to start an animation sequence-list. | |
void reg_anim_clear(ObjectPtr object) - Terminates all animations that are currently registered for a given object. reg_anim_end void Anim Activates the animation sequence-list. Without this call the animation will never occur. Note: All animation sequences must be registered at ONCE! In other words, you cannot let the script end and finish registering the animations later. | |
void reg_anim_obj_move_to_obj(ObjectPtr who, ObjectPtr dest_obj, int delay) - Adds an animation to cause a critter object (who) to attempt to walk to another object (dest_obj) at a given delay from the previous animation (delay should always be -1)! | |
void reg_anim_obj_run_to_obj(ObjectPtr who, ObjectPtr dest_obj, int delay) - Adds an animation to cause a critter object (who) to attempt to run to another object (dest_obj) at a given delay from the previous animation (delay should always be -1)! | |
void reg_anim_obj_move_to_tile(ObjectPtr who, int dest_tile, int delay) - Adds an animation to cause a critter object (who) to attempt to walk to a given destination tile number (dest_tile) at a given delay from the previous animation (delay should always be -1)! | |
void reg_anim_obj_run_to_tile(ObjectPtr who, int dest_tile, int delay) - Adds an animation to cause a critter object (who) to attempt to run to a given destination tile number (dest_tile) at a given delay from the previous animation (delay should always be -1)! | |
void reg_anim_play_sfx(ObjectPtr who, string sfx_name, int delay) - Adds an animation to cause an object (who) to attempt to play a given sound effect (sfx_name) at a given delay from the previous animation! | |
void rm_fixed_timer_event(ObjectPtr who, int fixed_val) - Removes (clears) all timer events hooked to a given object’s (obj) script that have a given fixed_value (fixed_val). | |
void rm_obj_from_inven(ObjectPtr who, ObjectPtr obj) - Removes an object (obj) from another object’s (who’s) inventory. Note: this leaves the removed object in at location (0,1) on the map! You must call move_to(…) to place it back on the map. | |
int rm_mult_objs_from_inven(ObjectPtr who, ObjectPtr obj, int count) - Removes (count) instances of an object (obj) from another object’s (who’s) inventory. Note: this leaves the removed object in at location (0,1) on the map! You must call move_to(…) to place it back on the map. NOTE: This function returns the actual count that was removed (if you attempted to remove more instances than existed). You *MUST* store this value in a variable (though you don’t have to actually do anything with it). | |
void rm_timer_event(ObjectPtr obj) - Removes (clears) all timer events hooked to a given object’s (obj) script. | |
Critter roll_dice(obj Critter, int Skill) - Returns the value of the completed dice roll. NOTE: Avellone says this is unimplemented | |
int roll_vs_skill(ObjectPtr who, int skill, int modifier) - Returns the value of a completed skill roll made upon an object’s (who’s) skill level with a given skill, and modified by a given amount (may be zero). This value may then be passed to is_success and is_critical to determine the appropriate states, and the how_much call can be used to determine the difference succeeded or failed by. | |
int rotation_to_tile(int srcTile, int destTile) - Returns the rotation (0…5) to face a particular tile (destTile) from a particular tile (srcTile). | |
int running_burning_guy() - Returns the setting for the running-burning-guy in the game (defined in the options screen). | |
void scr_return() - Sets the return value for a scripts C-engine node, to be used by C code. | |
int script_action() - Script Returns the action that has activated this script. Examples include requests for the description of an object (description_proc), notifications of a spatial script being activated by something hitting its boundary (spatial_proc), or a critter being given its heartbeat (critter_proc, in other words being told to move). | |
void script_overrides() - Tells the C-engine that the script will override default behavior for the object. What this means is that the C-engine will not attempt to do things that it would normally do, in expectation that the script will handle those things itself. This is an IMPORTANT command! It is commonly used for the general player actions upon objects, such as looking at them (requesting a description), using them (opening doors, for example), or using items ON them (using a picklock or a key on a door lock). | |
ObjectPtr self_obj() - Returns a pointer to the object connected to this script. | |
int set_critter_stat(ObjectPtr who, int stat, int val) - Sets the value of a desired attribute/stat in a critter (who) to a given value (val). | |
void set_exit_grids(elevation markElev, int mapID, int elevation, int tileNum, int rotation) - Sets all exit grids on a given elevation (markElev) to point to a destination mapID (may be -1 which means stay on this map), elevation, tileNum, and rotation. | |
void set_global_var(unsigned int var_index, int value) - Sets the value of a global variable (var_index) to a given (value). | |
void set_light_level(int: 1-100 level) - Sets the ambient light level. The range is Full Darkness to Full Daylight. | |
void set_local_var(unsigned int var_index, int value) - Sets the value of a local variable (var_index) to a given (value). | |
void set_map_var(unsigned int var_index, int value) - Sets the value of a map-global variable (var_index) to a given (value). | |
void set_map_start(int x, int y, 0-2 elev, 0-5 rot) - Sets the start location & rotation for the next time this map is entered (loaded & run). | |
void set_obj_visibility(ObjectPtr obj, boolean visibility) - Sets the OBJ_OFF flag for an object (makes it not drawn). | |
void signal_end_game() - Tells the system that a script is indicating the game should be ended. This will return the player to the main-menu. | |
int skill_contest() - Returns the value of a completed skill vs skill contest (to run through is_success & is_critical). | |
ObjectPtr source_obj() - Returns a pointer to the source object (activator) for this action. The source object for a pickup_proc (pickup an object script_action) would be the critter picking the object up, for instance. | |
void start_dialogue(ObjectPtr who, int mood) - Start the dialogue system focusing on a critter (who) and starting in a given (mood). This call sets up the appropriate dialog windows, head art, etc. If this call is not made before the normal dialog calls (sayReply, sayMessage, sayOption, etc.) then the dialog windows will not come up, and only grey boxes will appear with the text. | |
void start_gialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx) - Start the dialogue system focusing on a critter (who) and starting in a given (mood). This call sets up the appropriate dialog windows, head art, etc. If this call is not made before the normal dialog calls (sayReply, sayMessage, sayOption, etc.) then the dialog windows will not come up, and only grey boxes will appear with the text. | |
ObjectPtr target_obj() - Returns a pointer to the target object for this action. The target object is what is being acted upon. terminate_combat void Combat Tells the combat system to terminate prematurely. USE WITH CAUTION. This doesn’t prevent another (or even the SAME) script from re-starting combat, so make sure you turn off any hostile flags, etc. | |
boolean tile_contains_obj_pid(int tile, 0-2 elev, int pid) - Returns True if a particular tile contains an object with a matching prototype index # (obj pid). | |
boolean tile_contains_pid_obj(int tile, 0-2 elev, int pid) - Returns a pointer to the first object that matches a particular pid # that is on a particular tile and elevation. | |
int tile_distance(int tile1, int tile2) - Returns the tile distance between two tile #'s. | |
int tile_distance_objs(ObjectPtr obj1, ObjectPtr obj2) - Returns the tile distance between two objects (between their tile #’s). | |
boolean tile_is_visible(int tile) - Returns True if a given hex (tile) is currently visible, i.e. an object on it could conceivably be displayed on-screen. This includes hexes that may technically have bases that are off-screen, but on whom objects could exist that would bound into the actual display area. | |
int tile_num(ObjectPtr obj) - Returns the tile number of object (obj). | |
int tile_num_in_direction(int start_tile, 0-5 dir, int distance) - Returns the tile number of a tile offset from a starting tile in a given direction (the next tile in that direction). | |
int town_known(int townArea) - Returns True if a given town area (townArea) is known, False otherwise. | |
void town_map() - Sends a request for the game engine to bring up the Town Map screen, for the player to go to different locations in an area (different areas in Vault13, for example). | |
ObjectPtr use_obj_on_obj(ObjectPtr item, ObjectPtr targetObj) - Attempt to use an item object on a target object (targetObj). This could be used to have a critter use a Stimpack on the player, for instance, or to use a key on a door. | |
boolean using_skill(ObjectPtr who, int skill) - Returns True if an active skill is being used, False otherwise. Examples of active skills are Stealth and First Aid. | |
boolean violence_level_setting() - Returns the current setting of the violence level. See define.h for values. | |
void wield_obj(ObjectPtr obj) - Sets up an animation causing a critter (self_obj) to wield an object (obj) in that critters’ inventory. This puts that object in the critter’s hand. | |
void wield_obj_critter(ObjectPtr who, ObjectPtr obj) - Sets up an animation causing a critter (who) to wield an object (obj) in that critters’ inventory. This puts that object in the critter’s hand. | |
void wm_area_set_pos(int areaIdx, int xPos, int yPos) - Sets the World Map coordinates for a given area/town (areaIdx) to a given x and y position. | |
void world_map() - Sends a request for the game engine to bring up the World Map screen, for the player to move around to different locations. | |
int world_map_x_pos() - Returns the current X Position of the party on the World Map. | |
int world_map_y_pos() - Returns the current Y Position of the party on the World Map. | |
// SFALL OPCODES: | |
int read_byte(int address) | |
int read_short(int address) | |
int read_int(int address) | |
char* read_string(int address) | |
void write_byte(int address, int value) | |
void write_short(int address, int value) | |
void write_int(int address, int value) | |
void write_string(int address, char* value) | |
void call_offset_v0(int address) | |
void call_offset_v1(int address, int arg1) | |
void call_offset_v2(int address, int arg1, int arg2) | |
void call_offset_v3(int address, int arg1, int arg2, int arg3) | |
void call_offset_v4(int address, int arg1, int arg2, int arg3, int arg4) | |
int call_offset_r0(int address) | |
int call_offset_r1(int address, int arg1) | |
int call_offset_r2(int address, int arg1, int arg2) | |
int call_offset_r3(int address, int arg1, int arg2, int arg3) | |
int call_offset_r4(int address, int arg1, int arg2, int arg3, int arg4) | |
void set_pc_base_stat(int StatID, int value) | |
void set_pc_extra_stat(int StatID, int value) | |
int get_pc_base_stat(int StatID) | |
int get_pc_extra_stat(int StatID) | |
void set_critter_base_stat(CritterPtr, int StatID, int value) | |
void set_critter_extra_stat(CritterPtr, int StatID, int value) | |
int get_critter_base_stat(CritterPtr, int StatID) | |
int get_critter_extra_stat(CritterPtr, int StatID) | |
void set_critter_skill_points(int critter, int skill, int value) | |
int get_critter_skill_points(int critter, int skill) | |
void set_available_skill_points(int value) | |
int get_available_skill_points() | |
void mod_skill_points_per_level(int value) | |
void set_stat_max(int stat, int value) | |
void set_stat_min(int stat, int value) | |
void set_pc_stat_max(int stat, int value) | |
void set_pc_stat_min(int stat, int value) | |
void set_npc_stat_max(int stat, int value) | |
void set_npc_stat_min(int stat, int value) | |
int input_funcs_available() | |
int key_pressed(int dxScancode) | |
void tap_key(int dxScancode) | |
int get_mouse_x() | |
int get_mouse_y() | |
int get_mouse_buttons() | |
int get_window_under_mouse() | |
int get_year() | |
bool game_loaded() | |
bool graphics_funcs_available() | |
int load_shader(char* path) | |
void free_shader(int ID) | |
void activate_shader(int ID) | |
void deactivate_shader(int ID) | |
void set_shader_int(int ID, char* param, int value) | |
void set_shader_float(int ID, char* param, float value) | |
void set_shader_vector(int ID, char* param, float f1, float f2, float f3, float f4) | |
int get_shader_version() | |
void set_shader_mode(int mode) | |
void force_graphics_refresh(bool enabled) | |
int get_shader_texture(int ID, int texture) | |
void set_shader_texture(int ID, char* param, int texID) | |
void set_global_script_repeat(int frames) | |
void set_global_script_type(int type) | |
int available_global_script_types() | |
bool in_world_map() | |
void force_encounter(int map) | |
void force_encounter_with_flags(int map, int flags) | |
void set_map_time_multi(float multi) | |
void set_world_map_pos(int x, int y) | |
int get_world_map_x_pos() | |
int get_world_map_y_pos() | |
void set_dm_model(char* name) | |
void set_df_model(char* name) | |
void set_movie_path(char* filename, int movieid) | |
void set_perk_image(int perkID, int value) | |
void set_perk_ranks(int perkID, int value) | |
void set_perk_level(int perkID, int value) | |
void set_perk_stat(int perkID, int value) | |
void set_perk_stat_mag(int perkID, int value) | |
void set_perk_skill1(int perkID, int value) | |
void set_perk_skill1_mag(int perkID, int value) | |
void set_perk_type(int perkID, int value) | |
void set_perk_skill2(int perkID, int value) | |
void set_perk_skill2_mag(int perkID, int value) | |
void set_perk_str(int perkID, int value) | |
void set_perk_per(int perkID, int value) | |
void set_perk_end(int perkID, int value) | |
void set_perk_chr(int perkID, int value) | |
void set_perk_int(int perkID, int value) | |
void set_perk_agl(int perkID, int value) | |
void set_perk_lck(int perkID, int value) | |
void set_perk_name(int perkID, char* value) | |
void set_perk_desc(int perkID, char* value) | |
void set_perk_freq(int value) | |
void set_pipboy_available(int available) | |
int get_kill_counter(int critterType) | |
void mod_kill_counter(int critterType, int amount) | |
int get_perk_owed() | |
void set_perk_owed(int value) | |
int get_perk_available(int perk) | |
int get_critter_current_ap(CritterPtr) | |
void set_critter_current_ap(CritterPtr, int ap) | |
int active_hand() | |
void toggle_active_hand() | |
void set_weapon_knockback(WeaponPtr, int type, float value) | |
void set_target_knockback(CritterPtr, int type, float value) | |
void set_attacker_knockback(CritterPtr, int type, float value) | |
void remove_weapon_knockback(WeaponPtr) | |
void remove_target_knockback(CritterPtr) | |
void remove_attacker_knockback(CritterPtr) | |
void set_sfall_global(string/int varname, int/float value) | |
int get_sfall_global_int(string/int varname) | |
float get_sfall_global_float(string/int varname) | |
int create_array(int elementcount, int elementsize) | |
void set_array(int array, any element, any value) | |
any get_array(int array, any element) | |
void free_array(int array) | |
int len_array(int array) | |
void resize_array(int array, int newelementcount) | |
int temp_array(int elementcount, int elementsize) | |
void fix_array(int array) | |
int scan_array(int array, int/float var) | |
int array_key(int array, int index) | |
int arrayexpr(any key, any value) | |
void save_array(any key, int array) | |
int load_array(any key) | |
void set_pickpocket_max(int percentage) | |
void set_hit_chance_max(int percentage) | |
void set_skill_max(int value) | |
void set_xp_mod(int percentage) | |
void set_perk_level_mod(int levels) | |
void set_critter_hit_chance_mod(CritterPtr, int max, int mod) | |
void set_base_hit_chance_mod(int max, int mod) | |
void set_critter_skill_mod(CritterPtr, int max) | |
void set_base_skill_mod(int max) | |
void set_critter_pickpocket_mod(CritterPtr, int max, int mod) | |
void set_base_pickpocket_mod(int max, int mod) | |
int eax_available() | |
void set_eax_environment(int environment) | |
void inc_npc_level(char* npc) | |
int get_npc_level(char* npc) | |
int get_viewport_x() | |
int get_viewport_y() | |
void set_viewport_x(int view_x) | |
void set_viewport_y(int view_y) | |
int get_ini_setting(char* setting) | |
char* get_ini_string(char* setting) | |
int get_game_mode() | |
int get_uptime() | |
void set_car_current_town(int town) | |
void set_fake_perk(char* name, int level, int image, char* desc) | |
void set_fake_trait(char* name, int active, int image, char* desc) | |
void set_selectable_perk(char* name, int active, int image, char* desc) | |
void set_perkbox_title(char* title) | |
void hide_real_perks() | |
void show_real_perks() | |
int has_fake_perk(char* name) | |
int has_fake_trait(char* name) | |
void perk_add_mode(int type) | |
void clear_selectable_perks() | |
void remove_trait(int traitID) | |
void set_pyromaniac_mod(int bonus) | |
void apply_heaveho_fix | |
void set_swiftlearner_mod(int bonus) | |
void set_hp_per_level_mod(int mod) | |
void show_iface_tag(int tag) | |
void hide_iface_tag(int tag) | |
int is_iface_tag_active(int tag) | |
int get_bodypart_hit_modifier(int bodypart) | |
void set_bodypart_hit_modifier(int bodypart, int value) | |
void set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value) | |
int get_critical_table(int crittertype, int bodypart, int level, int valuetype) | |
void reset_critical_table(int crittertype, int bodypart, int level, int valuetype) | |
int get_sfall_arg() | |
void set_sfall_arg(int arg, int value) | |
array get_sfall_args() | |
void set_sfall_arg(int arg, int value) | |
void set_sfall_return(int value) | |
int init_hook() | |
void set_unspent_ap_bonus(int multiplier) | |
int get_unspent_ap_bonus() | |
void set_unspent_ap_perk_bonus(int multiplier) | |
int get_unspent_ap_perk_bonus() | |
float sqrt(float) | |
float abs(float) | |
float sin(float) | |
float cos(float) | |
float tan(float) | |
float arctan(float x, float y) | |
float log(float) | |
float exponent(float) | |
int ceil(float) | |
int round(float) | |
void set_palette(char* path) | |
void remove_script(objptr) | |
void set_script(objptr, int scriptid) | |
int get_script(objptr) | |
int nb_create_char() | |
int fs_create(string path, int size) | |
int fs_copy(string path, string source) | |
int fs_find(string path) | |
void fs_write_byte(int id, int data) | |
void fs_write_short(int id, int data) | |
void fs_write_int(int id, int data) | |
void fs_write_float(int id, int data) | |
void fs_write_string(int id, string data) | |
void fs_write_bstring(int id, string data) | |
int fs_read_byte(int id) | |
int fs_read_short(int id) | |
int fs_read_int(int id) | |
float fs_read_float(int id) | |
void fs_delete(int id) | |
int fs_size(int id) | |
int fs_pos(int id) | |
void fs_seek(int id, int pos) | |
void fs_resize(int id, int size) | |
int get_proto_data(objptr, int offset) | |
void set_proto_data(objptr, int offset, int value) | |
void set_self(objptr) | |
void register_hook(int hook) | |
int list_begin(int type) | |
int list_next(int listid) | |
void list_end(int listid) | |
array list_as_array(int type) | |
int sfall_ver_major() | |
int sfall_ver_minor() | |
int sfall_ver_build() | |
void hero_select_win(int) | |
void set_hero_race(int style) | |
void set_hero_style(int style) | |
void set_critter_burst_disable(int critter, int disable) | |
int get_weapon_ammo_pid(objptr weapon) | |
void set_weapon_ammo_pid(objptr weapon, int pid) | |
int get_weapon_ammo_count(objptr weapon) | |
void set_weapon_ammo_count(objptr weapon, int count) | |
int get_screen_width() | |
int get_screen_height() | |
void stop_game() | |
void resume_game() | |
void create_message_window(char* message) | |
int get_light_level() | |
void refresh_pc_art | |
int get_attack_type | |
int play_sfall_sound(char* file, int mode) | |
void stop_sfall_sound(int soundID) | |
array string_split(char* string, char* split) | |
int atoi(char* string) | |
float atof(char* string) | |
char* substr(char* string, int start, int length) | |
int strlen(char* string) | |
char* sprintf(char* format, any value) | |
int charcode(char* string) | |
int typeof(any value) | |
int get_tile_fid(int tile) | |
int modified_ini | |
void force_aimed_shots(int pid) | |
void disable_aimed_shots(int pid) | |
void mark_movie_played(int id) | |
objptr get_last_target(objptr critter) | |
objptr get_last_attacker(objptr critter) | |
int tile_under_cursor | |
int gdialog_get_barter_mod | |
void set_inven_ap_cost | |
void reg_anim_combat_check(int enable) | |
void reg_anim_destroy(objptr object) | |
void reg_anim_animate_and_hide(objptr object, int animID, int delay) | |
void reg_anim_light(objptr object, int radius, int delay) | |
void reg_anim_change_fid(objptr object, int FID, int delay) | |
void reg_anim_take_out(objptr object, int holdFrameID, int delay) | |
void reg_anim_turn_towards(objptr object, int tile/targetObj, int delay) | |
int metarule2_explosions(objptr object) | |
void register_hook_proc(int hook, procedure proc) | |
char* message_str_game(int fileId, int messageId) | |
int sneak_success | |
int tile_light(int elevation, int tileNum) | |
// SFALL OPCODES with descriptions (will override entries from above) | |
int game_loaded() - returns 1 the first time it is called after a new game or game load, and 0 any time after. | |
int get_ini_setting(string setting) - reads an integer value from an ini file in the fallout directory. | |
string get_ini_string(string setting) - reads a string value from an ini file in the fallout directory. | |
int get_game_mode() - is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in. | |
int get_uptime() - is just a wrapper around the windows GetTickCount() function. It's useful for making time fade effects in shaders, since they already have access to the current tick count. | |
void set_self(int obj) - overrides the scripts self_obj for the next function call. | |
void mod_skill_points_per_level(int x) - accepts a value of between -100 and 100, and modifies the number of skill points the player recieves when they level up. | |
void seq_perk_freq(int x) - sets the number of levels between each perk. | |
ObjectPtr get_last_target(objptr) - will return the last critter to be deliberately attacked | |
ObjectPtr get_last_attacker(objptr) - will return the last critter to deliberately launch an attack against the argument critter. | |
void set_base_pickpocket_mod(int max, int mod) - changes maximum chance of success and chance mod for each steal attempt | |
void set_critter_pickpocket_mod(CritterPtr, int max, int mod) - the same as set_base_pickpocket, but applies only to specific critter | |
void reg_anim_combat_check - allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before "reg_anim_begin" - "reg_anim_end" block. | |
void reg_anim_destroy(object) - given object is destroyed at the end of current animation set | |
void reg_anim_animate_and_hide(object, animID, delay) - exactly like "reg_anim_animate" but the object will automatically disappear after the last animation frame (but not destroyed) | |
void reg_anim_light(object, light, delay) - change light of any object. light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF). | |
void reg_anim_change_fid(object, fid, delay) - should work like art_change_fid_num but in reg_anim sequence | |
void reg_anim_take_out(object, holdFrameID, delay) - plays "take out weapon" animation for given holdFrameID. It is not required to have such weapon in critter's inventory. | |
void reg_anim_turn_towards(object, tile/target, delay) - makes object change it's direction to face given tile num or target object. | |
int metarule2_explosions(int arg1, int arg2) - was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h: | |
void set_attack_explosion_pattern(x, y) - currently y is not used and x means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern | |
void set_attack_explosion_art(x, y) - y not used and x is a misc frame ID (last 3 bytes, without object type) to use for the next explosion. | |
void set_attack_explosion_radius(x) - changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine) | |
void set_attack_is_explosion_fire - if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still recieve fire damage. | |
array string_split(string, split) - takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters. | |
string substr(string, start, length) - cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te") | |
int strlen(char* string) - returns string length | |
string sprintf(char* format, any value) - formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value. | |
int typeof(any value) - returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR. | |
int charcode(char* string) - returns ASCII code for the first character in given string | |
float log(float x) - natural logarithm of x | |
float exponent(float x) - e^x | |
int round(float x) - round x to the nearest integer | |
float sqrt(float x) - square root of x | |
float abs(float x) - absolute (positive) value of x | |
float sin(float x) | |
float cos(float x) | |
float tan(float x) - tangent of x | |
float arctan(float x, float y) - arctangent of x | |
void register_hook_proc(int hook, procedure proc) - works just like "register_hook", but allows to specify which procedure to use for given hook script (instead of "start") | |
string message_str_game(int fileId, int messageId) - works exactly the same as message_str, except you get messages from files in "text/english/game" folder | |
int sneak_success - returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise | |
int tile_light(int elevation, int tileNum) - returns light intensity at the given tile in range from 0 to 65535 | |
ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType) - returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h) | |
ObjectPtr obj_blocking_tile(int tileNum, int elevation, int blockingType) - returns first object blocking given tile using given blocking function or 0 if tile is clear | |
array tile_get_objs(int tileNum, int elevation) - returns array of all objects at given tile | |
array party_member_list(int includeHidden) - returns array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.) | |
array path_find_to(ObjectPtr objFrom, int tileTo, int blockingType) - returns the shortest path to a given tile using given blocking function as an array of tile directions (0..5) to move on each step | |
ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius) - creates new spatial script with given SID, at given tile, and radius | |
int art_exists(int artFID) - checks if given artFID exists in the game - useful when you want to check if critter can use specific weapon: art_exists((artFid bwand 0xffff0fff) bwor (weaponAnim * 0x1000)) | |
int obj_is_carrying_obj(ObjectPtr invenObj, ObjectPtr itemObj) - returns number of itemObj inside invenObj's inventory, note that both arguments are object pointers | |
// hook scripts | |
int init_hook() - The hook script equivilent of game_loaded; it returns 2 when the script is first loaded, 1 when the player reloads and 0 otherwise. | |
mixed get_sfall_arg() - Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left. | |
int get_sfall_args() - Returns all hook arguments as a new temp array. | |
void set_sfall_return(int value) - 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). | |
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. | |
void register_hook_proc(int hooktype, procedure proc) - The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). | |
void register_hook_proc_spec(int hook, procedure proc) - Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). | |
// arrays | |
int create_array(int size, int nothing): - creates permanent array (but not "saved") | |
int temp_array(int size, int nothing): - works exactly like "create_array", only created array becomes "temporary" | |
void fix_array(int arrayID): - changes "temporary" array into "permanent" ("permanent" arrays are not automatically saved into savegames) | |
void set_array(int arrayID, mixed key, mixed value): - sets array value (shorthand: arrayID[key] := value) | |
mixed get_array(int arrayID, mixed key): - returns array value by key or index (shorthand: arrayID[key]) | |
void resize_array(int arrayID, int size): - changes array size | |
void free_array(int arrayID): - deletes any array | |
mixed scan_array(int arrayID, mixed value): - searches for a first occurence of given value inside given array | |
int len_array(int arrayID): - returns number of elements or key=>value pairs in a given array | |
mixed array_key(int arrayID, int index): - don't use it directly; it is generated by the compiler in foreach loops | |
int arrayexpr(mixed key, mixed value): - don't use it directly; it is used by compiler to create array expressions | |
void save_array(mixed key, int arrayID): - array is saved (arrayID is associated with given "key") | |
int load_array(mixed key): - load array from savegame data by the same key provided in "save_array" | |
any sfall_func0(char* funcName) - calls scripting function with given name and no arguments | |
any sfall_func1(char* funcName, arg1) - calls scripting function with given name and 1 argument | |
any sfall_func2(char* funcName, arg1, arg2) - calls scripting function with given name and 2 arguments | |
any sfall_func3(char* funcName, arg1, arg2, arg3) - calls scripting function with given name and 3 arguments | |
any sfall_func4(char* funcName, arg1, arg2, arg3, arg4) - calls scripting function with given name and 4 arguments | |
any sfall_func5(char* funcName, arg1, arg2, arg3, arg4, arg5) - calls scripting function with given name and 5 arguments | |
any sfall_func6(char* funcName, arg1, arg2, arg3, arg4, arg5, arg6) - calls scripting function with given name and 6 arguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment