diff --git a/server/out/completion.fallout-ssl.json b/server/out/completion.fallout-ssl.json index 92457d6..ae97caa 100644 --- a/server/out/completion.fallout-ssl.json +++ b/server/out/completion.fallout-ssl.json @@ -1857,31 +1857,13 @@ "value": "```fallout-ssl-tooltip\nObjectPtr source_obj\n```\nReturns 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." } }, - { - "label": "start_dialogue", - "kind": 3, - "source": "builtin", - "documentation": { - "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_dialogue(ObjectPtr who, int mood)\n```\nStart 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." - } - }, - { - "label": "start_gialog", - "kind": 3, - "source": "builtin", - "documentation": { - "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_gialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart 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." - } - }, { "label": "start_gdialog", "kind": 3, "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_gdialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart 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." + "value": "```fallout-ssl-tooltip\nvoid start_gdialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart the dialogue system focusing on a critter `who` and in a given `mood`.\nThis call sets up the appropriate dialog windows, head art, etc.\nIf 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.\n\n`mood` argument is unused in vanilla. Instead, the function checks LVAR 0 of the script:\n- `LVAR > 10` - good reaction (happy head).\n- `-10 > LVAR >= 10` - neutral.\n- Else, angry head.\n\nIf sfall is installed, and `StartGDialogFix` is enabled, argument `mood` does work:\n- If `mood == -1`, use vanilla behaviour (check LVAR 0).\n- Else, use argument value. Same thresholds apply." } }, { @@ -2160,7 +2142,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid reg_anim_combat_check(int enable)\n```\nAllows 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." + "value": "```fallout-ssl-tooltip\nvoid reg_anim_combat_check(int enable)\n```\nAllows enabling 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." } }, { @@ -2196,7 +2178,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid reg_anim_turn_towards(ObjectPtr, int tile/target, delay)\n```\nMakes object change its direction to face given tile num or target object." + "value": "```fallout-ssl-tooltip\nvoid reg_anim_turn_towards(ObjectPtr, int tile/target, delay)\n```\nMakes object change its direction to face given tile number or target object." } }, { @@ -2205,7 +2187,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed array_key(int arrayID, int index)\n```\nDon't use it directly; it is generated by the compiler in foreach loops." + "value": "```fallout-ssl-tooltip\nmixed array_key(int arrayID, int index)\n```\nDon't use it directly; it is generated by the compiler in foreach loops.\n - for lists, returns index back (no change).\n - for maps, returns a key at the specified numeric index (don't rely on the order in which keys are stored though).\n - can be checked if given array is associative or not, by using index (-1): 0 - array is list, 1 - array is map.\n" } }, { @@ -2214,7 +2196,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint arrayexpr(mixed key, mixed value)\n```\nDon't use it directly; it is used by compiler to create array expressions." + "value": "```fallout-ssl-tooltip\nint arrayexpr(mixed key, mixed value)\n```\nDon't use it directly; it is used by compiler to create array expressions.\n- assigns value to a given key in an array, created by last `create_array` or `temp_array` call.\n- always returns 0.\n" } }, { @@ -2223,7 +2205,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint create_array(int size, int nothing)\n```\nCreates permanent array (but not \"saved\")." + "value": "```fallout-ssl-tooltip\nint create_array(int size, int nothing)\n```\nCreates permanent array (but not \"saved\").\n- if `size >= 0`, creates list with given size.\n- if `size == -1`, creates map (associative array).\n- if `size == -1` and `flags == 2`, creates a \"lookup\" map (associative array) in which the values of existing keys are read-only and can't be updated. This type of array allows you to store a zero (0) key value.\n- returns array ID (valid until array is deleted).\n" } }, { @@ -2241,7 +2223,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid free_array(int arrayID)\n```\nDeletes any array." + "value": "```fallout-ssl-tooltip\nvoid free_array(int arrayID)\n```\nDeletes any array.\n- if array was \"saved\", it will be removed from a savegame.\n" } }, { @@ -2250,7 +2232,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed get_array(int arrayID, mixed key)\n```\nReturns array value by key or index (shorthand: arrayID[key])." + "value": "```fallout-ssl-tooltip\nmixed get_array(int arrayID, mixed key)\n```\nReturns array value by key or index (shorthand: `arrayID[key]`).\n- if key doesn't exist or index is not in valid range, returns 0.\n" } }, { @@ -2259,7 +2241,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint len_array(int arrayID)\n```\nReturns number of elements or key=>value pairs in a given array." + "value": "```fallout-ssl-tooltip\nint len_array(int arrayID)\n```\nReturns number of elements or key=>value pairs in a given array.\n- if array is not found, returns -1 (can be used to check if given array exist).\n" } }, { @@ -2268,7 +2250,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint load_array(mixed key)\n```\nLoad array from savegame data by the same key provided in \"save_array\"." + "value": "```fallout-ssl-tooltip\nint load_array(mixed key)\n```\nLoads array from savegame data by the same key provided in `save_array`.\n- returns array ID or zero (0) if none found.\n" } }, { @@ -2277,7 +2259,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid resize_array(int arrayID, int size)\n```\nChanges array size." + "value": "```fallout-ssl-tooltip\nvoid resize_array(int arrayID, int size)\n```\nChanges array size. - applicable to maps too, but only to reduce elements. - there are number of special negative values of \"size\" which perform various operations on the array, use macros `sort_array`, `sort_array_reverse`, `reverse_array`, `shuffle_array` from **sfall.h** header." } }, { @@ -2286,7 +2268,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid save_array(mixed key, int arrayID)\n```\nArray is saved (arrayID is associated with given \"key\")." + "value": "```fallout-ssl-tooltip\nvoid save_array(mixed key, int arrayID)\n```\nMakes the array saveable; it will be saved in **sfallgv.sav** file when saving the game.\n- array ID is associated with given \"key\".\n- array becomes permanent (if it was temporary) and \"saved\".\n- key can be of any type (int, float or string).\n- if you specify 0 as the key for the array ID, it will make the array \"unsaved\".\n" } }, { @@ -2295,7 +2277,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed scan_array(int arrayID, mixed value)\n```\nSearches for a first occurence of given value inside given array." + "value": "```fallout-ssl-tooltip\nmixed scan_array(int arrayID, mixed value)\n```\nSearches for a first occurence of given value inside given array.\n- if value is found, returns its index (for lists) or key (for maps).\n- if value is not found, returns -1 (be careful, as -1 can be a valid key for a map).\n" } }, { @@ -2304,7 +2286,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_array(int arrayID, mixed key, mixed value)\n```\nSets array value (shorthand: arrayID[key] := value)." + "value": "```fallout-ssl-tooltip\nvoid set_array(int arrayID, mixed key, mixed value)\n```\nSets array value (shorthand: `arrayID[key] := value`).\n- if used on list, \"key\" must be numeric and within valid index range (0..size-1)\n- if used on map, key can be of any type\n- to \"unset\" a value from map, just set it to zero (0)\n - NOTE: to add a value of 0 for the key, use the float value of 0.0\n" } }, { @@ -2313,7 +2295,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint temp_array(int size, int nothing)\n```\nWorks exactly like \"create_array\", only created array becomes \"temporary.\"" + "value": "```fallout-ssl-tooltip\nint temp_array(int size, int nothing)\n```\nWorks exactly like `create_array`, only created array becomes \"temporary\"." } }, { @@ -2448,7 +2430,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed combat_data\n```\n- returns a pointer to the `C_ATTACK_*` data for the current combat attack process (see defined constants in `define_extra.h`)\n- can be used in conjunction with the `get_object_data` and `set_object_data` functions\n example: `sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255);`\n" + "value": "```fallout-ssl-tooltip\nmixed combat_data\n```\n- returns a pointer to the `C_ATTACK_*` data for the current combat attack process (see defined constants in **define_extra.h**)\n- can be used in conjunction with the `get_object_data` and `set_object_data` functions\n example: `sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255);`\n" } }, { @@ -2487,13 +2469,22 @@ "value": "```fallout-ssl-tooltip\nint get_bodypart_hit_modifier(int bodypart)\n```\nGets the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8." } }, + { + "label": "get_combat_free_move", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_combat_free_move()\n```\nReturns available \"bonus move\" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move`" + } + }, { "label": "get_critical_table", "kind": 3, "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_critical_table(int crittertype, int bodypart, int level, int valuetype)\n```\nGets current critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Requires `OverrideCriticalTable` to be set to 1 in `ddraw.ini`. (Disabled by default, because it noticably increases loading times.)" + "value": "```fallout-ssl-tooltip\nint get_critical_table(int crittertype, int bodypart, int level, int valuetype)\n```\nGets current critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Requires `OverrideCriticalTable` to be enabled in `ddraw.ini` (already enabled by default)." } }, { @@ -2541,13 +2532,22 @@ "value": "```fallout-ssl-tooltip\nvoid set_bodypart_hit_modifier(int bodypart, int value)\n```\nAlters the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload." } }, + { + "label": "set_combat_free_move", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nvoid set_combat_free_move(int value)\n```\nAllows changing \"bonus move\" points (yellow lights on the interface bar) that can only be used for movement, not attacking\n- Can be called from `HOOK_COMBATTURN` at the start of the turn (will not work on `dude_obj`)\n- Can be called from `HOOK_STDPROCEDURE` with `combat_proc` event (will work on both NPCs and `dude_obj`)\n" + } + }, { "label": "set_critical_table", "kind": 3, "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)\n```\nUsed for modifying the critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Changes are not saved, and will reset to the defaults, (or to the contents of `CriticalOverrides.ini`, if it exists) at each game reload. Requires `OverrideCriticalTable` to be set to 1 in `ddraw.ini`. (Disabled by default, because it noticably increases loading times.)" + "value": "```fallout-ssl-tooltip\nvoid set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)\n```\nUsed for modifying the critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Changes are not saved, and will reset to the defaults (or to the contents of `CriticalOverrides.ini`, if it exists) at each game reload. Requires `OverrideCriticalTable` to be enabled in `ddraw.ini` (already enabled by default)." } }, { @@ -2568,6 +2568,15 @@ "value": "```fallout-ssl-tooltip\nvoid set_critter_current_ap(CritterPtr, int ap)\n```\nShould only be used during the target critters turn while in combat." } }, + { + "label": "set_spray_settings", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nvoid set_spray_settings(int centerMult, int centerDiv, int targetMult, int targetDiv)\n```\nAllows changing the multipliers and divisors for the bullet distribution of burst attacks dynamically. All settings are automatically reset to default values (**ComputeSpray_\\*** settings in ddraw.ini) after each attack action\n- Should be called before the calculation of the bullet distribution (e.g. in `HOOK_TOHIT` or `HOOK_AMMOCOST`)\n- `centerDiv/targetDiv`: the minimum value of divisor is 1\n- `centerMult/targetMult`: multiplier values are capped at divisor values\n- __NOTE:__ refer to the description of **ComputeSpray_\\*** settings in ddraw.ini for details of the bullet distribution of burst attacks\n" + } + }, { "label": "get_cursor_mode", "kind": 3, @@ -2601,7 +2610,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)\n```\n- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives\n- `maxDamage` is optional\n- `activePid` is for an item with an active timer, can be the same as the `pid` argument\n- the item proto must be \"Misc Item\" type and have \"Use\" action flag\n- minDamage/maxDamage are the minimum and maximum explosion damage\n- using the function on an item that is already set as an explosive will override its previous settings\n- NOTE: this function does not work for pids of Dynamite and Plastic Explosives\n" + "value": "```fallout-ssl-tooltip\nvoid item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)\n```\n- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives\n- `maxDamage` is optional\n- `activePid` is for an item with an active timer, can be the same as the `pid` argument\n- the item proto must be the **Misc Item** type and have the **Use** action flag\n- minDamage/maxDamage are the minimum and maximum explosion damage\n- using the function on an item that is already set as an explosive will override its previous settings\n- NOTE: this function does not work for pids of Dynamite and Plastic Explosives\n" } }, { @@ -2610,7 +2619,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint metarule2_explosions(int arg1, int arg2)\n```\nWas 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." + "value": "```fallout-ssl-tooltip\nint metarule2_explosions(int arg1, int arg2)\n```\nWas made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action." } }, { @@ -2862,7 +2871,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_shader_mode(int mode)\n```\nTells sfall when to use a shader. The parameter is a set of 32 flags which specify the screens on which the shader will be disabled, unless bit 32 is set, in which case the shader will only be active on those screens. Remember that screens are displayed on top of each other; if the player opens the character menu which in combat, the game still considers the player to be in combat. See `sfall.h` for a list of defines.\nThe graphics functions are only available if the user is using graphics mode 4 or 5. Use `graphics_funcs_available` to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when `graphics_funcs_available` returns 0 will do nothing." + "value": "```fallout-ssl-tooltip\nvoid set_shader_mode(int mode)\n```\nTells sfall when to use a shader. The parameter is a set of 32 flags which specify the screens on which the shader will be disabled, unless bit 32 is set, in which case the shader will only be active on those screens. Remember that screens are displayed on top of each other; if the player opens the character menu which in combat, the game still considers the player to be in combat. See **sfall.h** for a list of defines.\nThe graphics functions are only available if the user is using graphics mode 4 or 5. Use `graphics_funcs_available` to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when `graphics_funcs_available` returns 0 will do nothing." } }, { @@ -2925,7 +2934,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook(int hookID)\n```\nUsed from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, `start` proc will be executed in current global script. You can use all above functions like normal." + "value": "```fallout-ssl-tooltip\nvoid register_hook(int hookID)\n```\nUsed from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, `start` procedure will be executed in current global script. You can use all above functions like normal." } }, { @@ -2934,7 +2943,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook_proc(int hookID, proc procedure)\n```\nThe 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). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use \"hs_*.int\" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).\n\nUse zero (0) as second argument to unregister hook script from current global script.\n\n__NOTE:__ you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with `set_sfall_return`, the next script may override this value if calls `set_sfall_return` again. Sometimes you need to multiply certain value in a chain of hook scripts.\n\nExample: let's say we have a Mod A which reduces all \"to hit\" chances by 50%. The code might look like this:\n\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance / 2);\n```\n\nMod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script:\n```js\nset_sfall_arg(0, (original_chance / 2));\n```\n\nThis basically changes hook argument for the next script. Mod B code:\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance * 1.5);\nset_sfall_arg(0, (original_chance * 1.5));\n```\n\nSo if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use `set_sfall_arg` in both hooks).\n\nThe defines to use for the `hookID` are in `sfall.h`.\n" + "value": "```fallout-ssl-tooltip\nvoid register_hook_proc(int hookID, proc procedure)\n```\nThe 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). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script with no conflicts) and flexibility. You can place all related hook scripts for a specific mod in one global script!\n\nUse zero (0) as second argument to unregister hook script from current global script.\n\n__NOTE:__ you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. When one of the scripts in a chain returns value with `set_sfall_return`, the next script may override this value if calls `set_sfall_return` again.\n\n__Example:__ Sometimes you need to multiply certain value in a chain of hook scripts. Let's say we have a **Mod A** which reduces all \"to hit\" chances by 50%. The code might look like this:\n\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance / 2);\n```\n\n**Mod B** also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to **Mod A** hook script:\n```js\nset_sfall_arg(0, (original_chance / 2));\n```\n\nThis basically changes hook argument for the next script. **Mod B** code:\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance * 1.5);\nset_sfall_arg(0, (original_chance * 1.5));\n```\n\nSo if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use `set_sfall_arg` in both hooks).\n\nThe defines to use for the `hookID` are in **sfall.h**.\n" } }, { @@ -2943,7 +2952,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook_proc_spec(int hookID, procedure proc)\n```\nWorks 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). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using `register_hook/register_hook_proc` functions." + "value": "```fallout-ssl-tooltip\nvoid register_hook_proc_spec(int hookID, procedure proc)\n```\nWorks the same as `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). In addition, all scripts hooked to a single hook point with this function are executed in the exact order of how they were registered. In the case of using `register_hook` and `register_hook_proc` functions, scripts are executed in reverse order of how they were registered.\n**The execution chain of script procedures for a hook is as follows:** 1. Procedures registered with `register_hook` and `register_hook_proc` functions (executed in reverse order of registration). 2. The `hs_.int` script. 3. Procedures registered with the `register_hook_proc_spec` function (executed in the exact order of registration)." } }, { @@ -2952,7 +2961,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_sfall_arg(int argNum, int value)\n```\nChanges argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see `register_hook_proc`)." + "value": "```fallout-ssl-tooltip\nvoid set_sfall_arg(int argNum, int value)\n```\nChanges argument value. The argument number (`argNum`) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see `register_hook_proc`)." } }, { @@ -2961,7 +2970,25 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_sfall_return(int value)\n```\nUsed 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." + "value": "```fallout-ssl-tooltip\nvoid set_sfall_return(any value)\n```\nUsed 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." + } + }, + { + "label": "get_ini_config", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\narray get_ini_config(string file)\n```\nLoads a given INI file and returns a permanent array (map) where keys are section names and values are permanent sub-arrays (maps) where keys and values are strings.\n- Searches the file in the regular file system, like with all other ini-related functions.\n- Subsequent calls for the same file will return the same array, unless it was disposed using `free_array`.\n" + } + }, + { + "label": "get_ini_config_db", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\narray get_ini_config_db(string file)\n```\nWorks exactly like `get_ini_config`, except it searches the file in database (DAT) files. If not found, then it will try the regular file system." } }, { @@ -2970,7 +2997,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray get_ini_section(string file, string sect)\n```\nReturns an associative array of keys and values for a given INI file and section. NOTE: all keys and their values will be of String type." + "value": "```fallout-ssl-tooltip\narray get_ini_section(string file, string sect)\n```\nReturns an associative array of keys and values for a given INI file and section.\n- If the INI file is not found, it returns an empty array.\n- __NOTE:__ all keys and their values will be of String type.\n" } }, { @@ -2979,7 +3006,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray get_ini_sections(string file)\n```\nReturns an array of names of all sections in a given INI file." + "value": "```fallout-ssl-tooltip\narray get_ini_sections(string file)\n```\nReturns an array of names of all sections in a given INI file.\n- If the INI file is not found, it returns an empty array.\n" } }, { @@ -2988,7 +3015,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_ini_setting(string setting)\n```\n- Reads an integer value from an ini file in the fallout directory.\n- It only takes a single argument; seperate the file name, section and key with a \"\\|\" character; e.g. `myvar:=get_ini_setting(\"myini.ini|mysec|var1\")` If the file or key cannot be found, -1 is returned.\n- The file name is limited to 63 chars, including the extension.\n- The section name is limited to 32 characters.\n- It can also be used to get sfall's settings, by using `ddraw.ini` as the file name.\n" + "value": "```fallout-ssl-tooltip\nint get_ini_setting(string setting)\n```\nReads an integer value from an ini file in the Fallout directory.\n- It only takes a single argument; seperate the file name, section and key with a \"\\|\" character; e.g. `myvar:=get_ini_setting(\"myini.ini|mysec|var1\")`\n- If the file or key cannot be found or the setting argument is in an invalid format, it returns -1.\n- The file name is limited to 63 chars, including the extension.\n- The section name is limited to 32 characters.\n- It can also be used to get sfall settings by using **ddraw.ini** as the file name.\n" } }, { @@ -2997,7 +3024,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring get_ini_string(string setting)\n```\nReads a string value from an ini file in the fallout directory." + "value": "```fallout-ssl-tooltip\nstring get_ini_string(string setting)\n```\nReads a string value from an ini file in the Fallout directory.\n- If the file or key cannot be found, it returns an empty string.\n- If the setting argument is in an invalid format, it returns -1 (integer).\n" } }, { @@ -3141,7 +3168,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray list_as_array(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\narray list_as_array(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, { @@ -3150,7 +3177,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint list_begin(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nint list_begin(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, { @@ -3159,7 +3186,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid list_end(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nvoid list_end(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, { @@ -3168,7 +3195,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint list_next(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nint list_next(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, { @@ -3177,7 +3204,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray party_member_list(int includeHidden)\n```\nReturns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\narray party_member_list(int includeHidden)\n```\nReturns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, { @@ -3231,7 +3258,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid intface_redraw(bool winType)\n```\nRedraws main game interface. Useful after direct changes to current player weapons or stats to reflect changes.\n- redraws main game interface, useful to reflect changes after directly changing current player weapons or stats\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`). Pass `-1` to redraw all interface windows.\n" + "value": "```fallout-ssl-tooltip\nvoid intface_redraw(bool winType)\n```\nRedraws main game interface. Useful after direct changes to current player weapons or stats to reflect changes.\n- redraws main game interface, useful to reflect changes after directly changing current player weapons or stats\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**). Pass `-1` to redraw all interface windows.\n" } }, { @@ -3267,7 +3294,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid force_encounter_with_flags(int map, int flags)\n```\nDoes the same thing as force_encounter, but allows the specification of some extra options (see `sfall.h` for available flags).\nForcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it. In this case use `force_encounter_with_flags` with the `ENCOUNTER_FLAG_NO_CAR` flag set.\n" + "value": "```fallout-ssl-tooltip\nvoid force_encounter_with_flags(int map, int flags)\n```\nDoes the same thing as force_encounter, but allows the specification of some extra options (see **sfall.h** for available flags).\nForcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it. In this case use `force_encounter_with_flags` with the `ENCOUNTER_FLAG_NO_CAR` flag set.\n" } }, { @@ -3402,7 +3429,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint floor2(int/float value)\n```\nWorks just like vanilla floor function, but returns correct integers for negative values (vanilla floor function works exactly the same as `ceil` for negative values, much like `trunc` in C/C++)." + "value": "```fallout-ssl-tooltip\nint floor2(int/float value)\n```\nWorks just like vanilla floor function, but returns correct integers for negative floats.\n- __NOTE:__ vanilla `floor` function works exactly the same as `ceil` for negative floats (i.e. basically `trunc` in C/C++).\n" } }, { @@ -3510,7 +3537,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_flags(ObjectPtr obj)\n```\nGets the current value of object flags (see `define_extra.h` for available flags)." + "value": "```fallout-ssl-tooltip\nint get_flags(ObjectPtr obj)\n```\nGets the current value of object flags (see **define_extra.h** for available flags)." } }, { @@ -3519,7 +3546,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_object_data(ObjectPtr object, int offset)\n```\nReturns the data at the specified offset of an object (see `OBJ_DATA_*` constants in `define_extra.h` for offsets)." + "value": "```fallout-ssl-tooltip\nget_object_data(ObjectPtr object, int offset)\n```\nReturns the data at the specified offset of an object (see `OBJ_DATA_*` constants in **define_extra.h** for offsets)." } }, { @@ -3528,7 +3555,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_script(ObjectPtr)\n```\n- accepts a pointer to an object and returns its scriptID (line number in `scripts.lst`), or 0 if the object is unscripted.\n- returns -1 on argument error.\n" + "value": "```fallout-ssl-tooltip\nint get_script(ObjectPtr obj)\n```\n- accepts a pointer to an object and returns its scriptID (line number in `scripts.lst`), or 0 if the object is unscripted.\n- returns -1 on argument error.\n" } }, { @@ -3555,7 +3582,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nbool obj_is_openable(object obj)\n```\nReturns True if the object is openable (i.e. has an opening/closing animation)" + "value": "```fallout-ssl-tooltip\nbool obj_is_openable(object obj)\n```\nReturns True if the object is openable (i.e. has an opening/closing animation), False otherwise" } }, { @@ -3582,7 +3609,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid remove_script(ObjectPtr)\n```\nAccepts a pointer to an object and will remove the script from that object." + "value": "```fallout-ssl-tooltip\nvoid remove_script(ObjectPtr obj)\n```\nAccepts a pointer to an object and will remove the script from that object." } }, { @@ -3627,7 +3654,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_script(ObjectPtr, int scriptid)\n```\nAccepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as `create_object_sid `from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling `set_script` on `self_obj` will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling `set_script`, `map_enter_p_proc` will be SKIPPED. The `start` proc will always be run." + "value": "```fallout-ssl-tooltip\nvoid set_script(ObjectPtr obj, int scriptID)\n```\nAccepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as `create_object_sid `from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling `set_script` on `self_obj` will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling `set_script`, `map_enter_p_proc` will be SKIPPED. The `start` proc will always be run." } }, { @@ -3636,7 +3663,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_self(ObjectPtr)\n```\nOverrides the script's `self_obj` for the next function call.\n- It is primarily used to allow the calling of functions which take an implicit `self_obj` parameter (e.g. `drop_obj`) from global scripts, but it can also be used from normal scripts.\n- `self_obj` will be reverted to its original value after the next function call.\n- Calling `set_self(0)` will also revert `self_obj` to its original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.\n- `source_obj`, `target_obj`, and similar functions will not work if preceded by `set_self`.\n- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice. You can also access the local variables in the script of an object after calling `set_self` twice.\n" + "value": "```fallout-ssl-tooltip\nvoid set_self(ObjectPtr setObj)\n```\nOverrides the script's `self_obj` for the next function call.\n- It is primarily used to allow the calling of functions which take an implicit `self_obj` parameter (e.g. `drop_obj`) from global scripts, but it can also be used from normal scripts.\n- `self_obj` will be reverted to its original value after the next function call.\n- Calling `set_self(0)` will also revert `self_obj` to its original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.\n- `source_obj`, `target_obj`, and similar functions will not work if preceded by `set_self`.\n- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice. You can also access the local variables in the script of an object after calling `set_self` twice.\n" } }, { @@ -3861,7 +3888,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring message_str_game(int fileId, int messageId)\n```\nWorks exactly the same as message_str, except you get messages from files in `text/english/game` folder. Use `GAME_MSG_*` defines or `mstr_*` macros from `sfall.h` to use specific msg file\n- Additional game msg files added by `ExtraGameMsgFileList` setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set `ExtraGameMsgFileList=foo,bar` in `ddraw.ini`, `foo.msg` will be associated with 0x2000 and `bar.msg` with 0x2001.).\n- If a file has a specific number assigned in `ExtraGameMsgFileList`, its fileId will be (0x2000 + assigned number). (e.g. with `ExtraGameMsgFileList=foo,bar:2,foobar` in `ddraw.ini`, `bar.msg` will be associated with 0x2002 and `foobar.msg` with 0x2003.)\n" + "value": "```fallout-ssl-tooltip\nstring message_str_game(int fileId, int messageId)\n```\nWorks exactly the same as message_str, except you get messages from files in `text/english/game` folder. Use `GAME_MSG_*` defines or `mstr_*` macros from **sfall.h** to use specific msg file\n- Additional game msg files added by `ExtraGameMsgFileList` setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set `ExtraGameMsgFileList=foo,bar` in `ddraw.ini`, `foo.msg` will be associated with 0x2000 and `bar.msg` with 0x2001.).\n- If a file has a specific number assigned in `ExtraGameMsgFileList`, its fileId will be (0x2000 + assigned number). (e.g. with `ExtraGameMsgFileList=foo,bar:2,foobar` in `ddraw.ini`, `bar.msg` will be associated with 0x2002 and `foobar.msg` with 0x2003.)\n" } }, { @@ -3996,7 +4023,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_pipboy_available(int available)\n```\nWill only accept 0 or 1 as an argument. Using any other value will cause the function to have no effect. Use 0 to disable the pipboy, and 1 to enable it." + "value": "```fallout-ssl-tooltip\nvoid set_pipboy_available(int available)\n```\nSets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not mark the `VSUIT_MOVIE` movie as \"played\")." } }, { @@ -4086,7 +4113,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid sfall_func2(\"unwield_slot\", object critter, int slot)\n```\nunequips an item from the specified slot for a critter or the player\ncan take off player's equipped item when the inventory is opened, or the player is in the barter screen\nslot: 0 - armor slot, 1 - right slot, 2 - left slot (see `INVEN_TYPE_*` in `define.h`)\n" + "value": "```fallout-ssl-tooltip\nvoid sfall_func2(\"unwield_slot\", object critter, int slot)\n```\nunequips an item from the specified slot for a critter or the player\ncan take off player's equipped item when the inventory is opened, or the player is in the barter screen\nslot: 0 - armor slot, 1 - right slot, 2 - left slot (see `INVEN_TYPE_*` in **define.h**)\n" } }, { @@ -4113,7 +4140,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_outline(ObjectPtr obj, int color)\n```\n- sets the outline color of an object (see `OUTLINE_*` constants in `sfall.h`)\n- can also set a custom color from the game palette by shifting the color index value left by 8 bits: `0xCC00` where `CC` is the palette index (available since sfall 4.2.7/3.8.27)\n- passing 0 will disable the outline\n" + "value": "```fallout-ssl-tooltip\nvoid set_outline(ObjectPtr obj, int color)\n```\n- sets the outline color of an object (see `OUTLINE_*` constants in **sfall.h**)\n- can also set a custom color from the game palette by shifting the color index value left by 8 bits: `0xCC00` where `CC` is the palette index (available since sfall 4.2.7/3.8.27)\n- passing 0 will disable the outline\n" } }, { @@ -4545,7 +4572,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_object_ai_data(ObjectPtr object, int aiParam)\n```\nReturns the setting value from the AI packet of an object (critter). Use `AI_CAP_*` constants from `define_extra.h` for the `aiParam` argument to get AI value." + "value": "```fallout-ssl-tooltip\nint get_object_ai_data(ObjectPtr object, int aiParam)\n```\nReturns the setting value from the AI packet of an object (critter). Use `AI_CAP_*` constants from **define_extra.h** for the `aiParam` argument to get AI value." } }, { @@ -4590,7 +4617,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nobjects_in_radius\", int tile, int radius, int elevation, int type)\n```\n- returns an array of objects of a type (see `OBJ_TYPE_*` constants in `define_extra.h`) within the specified radius from the given tile\n- passing -1 to the `type` argument or _not specifying it_ will return all objects within the radius\n- the radius is limited to 50 hexes\n" + "value": "```fallout-ssl-tooltip\nobjects_in_radius\", int tile, int radius, int elevation, int type)\n```\n- returns an array of objects of a type (see `OBJ_TYPE_*` constants in **define_extra.h**) within the specified radius from the given tile\n- passing -1 to the `type` argument or _not specifying it_ will return all objects within the radius\n- the radius is limited to 50 hexes\n" } }, { @@ -4617,7 +4644,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_rest_mode(int flags)\n```\nSets the bit flags for the rest mode (see `RESTMODE_*` constants in `sfall.h`). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game." + "value": "```fallout-ssl-tooltip\nvoid set_rest_mode(int flags)\n```\nSets the bit flags for the rest mode (see `RESTMODE_*` constants in **sfall.h**). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game." } }, { @@ -4815,7 +4842,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_stat_max(int stat, bool who = False)\n```\n- Returns the maximum set value of the specified stat (see `set_stat_max` functions)\n- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." + "value": "```fallout-ssl-tooltip\nget_stat_max(int stat, bool who = False)\n```\n- Returns the maximum set value of the specified stat (see `set_stat_max` functions)\n- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." } }, { @@ -4824,7 +4851,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_stat_min(int stat, bool who = False)\n```\n- Returns the minimum set value of the specified stat (see `set_stat_min` functions)\n- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." + "value": "```fallout-ssl-tooltip\nget_stat_min(int stat, bool who = False)\n```\n- Returns the minimum set value of the specified stat (see `set_stat_min` functions)\n- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." } }, { @@ -4878,7 +4905,25 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_string_pointer(string text)\n```\nReturns a pointer to a string variable or to a text." + "value": "```fallout-ssl-tooltip\nint get_string_pointer(string text)\n```\n(DEPRECATED) Returns a pointer to a string variable or to a text\n- __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function\n" + } + }, + { + "label": "string_find", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint string_find(string haystack, string needle)\n```\nReturns the position of the first occurrence of a `needle` string in a `haystack` string, or -1 if not found. The first character position is 0 (zero)." + } + }, + { + "label": "string_find_from", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint string_find_from(string haystack, string needle, int pos)\n```\nWorks the same as `string_find`, except you can specify the position to start the search.\n- If `pos` is negative - it indicates a position starting from the end of the string, similar to `substr()`.\n" } }, { @@ -4887,7 +4932,25 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring string_format(string format, any val1, any val2, ...)\n```\nFormats given value using standard syntax of C printf function (google \"printf\" for format details). However it is limited to formatting up to 4 values.\n- formatting is only supported for %s and %d, and the format string is limited to 1024 characters\n" + "value": "```fallout-ssl-tooltip\nstring string_format(string format, any val1, any val2, ...)\n```\nFormats given values using standard syntax of C `printf` function (google \"printf\" for format details). However, it is limited to formatting up to 7 values.\n- The format string is limited to 1024 characters\n" + } + }, + { + "label": "string_format_array", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nstring string_format_array(string format, int array)\n```\nThe same as string_format, but accepts an array of parameters." + } + }, + { + "label": "string_replace", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nstring string_replace(string str, string search, string replace)\n```\nReplaces all occurances of a given search string in a string with a given replacement string." } }, { @@ -4896,7 +4959,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray string_split(string, split)\n```\nTakes 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. You can use this to search for a substring in a string like this: `strlen(get_array(string_split(haystack, needle), 0))`" + "value": "```fallout-ssl-tooltip\narray string_split(string text, split)\n```\nTakes 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. You can use this to search for a substring in a string like this: `strlen(get_array(string_split(haystack, needle), 0))`" } }, { @@ -4923,7 +4986,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring substr(string, start, length)\n```\nCuts a substring from a string starting at \"start\" up to \"length\" characters. The first character position is 0 (zero).\n- 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\").\n- 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\").\n- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22\n" + "value": "```fallout-ssl-tooltip\nstring substr(string text, int start, int length)\n```\nCuts a substring from a string starting at \"start\" up to \"length\" characters. The first character position is 0 (zero).\n- If start is negative - it indicates a position starting from the end of the string (for example `substr(\"test\", -2, 2)` will return last 2 charactes: \"st\").\n- 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\").\n- If length is zero - it will return a string from the starting position to the end of the string. **New behavior** for sfall 4.2.2/3.8.22\n" } }, { @@ -4977,7 +5040,25 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_tile_fid(int tile)\n```" + "value": "```fallout-ssl-tooltip\nint get_tile_fid(int tileData)\n```\n- Returns FID information about the square under the given tile at elevation 0\n- Pass elevation as 4-bit number in bits 25-28 to access other elevations\n- Pass result mode in bits 29-32: 0 - ground FID, 1 - roof FID, 2 - raw data.\n" + } + }, + { + "label": "get_tile_ground_fid", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_tile_ground_fid(int tileNum, int elevation)\n```\nReturns FID of a ground tile at given tile number and elevation." + } + }, + { + "label": "get_tile_roof_fid", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_tile_roof_fid(int tileNum, int elevation)\n```\nReturns FID of a roof tile at given tile number and elevation. Note that FID of 1 is used when there is no actual roof." } }, { @@ -4986,7 +5067,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)\n```\nReturns first object which blocks direct linear path from `objFrom` to `tileTo` using selected blocking function (see `BLOCKING_TYPE_*` constants in `sfall.h`). If path is clear (no blocker was encountered by selected function) - returns 0. `objFrom` is always excluded from calculations, but is required to be a valid object." + "value": "```fallout-ssl-tooltip\nObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)\n```\nReturns first object which blocks direct linear path from `objFrom` to `tileTo` using selected blocking function (see `BLOCKING_TYPE_*` constants in **sfall.h**). If path is clear (no blocker was encountered by selected function) - returns 0. `objFrom` is always excluded from calculations, but is required to be a valid object." } }, { @@ -5076,7 +5157,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring sprintf(string format, any value)\n```\nFormats given value using standart syntax of C printf function (google \"printf\" for format details). However it is limited to formatting only 1 value. Can be used to get character by ASCII code (\"%c\")." + "value": "```fallout-ssl-tooltip\nstring sprintf(string format, any value)\n```\nFormats given value using standart syntax of C `printf` function (google \"printf\" for format details). However, it is limited to formatting only 1 value.\n- Can be used to get character by ASCII code (\"%c\").\n" } }, { @@ -5346,7 +5427,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint sfall_func1(\"get_window_attribute\", int winType)\n```\nAlternative form: `int sfall_func2(\"get_window_attribute\", int winType, int attrType)`\nReturns the attribute of the specified interface window by the `attrType` argument.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n- `attrType`: `0` - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)\n `1` - X position, `2` - Y position (relative to the top-left corner of the game screen)\n `3` - interface width size, `4` - interface height size\n `-1` - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle\n (use standard syntax to access array values, e.g. `winRect.top`, `winRect.bottom`)\n- returns -1 if the specified attribute cannot be obtained\n" + "value": "```fallout-ssl-tooltip\nint sfall_func1(\"get_window_attribute\", int winType)\n```\nAlternative form: `int sfall_func2(\"get_window_attribute\", int winType, int attrType)`\nReturns the attribute of the specified interface window by the `attrType` argument.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n- `attrType`: `0` - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)\n `1` - X position, `2` - Y position (relative to the top-left corner of the game screen)\n `3` - interface width size, `4` - interface height size\n `-1` - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle\n (use standard syntax to access array values, e.g. `winRect.top`, `winRect.bottom`)\n- returns -1 if the specified attribute cannot be obtained\n" } }, { @@ -5364,7 +5445,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\n```\n```c++\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\nint sfall_func5(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame)\nint sfall_func6(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame, array param)\n```\n- draws the specified PCX or FRM image in the game interface window, returns -1 on any error\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n this also takes the value of the flag (0x1000000) to prevent immediate redrawing of the interface window\n- `artFile/artId`: path to the PCX/FRM file (e.g. `art\\\\inven\\\\5mmap.frm`), or its FRM ID number (e.g. `0x7000026`, see specification of the FID format)\n- `x/y`: offset relative to the top-left corner of the window\n\noptional arguments:\n- `frame`: frame number, the first frame starts from zero\n- `param`: an array which specifies additional parameters, where:\n index 0 - sprite direction for multi-directional FRM\n index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height\n" + "value": "```fallout-ssl-tooltip\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\n```\n```c++\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\nint sfall_func5(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame)\nint sfall_func6(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame, array param)\n```\n- draws the specified PCX or FRM image in the game interface window, returns -1 on any error\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n this also takes the value of the flag (0x1000000) to prevent immediate redrawing of the interface window\n- `artFile/artId`: path to the PCX/FRM file (e.g. `art\\\\inven\\\\5mmap.frm`), or its FRM ID number (e.g. `0x7000026`, see specification of the FID format)\n- `x/y`: offset relative to the top-left corner of the window\n\noptional arguments:\n- `frame`: frame number, the first frame starts from zero\n- `param`: an array which specifies additional parameters, where:\n index 0 - sprite direction for multi-directional FRM\n index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height\n" } }, { @@ -5391,7 +5472,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nsfall_func2(\"interface_overlay\", int winType, int mode)\n```\nAlternative form: `int sfall_func6(\"interface_overlay\", int winType, 2, int x, int y, int width, int height)`.\n\nCreates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of `interface_art_draw` and `interface_print` functions will draw on it.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n- `mode`: 1 - creates a new overlay surface\n 2 - clears the overlay area or the specified rectangle defined by the `x`, `y`, `width`, `height` arguments\n 0 - destroys the created overlay surface (frees up the memory allocated to the surface)\n" + "value": "```fallout-ssl-tooltip\nsfall_func2(\"interface_overlay\", int winType, int mode)\n```\nAlternative form: `int sfall_func6(\"interface_overlay\", int winType, 2, int x, int y, int width, int height)`.\n\nCreates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of `interface_art_draw` and `interface_print` functions will draw on it.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n- `mode`: 1 - creates a new overlay surface\n 2 - clears the overlay area or the specified rectangle defined by the `x`, `y`, `width`, `height` arguments\n 0 - destroys the created overlay surface (frees up the memory allocated to the surface)\n" } }, { @@ -5400,7 +5481,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_window_flag(string winName/int winID, int flag, bool value)\n```\nChanges the specified flag for the created script or game interface window.\n- winName: the window name, assigned to the window by the `CreateWin/create_win` function\n- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface\n- flag: the flag to change (see `WIN_FLAG_*` constants in `define_extra.h`)\n- value: `true` - set the flag, `false` - unset the flag\n" + "value": "```fallout-ssl-tooltip\nvoid set_window_flag(string winName/int winID, int flag, bool value)\n```\nChanges the specified flag for the created script or game interface window.\n- winName: the window name, assigned to the window by the `CreateWin/create_win` function\n- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface\n- flag: the flag to change (see `WIN_FLAG_*` constants in **define_extra.h**)\n- value: `True` - set the flag, `False` - unset the flag\n" } }, { @@ -5724,7 +5805,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_AMMOCOST\n```\nRuns when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
\nBy default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.
\nTo add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.\n\n```\nItem arg0 - The weapon\nint arg1 - Number of bullets in burst or 1 for single shots\nint arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)\n NOTE: for hook type 2, this value is the ammo cost per round (default is always 1)\nint arg3 - Type of hook:\n 0 - when subtracting ammo after single shot attack\n 1 - when checking for \"out of ammo\" before attack\n 2 - when calculating number of burst rounds\n 3 - when subtracting ammo after burst attack\n\nint ret0 - The new amount of ammo to be consumed, or ammo cost per round for hook type 2 (set to 0 for unlimited ammo)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_AMMOCOST\n```\nRuns when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
\nBy default, a weapon can perform an attack with at least one ammo, regardless of ammo cost calculation.
\nTo add proper checks for ammo before attacking (hook type 1 `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.\n\n__NOTE:__ The return value must be greater than or equal to 0 to be valid.\n\n```\nItem arg0 - The weapon\nint arg1 - Number of bullets in burst or 1 for single shots\nint arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)\n NOTE: for hook type 2, this value is the ammo cost per round (default is always 1)\nint arg3 - Type of hook:\n 0 - when subtracting ammo after single shot attack\n 1 - when checking for \"out of ammo\" before attack\n 2 - when calculating number of burst rounds\n 3 - when subtracting ammo after burst attack\n\nint ret0 - The new amount of ammo to be consumed, or ammo cost per round for hook type 2 (set to 0 for unlimited ammo)\n```\n" } }, { @@ -5733,7 +5814,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_BARTERPRICE\n```\nRuns whenever the value of goods being purchased is calculated.\n\nNOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC.\n\n```\nCritter arg0 - the critter doing the bartering (either dude_obj or inven_dude)\nCritter arg1 - the critter being bartered with\nint arg2 - the default value of the goods\nCritter arg3 - table of requested goods (being bought from NPC)\nint arg4 - the amount of actual caps in the barter stack (as opposed to goods)\nint arg5 - the value of all goods being traded before skill modifications\nCritter arg6 - table of offered goods (being sold to NPC)\nint arg7 - the total cost of the goods offered by the player\nint arg8 - 1 if the \"offers\" button was pressed (not for a party member), 0 otherwise\nint arg9 - 1 if trading with a party member, 0 otherwise\n\nint ret0 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)\nint ret1 - the modified value of all offered goods\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_BARTERPRICE\n```\nRuns whenever the value of goods being purchased is calculated.\n\nNOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC.\n\n```\nCritter arg0 - the critter doing the bartering (either dude_obj or inven_dude)\nCritter arg1 - the critter being bartered with\nint arg2 - the default value of the goods\nCritter arg3 - table of requested goods (being bought from NPC)\nint arg4 - the number of actual caps in the barter stack (as opposed to goods)\nint arg5 - the value of all goods being traded before skill modifications\nCritter arg6 - table of offered goods (being sold to NPC)\nint arg7 - the total cost of the goods offered by the player\nint arg8 - 1 if the \"offers\" button was pressed (not for a party member), 0 otherwise\nint arg9 - 1 if trading with a party member, 0 otherwise\n\nint ret0 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)\nint ret1 - the modified value of all offered goods\n```\n" } }, { @@ -5751,7 +5832,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_CALCAPCOST\n```\nRuns whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
\nNote that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
\nYou can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.\n\n```\nCritter arg0 - The critter performing the action\nint arg1 - Attack Type (see ATKTYPE_* constants)\nint arg2 - Is aimed attack (1 or 0)\nint arg3 - The default AP cost\nItem arg4 - The weapon for which the cost is calculated. If it is 0, the pointer to the weapon can still be obtained by the aforementioned method\n\nint ret0 - The new AP cost\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_CALCAPCOST\n```\nRuns whenever Fallout calculates the AP cost of using an active item in hand (or unarmed attack). Doesn't run for moving.
\nNote that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
\nYou can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.\n\n```\nCritter arg0 - The critter performing the action\nint arg1 - Attack Type (see ATKTYPE_* constants)\nint arg2 - Is aimed attack (1 or 0)\nint arg3 - The default AP cost\nItem arg4 - The weapon for which the cost is calculated. If it is 0, the pointer to the weapon can still be obtained by the aforementioned method\n\nint ret0 - The new AP cost\n```\n" } }, { @@ -5760,7 +5841,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_CANUSEWEAPON\n```\nRun when the AI checks whether it can use a weapon.\nThis mostly happens when NPCs try to find weapons in their inventory or on the map.\n\n```\nCritter arg0 - the critter doing the check\nItem arg1 - the weapon being checked\nint arg2 - attack type (see ATKTYPE_* constants)\nint arg3 - original result of engine function: 1 - can use, 0 - can't use\n\nint ret0 - overrides the result of engine function. Any non-zero value allows using the weapon\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_CANUSEWEAPON\n```\nRun when the AI checks whether it can use a weapon.\nThis mostly happens when NPCs try to find weapons in their inventory or on the map.\n\n```\nCritter arg0 - the critter doing the check\nItem arg1 - the weapon being checked\nint arg2 - attack type (see ATKTYPE_* constants)\nint arg3 - original result of engine function: 1 - can use, 0 - cannot use\n\nint ret0 - overrides the result of engine function. Any non-zero value allows using the weapon\n```\n" } }, { @@ -5778,7 +5859,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_COMBATDAMAGE\n```\nRuns when:\n1. Game calculates how much damage each target will get. This includes primary target as well as all extras (explosions and bursts). This happens BEFORE the actual attack animation.\n2. AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.\n\nDoes not run for misses, or non-combat damage like dynamite explosions.\n\n```\nCritter arg0 - The target\nCritter arg1 - The attacker\nint arg2 - The amount of damage to the target\nint arg3 - The amount of damage to the attacker\nint arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags)\nint arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)\nint arg6 - The weapon used in the attack\nint arg7 - The bodypart that was struck\nint arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)\nint arg9 - Number of bullets actually hit the target (1 for melee attacks)\nint arg10 - The amount of knockback to the target\nint arg11 - Attack Type (see ATKTYPE_* constants)\nmixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)\n\nint ret0 - The damage to the target\nint ret1 - The damage to the attacker\nint ret2 - The special effect flags for the target\nint ret3 - The special effect flags for the attacker\nint ret4 - The amount of knockback to the target\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_COMBATDAMAGE\n```\nRuns when:\n1. Game calculates how much damage each target will get. This includes primary target as well as all extras (explosions and bursts). This happens BEFORE the actual attack animation.\n2. AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.\n\nDoes not run for misses, or non-combat damage like dynamite explosions.\n\n```\nCritter arg0 - The target\nCritter arg1 - The attacker\nint arg2 - The amount of damage to the target\nint arg3 - The amount of damage to the attacker\nint arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags)\nint arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)\nItem arg6 - The weapon used in the attack\nint arg7 - The bodypart that was struck\nint arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)\nint arg9 - Number of bullets actually hit the target (1 for melee attacks)\nint arg10 - The amount of knockback to the target\nint arg11 - Attack Type (see ATKTYPE_* constants)\nmixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)\n\nint ret0 - The damage to the target\nint ret1 - The damage to the attacker\nint ret2 - The special effect flags for the target\nint ret3 - The special effect flags for the attacker\nint ret4 - The amount of knockback to the target\n```\n" } }, { @@ -5787,7 +5868,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_COMBATTURN\n```\nRuns before and after each turn in combat (for both PC and NPC).\n\n```\nint arg0 - event type:\n 1 - start of turn\n 0 - normal end of turn\n -1 - combat ends abruptly (by script or by pressing Enter during PC turn)\n -2 - combat ends normally (hook always runs at the end of combat)\nCritter arg1 - critter doing the turn\nbool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise\n\nint ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_COMBATTURN\n```\nRuns before and after each turn in combat (for both PC and NPC).\n\n```\nint arg0 - event type:\n 1 - start of turn\n 0 - normal end of turn\n -1 - combat ends abruptly (by script or by pressing Enter during PC turn)\n -2 - combat ends normally (hook always runs at the end of combat)\nCritter arg1 - critter doing the turn\nint arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise\n\nint ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat\n```\n" } }, { @@ -5823,7 +5904,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_DESCRIPTIONOBJ\n```\nRuns when using the examine action icon to display the description of an object. You can override the description text.\nAn example usage would be to add an additional description to the item based on player's stats/skills.\n\nDoes not run if the script of the object overrides the description.\n\n```\nObj arg0 - the object\n\nint ret0 - a pointer to the new text received by using \"get_string_pointer\" function\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_DESCRIPTIONOBJ\n```\nRuns when using the examine action icon to display the description of an object. You can override the description text.\nAn example usage would be to add an additional description to the item based on player's stats/skills.\n\nDoes not run if the script of the object overrides the description.\n\n__NOTE:__ Returning a pointer to the new text received from the `get_string_pointer` function is still valid, but the method is DEPRECATED and is left for backward compatibility only.\n\n```\nObj arg0 - the object\n\nString ret0 - the new description text to use\n```\n" } }, { @@ -5877,7 +5958,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_INVENTORYMOVE\n```\nRuns before moving items between inventory slots in dude interface. You can override the action.\nWhat you can NOT do with this hook:\n- force moving items to inappropriate slots (like gun in armor slot)\nWhat you can do:\n- restrict player from using specific weapons or armors\n- add AP costs for all inventory movement including reloading\n- apply or remove some special scripted effects depending on PC's armor\n\n```\nint arg0 - Target slot:\n 0 - main backpack\n 1 - left hand\n 2 - right hand\n 3 - armor slot\n 4 - weapon, when reloading it by dropping ammo\n 5 - container, like bag/backpack\n 6 - dropping on the ground\n 7 - picking up item\n 8 - dropping item on the character portrait\nItem arg1 - Item being moved\nItem arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)\n\nint ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_INVENTORYMOVE\n```\nRuns before moving items between inventory slots in dude interface. You can override the action.\n\nWhat you can NOT do with this hook:\n- force moving items to inappropriate slots (like gun in armor slot)\nWhat you can do:\n- restrict player from using specific weapons or armors\n- add AP costs for all inventory movement including reloading\n- apply or remove some special scripted effects depending on PC's armor\n\n```\nint arg0 - Target slot:\n 0 - main backpack\n 1 - left hand\n 2 - right hand\n 3 - armor slot\n 4 - weapon, when reloading it by dropping ammo\n 5 - container, like bag/backpack\n 6 - dropping on the ground\n 7 - picking up item\n 8 - dropping item on the character portrait\nItem arg1 - Item being moved\nItem arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)\n\nint ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)\n```\n\nNotes for the event of dropping items on the ground:\n- the event is called for each item when dropping multiple items from the stack\n- for ammo type items, the number of dropped ammo in a pack can be found by using the `get_weapon_ammo_count` function\n- for the `PID_BOTTLE_CAPS` item, the event is called only once, and the number of dropped units can be found from the value of the `OBJ_DATA_CUR_CHARGES` object field (or with the `get_weapon_ammo_count` function)\n" } }, { @@ -5994,7 +6075,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDURE\n```\nRuns before Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\n\nint ret0 - pass -1 to cancel the execution of the handler\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDURE\n```\nRuns before Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see *_proc in define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - always 0 (1 for _END version)\nObj arg4 - the object that is acted upon by this handler (target_obj, can be 0)\nint arg5 - the parameter of this call (fixed_param), useful for combat_proc\n\nint ret0 - pass -1 to cancel the execution of the handler\n```\n" } }, { @@ -6003,7 +6084,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDUREEND\n```\nRuns after Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - 1 after procedure execution\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDUREEND\n```\nRuns after Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see *_proc in define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - always 1 (procedure end)\nObj arg4 - the object that is acted upon by this handler (target_obj, can be 0)\nint arg5 - the parameter of this call (fixed_param), useful for combat_proc\n```\n" } }, { @@ -6012,7 +6093,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STEAL\n```\nRuns when checking an attempt to steal or plant an item in other inventory using Steal skill.\n\nThis is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player (\"You steal the %s\", \"You are caught planting the %s\", etc.).\nExample message (vanilla behavior):
\n`display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3 * 2), obj_name(arg2)));`\n\n```\nCritter arg0 - Thief\nObj arg1 - The target\nItem arg2 - Item being stolen/planted\nint arg3 - 0 when stealing, 1 when planting\n\nint ret0 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STEAL\n```\nRuns when checking an attempt to steal or plant an item in other inventory using Steal skill.\n\nThis is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player (\"You steal the %s\", \"You are caught planting the %s\", etc.).\nExample message (vanilla behavior):
\n`display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3 * 2), obj_name(arg2)));`\n\n```\nCritter arg0 - Thief\nObj arg1 - The target\nItem arg2 - The item being stolen/planted\nint arg3 - 0 when stealing, 1 when planting\nint arg4 - quantity of the item being stolen/planted\n\nint ret0 - overrides hard-coded handler (2 - force fail without closing window, 1 - force success, 0 - force fail, -1 - use engine handler)\nint ret1 - overrides experience points gained for stealing this item (must be greater than or equal to 0)\n```\n" } }, { @@ -6039,7 +6120,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_TOHIT\n```\nRuns when Fallout is calculating the chances of an attack striking a target.
\nRuns after the hit chance is fully calculated normally, including applying the 95% cap.\n\n```\nint arg0 - The hit chance (capped)\nCritter arg1 - The attacker\nCritter arg2 - The target of the attack\nint arg3 - The targeted bodypart\nint arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)\nint arg5 - Attack Type (see ATKTYPE_* constants)\nint arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack\nint arg7 - The raw hit chance before applying the cap\n\nint ret0 - the new hit chance\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_TOHIT\n```\nRuns when Fallout is calculating the chances of an attack striking a target.
\nRuns after the hit chance is fully calculated normally, including applying the 95% cap.\n\n```\nint arg0 - The hit chance (capped)\nCritter arg1 - The attacker\nCritter arg2 - The target of the attack\nint arg3 - The targeted bodypart\nint arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)\nint arg5 - Attack Type (see ATKTYPE_* constants)\nint arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack\nint arg7 - The raw hit chance before applying the cap\n\nint ret0 - The new hit chance. The value is limited to the range of -99 to 999\n```\n" } }, { @@ -6084,7 +6165,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_USESKILLON\n```\nRuns before using any skill on any object. Lets you override the critter that uses the skill.\n\n__NOTE:__ The user critter can't be overridden when using Steal skill.\n\n```\nCritter arg0 - the user critter (usually dude_obj)\nObj arg1 - the target object/critter\nint arg2 - skill being used\n\nint ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value\nint ret1 - pass 1 to allow the skill being used in combat (only for dude_obj or critter being controlled by the player)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_USESKILLON\n```\nRuns before using any skill on any object. Lets you override the critter that uses the skill.\n\n__NOTE:__ The user critter can't be overridden when using Steal skill.\n\n```\nCritter arg0 - the user critter (usually dude_obj)\nObj arg1 - the target object/critter\nint arg2 - skill being used\n\nint ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value\nint ret1 - pass 1 to allow the skill to be used in combat (only for dude_obj or critter being controlled by the player)\n```\n" } }, { diff --git a/server/out/completion.weidu-baf.json b/server/out/completion.weidu-baf.json index 264c5d4..47b810c 100644 --- a/server/out/completion.weidu-baf.json +++ b/server/out/completion.weidu-baf.json @@ -1080,7 +1080,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nEnemy()\n```\nThis action is used to change the allegiance of the active creature to enemy (making them hostile to the PC). This example script, from a peasant, will turn the creature hostile if it is attacked.\n\n```\nIF\n AttackedBy([GOODCUTOFF],Myself)\n Allegiance(Myself,NEUTRAL)\nTHEN\n RESPONSE #100\n Enemy()\nEND\n```" + "value": "```weidu-baf-tooltip\nEnemy()\n```\nThis action is used to change the allegiance of the active creature to enemy (making them hostile to the PC). This example script, from a peasant, will turn the creature hostile if it is attacked.\n\n```\nIF\n AttackedBy([GOODCUTOFF],DEFAULT)\n Allegiance(Myself,NEUTRAL)\nTHEN\n RESPONSE #100\n Enemy()\nEND\n```" } }, { @@ -3438,7 +3438,16 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItem(S:Object, O:Target)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItem(S:Object, O:Target)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" + } + }, + { + "label": "UseItemAbility", + "kind": 3, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```weidu-baf-tooltip\nUseItemAbility(S:Object, O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, { @@ -3447,7 +3456,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItemSlot(O:Target, I:Slot)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItemSlot(O:Target, I:Slot)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, { @@ -3456,7 +3465,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItemSlotAbility(O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItemSlotAbility(O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, { diff --git a/server/out/completion.weidu-tp2.json b/server/out/completion.weidu-tp2.json index 5b1e515..0622895 100644 --- a/server/out/completion.weidu-tp2.json +++ b/server/out/completion.weidu-tp2.json @@ -914,7 +914,7 @@ "source": "builtin", "documentation": { "kind": "markdown", - "value": "```weidu-tp2-tooltip\nADD_PROJECTILE modpath/PROName.PRO\n```\nAppends an entry for PROName to PROJECTL.IDS and assigns it the next available ProRef number. Then copies the file modpath/PROName.PRO to the override folder. The new ProRef number can be accessed through the variable %PROName% and used to updated the Projectile type field of an ITM or SPL file's Item Ability or Spell Ability sub-structures." + "value": "```weidu-tp2-tooltip\nADD_PROJECTILE modpath/PROName.PRO [idsName]\n```\nAppends an entry for PROName to PROJECTL.IDS and assigns it the next available ProRef number. Then copies the file modpath/PROName.PRO to the override folder. The new ProRef number can be accessed through the variable %PROName% and used to updated the Projectile type field of an ITM or SPL file's Item Ability or Spell Ability sub-structures.\nIf `idsName` is specified, then it will give the projectile the name `idsName` in `MISSILE.IDS`." } }, { @@ -3746,6 +3746,15 @@ "value": "```weidu-tp2-tooltip\n%WEIDU_ARCH%\n```\nThe special variable WEIDU_ARCH is set to either \"x86\", \"amd64\" or \"mac\" at WeiDU startup and can be used to determine the architecture of the WeiDU binary." } }, + { + "label": "%WEIDU_EXECUTABLE%", + "kind": 14, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```weidu-tp2-tooltip\n%WEIDU_EXECUTABLE%\n```\nThe special variable WEIDU_EXECUTABLE contains the full path of the current WeiDU binary." + } + }, { "label": "%WEIDU_OS%", "kind": 14, @@ -7094,6 +7103,15 @@ "value": "```weidu-tp2-tooltip\ndword offset ITM_weight = 0x4c\n```\nWeight" } }, + { + "label": "SPL_description", + "kind": 21, + "source": "builtin", + "documentation": { + "kind": "markdown", + "value": "```weidu-tp2-tooltip\ndword offset SPL_description = 0x50\n```\nSpell Description" + } + }, { "label": "SPL_exclusion_flags", "kind": 21, @@ -7139,15 +7157,6 @@ "value": "```weidu-tp2-tooltip\ndword offset SPL_level = 0x34\n```\nSpell Level\n\n- There is no good reason for a Special/Psionic/Innate/Bard song to be any Spell level except `1`.\n- If the SPL is never learned/gained (only force-cast by script/opcode), Spell level doesn't matter, but there may be some niche cases that check it (f.i. HaveSpell())." } }, - { - "label": "SPL_unidentified_description", - "kind": 21, - "source": "builtin", - "documentation": { - "kind": "markdown", - "value": "```weidu-tp2-tooltip\ndword offset SPL_unidentified_description = 0x50\n```\nSpell Description - Unidentified (strref)" - } - }, { "label": "SPL_unidentified_name", "kind": 21, diff --git a/server/out/hover.fallout-ssl.json b/server/out/hover.fallout-ssl.json index b6bb017..fc81235 100644 --- a/server/out/hover.fallout-ssl.json +++ b/server/out/hover.fallout-ssl.json @@ -1187,22 +1187,10 @@ "value": "```fallout-ssl-tooltip\nObjectPtr source_obj\n```\nReturns 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." } }, - "start_dialogue": { - "contents": { - "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_dialogue(ObjectPtr who, int mood)\n```\nStart 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." - } - }, - "start_gialog": { - "contents": { - "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_gialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart 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." - } - }, "start_gdialog": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid start_gdialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart 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." + "value": "```fallout-ssl-tooltip\nvoid start_gdialog(int msgFileNum, ObjectPtr who, int mood, int headNum, int backgroundIdx)\n```\nStart the dialogue system focusing on a critter `who` and in a given `mood`.\nThis call sets up the appropriate dialog windows, head art, etc.\nIf 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.\n\n`mood` argument is unused in vanilla. Instead, the function checks LVAR 0 of the script:\n- `LVAR > 10` - good reaction (happy head).\n- `-10 > LVAR >= 10` - neutral.\n- Else, angry head.\n\nIf sfall is installed, and `StartGDialogFix` is enabled, argument `mood` does work:\n- If `mood == -1`, use vanilla behaviour (check LVAR 0).\n- Else, use argument value. Same thresholds apply." } }, "target_obj": { @@ -1388,7 +1376,7 @@ "reg_anim_combat_check": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid reg_anim_combat_check(int enable)\n```\nAllows 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." + "value": "```fallout-ssl-tooltip\nvoid reg_anim_combat_check(int enable)\n```\nAllows enabling 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." } }, "reg_anim_destroy": { @@ -1412,25 +1400,25 @@ "reg_anim_turn_towards": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid reg_anim_turn_towards(ObjectPtr, int tile/target, delay)\n```\nMakes object change its direction to face given tile num or target object." + "value": "```fallout-ssl-tooltip\nvoid reg_anim_turn_towards(ObjectPtr, int tile/target, delay)\n```\nMakes object change its direction to face given tile number or target object." } }, "array_key": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed array_key(int arrayID, int index)\n```\nDon't use it directly; it is generated by the compiler in foreach loops." + "value": "```fallout-ssl-tooltip\nmixed array_key(int arrayID, int index)\n```\nDon't use it directly; it is generated by the compiler in foreach loops.\n - for lists, returns index back (no change).\n - for maps, returns a key at the specified numeric index (don't rely on the order in which keys are stored though).\n - can be checked if given array is associative or not, by using index (-1): 0 - array is list, 1 - array is map.\n" } }, "arrayexpr": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint arrayexpr(mixed key, mixed value)\n```\nDon't use it directly; it is used by compiler to create array expressions." + "value": "```fallout-ssl-tooltip\nint arrayexpr(mixed key, mixed value)\n```\nDon't use it directly; it is used by compiler to create array expressions.\n- assigns value to a given key in an array, created by last `create_array` or `temp_array` call.\n- always returns 0.\n" } }, "create_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint create_array(int size, int nothing)\n```\nCreates permanent array (but not \"saved\")." + "value": "```fallout-ssl-tooltip\nint create_array(int size, int nothing)\n```\nCreates permanent array (but not \"saved\").\n- if `size >= 0`, creates list with given size.\n- if `size == -1`, creates map (associative array).\n- if `size == -1` and `flags == 2`, creates a \"lookup\" map (associative array) in which the values of existing keys are read-only and can't be updated. This type of array allows you to store a zero (0) key value.\n- returns array ID (valid until array is deleted).\n" } }, "fix_array": { @@ -1442,55 +1430,55 @@ "free_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid free_array(int arrayID)\n```\nDeletes any array." + "value": "```fallout-ssl-tooltip\nvoid free_array(int arrayID)\n```\nDeletes any array.\n- if array was \"saved\", it will be removed from a savegame.\n" } }, "get_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed get_array(int arrayID, mixed key)\n```\nReturns array value by key or index (shorthand: arrayID[key])." + "value": "```fallout-ssl-tooltip\nmixed get_array(int arrayID, mixed key)\n```\nReturns array value by key or index (shorthand: `arrayID[key]`).\n- if key doesn't exist or index is not in valid range, returns 0.\n" } }, "len_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint len_array(int arrayID)\n```\nReturns number of elements or key=>value pairs in a given array." + "value": "```fallout-ssl-tooltip\nint len_array(int arrayID)\n```\nReturns number of elements or key=>value pairs in a given array.\n- if array is not found, returns -1 (can be used to check if given array exist).\n" } }, "load_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint load_array(mixed key)\n```\nLoad array from savegame data by the same key provided in \"save_array\"." + "value": "```fallout-ssl-tooltip\nint load_array(mixed key)\n```\nLoads array from savegame data by the same key provided in `save_array`.\n- returns array ID or zero (0) if none found.\n" } }, "resize_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid resize_array(int arrayID, int size)\n```\nChanges array size." + "value": "```fallout-ssl-tooltip\nvoid resize_array(int arrayID, int size)\n```\nChanges array size. - applicable to maps too, but only to reduce elements. - there are number of special negative values of \"size\" which perform various operations on the array, use macros `sort_array`, `sort_array_reverse`, `reverse_array`, `shuffle_array` from **sfall.h** header." } }, "save_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid save_array(mixed key, int arrayID)\n```\nArray is saved (arrayID is associated with given \"key\")." + "value": "```fallout-ssl-tooltip\nvoid save_array(mixed key, int arrayID)\n```\nMakes the array saveable; it will be saved in **sfallgv.sav** file when saving the game.\n- array ID is associated with given \"key\".\n- array becomes permanent (if it was temporary) and \"saved\".\n- key can be of any type (int, float or string).\n- if you specify 0 as the key for the array ID, it will make the array \"unsaved\".\n" } }, "scan_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed scan_array(int arrayID, mixed value)\n```\nSearches for a first occurence of given value inside given array." + "value": "```fallout-ssl-tooltip\nmixed scan_array(int arrayID, mixed value)\n```\nSearches for a first occurence of given value inside given array.\n- if value is found, returns its index (for lists) or key (for maps).\n- if value is not found, returns -1 (be careful, as -1 can be a valid key for a map).\n" } }, "set_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_array(int arrayID, mixed key, mixed value)\n```\nSets array value (shorthand: arrayID[key] := value)." + "value": "```fallout-ssl-tooltip\nvoid set_array(int arrayID, mixed key, mixed value)\n```\nSets array value (shorthand: `arrayID[key] := value`).\n- if used on list, \"key\" must be numeric and within valid index range (0..size-1)\n- if used on map, key can be of any type\n- to \"unset\" a value from map, just set it to zero (0)\n - NOTE: to add a value of 0 for the key, use the float value of 0.0\n" } }, "temp_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint temp_array(int size, int nothing)\n```\nWorks exactly like \"create_array\", only created array becomes \"temporary.\"" + "value": "```fallout-ssl-tooltip\nint temp_array(int size, int nothing)\n```\nWorks exactly like `create_array`, only created array becomes \"temporary\"." } }, "art_cache_clear": { @@ -1580,7 +1568,7 @@ "combat_data": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nmixed combat_data\n```\n- returns a pointer to the `C_ATTACK_*` data for the current combat attack process (see defined constants in `define_extra.h`)\n- can be used in conjunction with the `get_object_data` and `set_object_data` functions\n example: `sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255);`\n" + "value": "```fallout-ssl-tooltip\nmixed combat_data\n```\n- returns a pointer to the `C_ATTACK_*` data for the current combat attack process (see defined constants in **define_extra.h**)\n- can be used in conjunction with the `get_object_data` and `set_object_data` functions\n example: `sfall_func3(\"set_object_data\", sfall_func0(\"combat_data\"), C_ATTACK_UNUSED, 255);`\n" } }, "disable_aimed_shots": { @@ -1607,10 +1595,16 @@ "value": "```fallout-ssl-tooltip\nint get_bodypart_hit_modifier(int bodypart)\n```\nGets the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8." } }, + "get_combat_free_move": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_combat_free_move()\n```\nReturns available \"bonus move\" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move`" + } + }, "get_critical_table": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_critical_table(int crittertype, int bodypart, int level, int valuetype)\n```\nGets current critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Requires `OverrideCriticalTable` to be set to 1 in `ddraw.ini`. (Disabled by default, because it noticably increases loading times.)" + "value": "```fallout-ssl-tooltip\nint get_critical_table(int crittertype, int bodypart, int level, int valuetype)\n```\nGets current critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Requires `OverrideCriticalTable` to be enabled in `ddraw.ini` (already enabled by default)." } }, "get_critter_current_ap": { @@ -1643,10 +1637,16 @@ "value": "```fallout-ssl-tooltip\nvoid set_bodypart_hit_modifier(int bodypart, int value)\n```\nAlters the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload." } }, + "set_combat_free_move": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nvoid set_combat_free_move(int value)\n```\nAllows changing \"bonus move\" points (yellow lights on the interface bar) that can only be used for movement, not attacking\n- Can be called from `HOOK_COMBATTURN` at the start of the turn (will not work on `dude_obj`)\n- Can be called from `HOOK_STDPROCEDURE` with `combat_proc` event (will work on both NPCs and `dude_obj`)\n" + } + }, "set_critical_table": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)\n```\nUsed for modifying the critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Changes are not saved, and will reset to the defaults, (or to the contents of `CriticalOverrides.ini`, if it exists) at each game reload. Requires `OverrideCriticalTable` to be set to 1 in `ddraw.ini`. (Disabled by default, because it noticably increases loading times.)" + "value": "```fallout-ssl-tooltip\nvoid set_critical_table(int crittertype, int bodypart, int level, int valuetype, int value)\n```\nUsed for modifying the critical table. For details see [critical hit tables](http://falloutmods.wikia.com/wiki/Critical_hit_tables). Changes are not saved, and will reset to the defaults (or to the contents of `CriticalOverrides.ini`, if it exists) at each game reload. Requires `OverrideCriticalTable` to be enabled in `ddraw.ini` (already enabled by default)." } }, "set_critter_burst_disable": { @@ -1661,6 +1661,12 @@ "value": "```fallout-ssl-tooltip\nvoid set_critter_current_ap(CritterPtr, int ap)\n```\nShould only be used during the target critters turn while in combat." } }, + "set_spray_settings": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nvoid set_spray_settings(int centerMult, int centerDiv, int targetMult, int targetDiv)\n```\nAllows changing the multipliers and divisors for the bullet distribution of burst attacks dynamically. All settings are automatically reset to default values (**ComputeSpray_\\*** settings in ddraw.ini) after each attack action\n- Should be called before the calculation of the bullet distribution (e.g. in `HOOK_TOHIT` or `HOOK_AMMOCOST`)\n- `centerDiv/targetDiv`: the minimum value of divisor is 1\n- `centerMult/targetMult`: multiplier values are capped at divisor values\n- __NOTE:__ refer to the description of **ComputeSpray_\\*** settings in ddraw.ini for details of the bullet distribution of burst attacks\n" + } + }, "get_cursor_mode": { "contents": { "kind": "markdown", @@ -1682,13 +1688,13 @@ "item_make_explosive": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)\n```\n- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives\n- `maxDamage` is optional\n- `activePid` is for an item with an active timer, can be the same as the `pid` argument\n- the item proto must be \"Misc Item\" type and have \"Use\" action flag\n- minDamage/maxDamage are the minimum and maximum explosion damage\n- using the function on an item that is already set as an explosive will override its previous settings\n- NOTE: this function does not work for pids of Dynamite and Plastic Explosives\n" + "value": "```fallout-ssl-tooltip\nvoid item_make_explosive(int pid, int activePid, int minDamage, int maxDamage)\n```\n- makes the specified item (pid) an explosive item like Dynamite or Plastic Explosives\n- `maxDamage` is optional\n- `activePid` is for an item with an active timer, can be the same as the `pid` argument\n- the item proto must be the **Misc Item** type and have the **Use** action flag\n- minDamage/maxDamage are the minimum and maximum explosion damage\n- using the function on an item that is already set as an explosive will override its previous settings\n- NOTE: this function does not work for pids of Dynamite and Plastic Explosives\n" } }, "metarule2_explosions": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint metarule2_explosions(int arg1, int arg2)\n```\nWas 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." + "value": "```fallout-ssl-tooltip\nint metarule2_explosions(int arg1, int arg2)\n```\nWas made as a quick-and-dirty hack to enable dynamic changes to some explosion parameters for ranged attacks. All changed parameters are automatically reset to vanilla state after each attack action." } }, "set_attack_explosion_art": { @@ -1856,7 +1862,7 @@ "set_shader_mode": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_shader_mode(int mode)\n```\nTells sfall when to use a shader. The parameter is a set of 32 flags which specify the screens on which the shader will be disabled, unless bit 32 is set, in which case the shader will only be active on those screens. Remember that screens are displayed on top of each other; if the player opens the character menu which in combat, the game still considers the player to be in combat. See `sfall.h` for a list of defines.\nThe graphics functions are only available if the user is using graphics mode 4 or 5. Use `graphics_funcs_available` to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when `graphics_funcs_available` returns 0 will do nothing." + "value": "```fallout-ssl-tooltip\nvoid set_shader_mode(int mode)\n```\nTells sfall when to use a shader. The parameter is a set of 32 flags which specify the screens on which the shader will be disabled, unless bit 32 is set, in which case the shader will only be active on those screens. Remember that screens are displayed on top of each other; if the player opens the character menu which in combat, the game still considers the player to be in combat. See **sfall.h** for a list of defines.\nThe graphics functions are only available if the user is using graphics mode 4 or 5. Use `graphics_funcs_available` to check; it returns 1 if you can use them or 0 if you can't. Calling graphics functions when `graphics_funcs_available` returns 0 will do nothing." } }, "set_shader_texture": { @@ -1898,55 +1904,67 @@ "register_hook": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook(int hookID)\n```\nUsed from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, `start` proc will be executed in current global script. You can use all above functions like normal." + "value": "```fallout-ssl-tooltip\nvoid register_hook(int hookID)\n```\nUsed from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, `start` procedure will be executed in current global script. You can use all above functions like normal." } }, "register_hook_proc": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook_proc(int hookID, proc procedure)\n```\nThe 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). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use \"hs_*.int\" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).\n\nUse zero (0) as second argument to unregister hook script from current global script.\n\n__NOTE:__ you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with `set_sfall_return`, the next script may override this value if calls `set_sfall_return` again. Sometimes you need to multiply certain value in a chain of hook scripts.\n\nExample: let's say we have a Mod A which reduces all \"to hit\" chances by 50%. The code might look like this:\n\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance / 2);\n```\n\nMod B also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to Mod A hook script:\n```js\nset_sfall_arg(0, (original_chance / 2));\n```\n\nThis basically changes hook argument for the next script. Mod B code:\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance * 1.5);\nset_sfall_arg(0, (original_chance * 1.5));\n```\n\nSo if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use `set_sfall_arg` in both hooks).\n\nThe defines to use for the `hookID` are in `sfall.h`.\n" + "value": "```fallout-ssl-tooltip\nvoid register_hook_proc(int hookID, proc procedure)\n```\nThe 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). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script with no conflicts) and flexibility. You can place all related hook scripts for a specific mod in one global script!\n\nUse zero (0) as second argument to unregister hook script from current global script.\n\n__NOTE:__ you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. When one of the scripts in a chain returns value with `set_sfall_return`, the next script may override this value if calls `set_sfall_return` again.\n\n__Example:__ Sometimes you need to multiply certain value in a chain of hook scripts. Let's say we have a **Mod A** which reduces all \"to hit\" chances by 50%. The code might look like this:\n\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance / 2);\n```\n\n**Mod B** also want to affect hit chances globally, by increasing them by 50%. Now in order for both mods to work well together, we need to add this line to **Mod A** hook script:\n```js\nset_sfall_arg(0, (original_chance / 2));\n```\n\nThis basically changes hook argument for the next script. **Mod B** code:\n```js\noriginal_chance = get_sfall_arg;\nset_sfall_return(original_chance * 1.5);\nset_sfall_arg(0, (original_chance * 1.5));\n```\n\nSo if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesn't matter in this case, if you use `set_sfall_arg` in both hooks).\n\nThe defines to use for the `hookID` are in **sfall.h**.\n" } }, "register_hook_proc_spec": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid register_hook_proc_spec(int hookID, procedure proc)\n```\nWorks 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). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using `register_hook/register_hook_proc` functions." + "value": "```fallout-ssl-tooltip\nvoid register_hook_proc_spec(int hookID, procedure proc)\n```\nWorks the same as `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). In addition, all scripts hooked to a single hook point with this function are executed in the exact order of how they were registered. In the case of using `register_hook` and `register_hook_proc` functions, scripts are executed in reverse order of how they were registered.\n**The execution chain of script procedures for a hook is as follows:** 1. Procedures registered with `register_hook` and `register_hook_proc` functions (executed in reverse order of registration). 2. The `hs_.int` script. 3. Procedures registered with the `register_hook_proc_spec` function (executed in the exact order of registration)." } }, "set_sfall_arg": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_sfall_arg(int argNum, int value)\n```\nChanges argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see `register_hook_proc`)." + "value": "```fallout-ssl-tooltip\nvoid set_sfall_arg(int argNum, int value)\n```\nChanges argument value. The argument number (`argNum`) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see `register_hook_proc`)." } }, "set_sfall_return": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_sfall_return(int value)\n```\nUsed 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." + "value": "```fallout-ssl-tooltip\nvoid set_sfall_return(any value)\n```\nUsed 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." + } + }, + "get_ini_config": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\narray get_ini_config(string file)\n```\nLoads a given INI file and returns a permanent array (map) where keys are section names and values are permanent sub-arrays (maps) where keys and values are strings.\n- Searches the file in the regular file system, like with all other ini-related functions.\n- Subsequent calls for the same file will return the same array, unless it was disposed using `free_array`.\n" + } + }, + "get_ini_config_db": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\narray get_ini_config_db(string file)\n```\nWorks exactly like `get_ini_config`, except it searches the file in database (DAT) files. If not found, then it will try the regular file system." } }, "get_ini_section": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray get_ini_section(string file, string sect)\n```\nReturns an associative array of keys and values for a given INI file and section. NOTE: all keys and their values will be of String type." + "value": "```fallout-ssl-tooltip\narray get_ini_section(string file, string sect)\n```\nReturns an associative array of keys and values for a given INI file and section.\n- If the INI file is not found, it returns an empty array.\n- __NOTE:__ all keys and their values will be of String type.\n" } }, "get_ini_sections": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray get_ini_sections(string file)\n```\nReturns an array of names of all sections in a given INI file." + "value": "```fallout-ssl-tooltip\narray get_ini_sections(string file)\n```\nReturns an array of names of all sections in a given INI file.\n- If the INI file is not found, it returns an empty array.\n" } }, "get_ini_setting": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_ini_setting(string setting)\n```\n- Reads an integer value from an ini file in the fallout directory.\n- It only takes a single argument; seperate the file name, section and key with a \"\\|\" character; e.g. `myvar:=get_ini_setting(\"myini.ini|mysec|var1\")` If the file or key cannot be found, -1 is returned.\n- The file name is limited to 63 chars, including the extension.\n- The section name is limited to 32 characters.\n- It can also be used to get sfall's settings, by using `ddraw.ini` as the file name.\n" + "value": "```fallout-ssl-tooltip\nint get_ini_setting(string setting)\n```\nReads an integer value from an ini file in the Fallout directory.\n- It only takes a single argument; seperate the file name, section and key with a \"\\|\" character; e.g. `myvar:=get_ini_setting(\"myini.ini|mysec|var1\")`\n- If the file or key cannot be found or the setting argument is in an invalid format, it returns -1.\n- The file name is limited to 63 chars, including the extension.\n- The section name is limited to 32 characters.\n- It can also be used to get sfall settings by using **ddraw.ini** as the file name.\n" } }, "get_ini_string": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring get_ini_string(string setting)\n```\nReads a string value from an ini file in the fallout directory." + "value": "```fallout-ssl-tooltip\nstring get_ini_string(string setting)\n```\nReads a string value from an ini file in the Fallout directory.\n- If the file or key cannot be found, it returns an empty string.\n- If the setting argument is in an invalid format, it returns -1 (integer).\n" } }, "modified_ini": { @@ -2042,31 +2060,31 @@ "list_as_array": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray list_as_array(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\narray list_as_array(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, "list_begin": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint list_begin(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nint list_begin(int type)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, "list_end": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid list_end(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nvoid list_end(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, "list_next": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint list_next(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\nint list_next(int listid)\n```\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, "party_member_list": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray party_member_list(int includeHidden)\n```\nReturns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list. (Defined in `sfall.h`) It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." + "value": "```fallout-ssl-tooltip\narray party_member_list(int includeHidden)\n```\nReturns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)\nThe `list_xxx` functions can be used to loop over all items on a map. `list_begin` takes an argument telling sfall what you want to list (defined in **sfall.h**). It returns a list pointer, which you iterate through with `list_next`. Finally, when you've finished with the list use `list_end` on it. Not calling `list_end` will result in a memory leak. Alternatively, use `list_as_array` to get the whole list at once as a temp array variable, which can be looped over using `len_array` and which you don't need to remember to free afterwards." } }, "lock_is_jammed": { @@ -2102,7 +2120,7 @@ "intface_redraw": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid intface_redraw(bool winType)\n```\nRedraws main game interface. Useful after direct changes to current player weapons or stats to reflect changes.\n- redraws main game interface, useful to reflect changes after directly changing current player weapons or stats\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`). Pass `-1` to redraw all interface windows.\n" + "value": "```fallout-ssl-tooltip\nvoid intface_redraw(bool winType)\n```\nRedraws main game interface. Useful after direct changes to current player weapons or stats to reflect changes.\n- redraws main game interface, useful to reflect changes after directly changing current player weapons or stats\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**). Pass `-1` to redraw all interface windows.\n" } }, "intface_show": { @@ -2126,7 +2144,7 @@ "force_encounter_with_flags": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid force_encounter_with_flags(int map, int flags)\n```\nDoes the same thing as force_encounter, but allows the specification of some extra options (see `sfall.h` for available flags).\nForcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it. In this case use `force_encounter_with_flags` with the `ENCOUNTER_FLAG_NO_CAR` flag set.\n" + "value": "```fallout-ssl-tooltip\nvoid force_encounter_with_flags(int map, int flags)\n```\nDoes the same thing as force_encounter, but allows the specification of some extra options (see **sfall.h** for available flags).\nForcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it. In this case use `force_encounter_with_flags` with the `ENCOUNTER_FLAG_NO_CAR` flag set.\n" } }, "get_map_enter_position": { @@ -2216,7 +2234,7 @@ "floor2": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint floor2(int/float value)\n```\nWorks just like vanilla floor function, but returns correct integers for negative values (vanilla floor function works exactly the same as `ceil` for negative values, much like `trunc` in C/C++)." + "value": "```fallout-ssl-tooltip\nint floor2(int/float value)\n```\nWorks just like vanilla floor function, but returns correct integers for negative floats.\n- __NOTE:__ vanilla `floor` function works exactly the same as `ceil` for negative floats (i.e. basically `trunc` in C/C++).\n" } }, "log": { @@ -2288,19 +2306,19 @@ "get_flags": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_flags(ObjectPtr obj)\n```\nGets the current value of object flags (see `define_extra.h` for available flags)." + "value": "```fallout-ssl-tooltip\nint get_flags(ObjectPtr obj)\n```\nGets the current value of object flags (see **define_extra.h** for available flags)." } }, "get_object_data": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_object_data(ObjectPtr object, int offset)\n```\nReturns the data at the specified offset of an object (see `OBJ_DATA_*` constants in `define_extra.h` for offsets)." + "value": "```fallout-ssl-tooltip\nget_object_data(ObjectPtr object, int offset)\n```\nReturns the data at the specified offset of an object (see `OBJ_DATA_*` constants in **define_extra.h** for offsets)." } }, "get_script": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_script(ObjectPtr)\n```\n- accepts a pointer to an object and returns its scriptID (line number in `scripts.lst`), or 0 if the object is unscripted.\n- returns -1 on argument error.\n" + "value": "```fallout-ssl-tooltip\nint get_script(ObjectPtr obj)\n```\n- accepts a pointer to an object and returns its scriptID (line number in `scripts.lst`), or 0 if the object is unscripted.\n- returns -1 on argument error.\n" } }, "loot_obj": { @@ -2318,7 +2336,7 @@ "obj_is_openable": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nbool obj_is_openable(object obj)\n```\nReturns True if the object is openable (i.e. has an opening/closing animation)" + "value": "```fallout-ssl-tooltip\nbool obj_is_openable(object obj)\n```\nReturns True if the object is openable (i.e. has an opening/closing animation), False otherwise" } }, "obj_under_cursor": { @@ -2336,7 +2354,7 @@ "remove_script": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid remove_script(ObjectPtr)\n```\nAccepts a pointer to an object and will remove the script from that object." + "value": "```fallout-ssl-tooltip\nvoid remove_script(ObjectPtr obj)\n```\nAccepts a pointer to an object and will remove the script from that object." } }, "set_dude_obj": { @@ -2366,13 +2384,13 @@ "set_script": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_script(ObjectPtr, int scriptid)\n```\nAccepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as `create_object_sid `from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling `set_script` on `self_obj` will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling `set_script`, `map_enter_p_proc` will be SKIPPED. The `start` proc will always be run." + "value": "```fallout-ssl-tooltip\nvoid set_script(ObjectPtr obj, int scriptID)\n```\nAccepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as `create_object_sid `from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling `set_script` on `self_obj` will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling `set_script`, `map_enter_p_proc` will be SKIPPED. The `start` proc will always be run." } }, "set_self": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_self(ObjectPtr)\n```\nOverrides the script's `self_obj` for the next function call.\n- It is primarily used to allow the calling of functions which take an implicit `self_obj` parameter (e.g. `drop_obj`) from global scripts, but it can also be used from normal scripts.\n- `self_obj` will be reverted to its original value after the next function call.\n- Calling `set_self(0)` will also revert `self_obj` to its original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.\n- `source_obj`, `target_obj`, and similar functions will not work if preceded by `set_self`.\n- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice. You can also access the local variables in the script of an object after calling `set_self` twice.\n" + "value": "```fallout-ssl-tooltip\nvoid set_self(ObjectPtr setObj)\n```\nOverrides the script's `self_obj` for the next function call.\n- It is primarily used to allow the calling of functions which take an implicit `self_obj` parameter (e.g. `drop_obj`) from global scripts, but it can also be used from normal scripts.\n- `self_obj` will be reverted to its original value after the next function call.\n- Calling `set_self(0)` will also revert `self_obj` to its original value. It is recommended to call this after each use of `set_self` in normal scripts in order to avoid unforeseen side effects.\n- `source_obj`, `target_obj`, and similar functions will not work if preceded by `set_self`.\n- __NOTE:__ for `use_obj`, `use_obj_on_obj` vanilla functions to work correctly, it is required to call `set_self` twice. You can also access the local variables in the script of an object after calling `set_self` twice.\n" } }, "set_unique_id": { @@ -2522,7 +2540,7 @@ "message_str_game": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring message_str_game(int fileId, int messageId)\n```\nWorks exactly the same as message_str, except you get messages from files in `text/english/game` folder. Use `GAME_MSG_*` defines or `mstr_*` macros from `sfall.h` to use specific msg file\n- Additional game msg files added by `ExtraGameMsgFileList` setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set `ExtraGameMsgFileList=foo,bar` in `ddraw.ini`, `foo.msg` will be associated with 0x2000 and `bar.msg` with 0x2001.).\n- If a file has a specific number assigned in `ExtraGameMsgFileList`, its fileId will be (0x2000 + assigned number). (e.g. with `ExtraGameMsgFileList=foo,bar:2,foobar` in `ddraw.ini`, `bar.msg` will be associated with 0x2002 and `foobar.msg` with 0x2003.)\n" + "value": "```fallout-ssl-tooltip\nstring message_str_game(int fileId, int messageId)\n```\nWorks exactly the same as message_str, except you get messages from files in `text/english/game` folder. Use `GAME_MSG_*` defines or `mstr_*` macros from **sfall.h** to use specific msg file\n- Additional game msg files added by `ExtraGameMsgFileList` setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set `ExtraGameMsgFileList=foo,bar` in `ddraw.ini`, `foo.msg` will be associated with 0x2000 and `bar.msg` with 0x2001.).\n- If a file has a specific number assigned in `ExtraGameMsgFileList`, its fileId will be (0x2000 + assigned number). (e.g. with `ExtraGameMsgFileList=foo,bar:2,foobar` in `ddraw.ini`, `bar.msg` will be associated with 0x2002 and `foobar.msg` with 0x2003.)\n" } }, "mod_kill_counter": { @@ -2612,7 +2630,7 @@ "set_pipboy_available": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_pipboy_available(int available)\n```\nWill only accept 0 or 1 as an argument. Using any other value will cause the function to have no effect. Use 0 to disable the pipboy, and 1 to enable it." + "value": "```fallout-ssl-tooltip\nvoid set_pipboy_available(int available)\n```\nSets the availability of the pipboy in the game. Use 0 to disable the pipboy, and 1 or 2 to enable it (value 2 does not mark the `VSUIT_MOVIE` movie as \"played\")." } }, "set_proto_data": { @@ -2672,7 +2690,7 @@ "unwield_slot": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid sfall_func2(\"unwield_slot\", object critter, int slot)\n```\nunequips an item from the specified slot for a critter or the player\ncan take off player's equipped item when the inventory is opened, or the player is in the barter screen\nslot: 0 - armor slot, 1 - right slot, 2 - left slot (see `INVEN_TYPE_*` in `define.h`)\n" + "value": "```fallout-ssl-tooltip\nvoid sfall_func2(\"unwield_slot\", object critter, int slot)\n```\nunequips an item from the specified slot for a critter or the player\ncan take off player's equipped item when the inventory is opened, or the player is in the barter screen\nslot: 0 - armor slot, 1 - right slot, 2 - left slot (see `INVEN_TYPE_*` in **define.h**)\n" } }, "get_outline": { @@ -2690,7 +2708,7 @@ "set_outline": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_outline(ObjectPtr obj, int color)\n```\n- sets the outline color of an object (see `OUTLINE_*` constants in `sfall.h`)\n- can also set a custom color from the game palette by shifting the color index value left by 8 bits: `0xCC00` where `CC` is the palette index (available since sfall 4.2.7/3.8.27)\n- passing 0 will disable the outline\n" + "value": "```fallout-ssl-tooltip\nvoid set_outline(ObjectPtr obj, int color)\n```\n- sets the outline color of an object (see `OUTLINE_*` constants in **sfall.h**)\n- can also set a custom color from the game palette by shifting the color index value left by 8 bits: `0xCC00` where `CC` is the palette index (available since sfall 4.2.7/3.8.27)\n- passing 0 will disable the outline\n" } }, "apply_heaveho_fix": { @@ -2978,7 +2996,7 @@ "get_object_ai_data": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_object_ai_data(ObjectPtr object, int aiParam)\n```\nReturns the setting value from the AI packet of an object (critter). Use `AI_CAP_*` constants from `define_extra.h` for the `aiParam` argument to get AI value." + "value": "```fallout-ssl-tooltip\nint get_object_ai_data(ObjectPtr object, int aiParam)\n```\nReturns the setting value from the AI packet of an object (critter). Use `AI_CAP_*` constants from **define_extra.h** for the `aiParam` argument to get AI value." } }, "get_text_width": { @@ -3008,7 +3026,7 @@ "objects_in_radius": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nobjects_in_radius\", int tile, int radius, int elevation, int type)\n```\n- returns an array of objects of a type (see `OBJ_TYPE_*` constants in `define_extra.h`) within the specified radius from the given tile\n- passing -1 to the `type` argument or _not specifying it_ will return all objects within the radius\n- the radius is limited to 50 hexes\n" + "value": "```fallout-ssl-tooltip\nobjects_in_radius\", int tile, int radius, int elevation, int type)\n```\n- returns an array of objects of a type (see `OBJ_TYPE_*` constants in **define_extra.h**) within the specified radius from the given tile\n- passing -1 to the `type` argument or _not specifying it_ will return all objects within the radius\n- the radius is limited to 50 hexes\n" } }, "set_drugs_data": { @@ -3026,7 +3044,7 @@ "set_rest_mode": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_rest_mode(int flags)\n```\nSets the bit flags for the rest mode (see `RESTMODE_*` constants in `sfall.h`). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game." + "value": "```fallout-ssl-tooltip\nvoid set_rest_mode(int flags)\n```\nSets the bit flags for the rest mode (see `RESTMODE_*` constants in **sfall.h**). Passing 0 will reset the rest mode. It will also be reset each time the player reloads the game." } }, "sfall_func0(\"hide_window\")": { @@ -3158,13 +3176,13 @@ "get_stat_max": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_stat_max(int stat, bool who = False)\n```\n- Returns the maximum set value of the specified stat (see `set_stat_max` functions)\n- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." + "value": "```fallout-ssl-tooltip\nget_stat_max(int stat, bool who = False)\n```\n- Returns the maximum set value of the specified stat (see `set_stat_max` functions)\n- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." } }, "get_stat_min": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nget_stat_min(int stat, bool who = False)\n```\n- Returns the minimum set value of the specified stat (see `set_stat_min` functions)\n- who: 0 (`false`) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." + "value": "```fallout-ssl-tooltip\nget_stat_min(int stat, bool who = False)\n```\n- Returns the minimum set value of the specified stat (see `set_stat_min` functions)\n- who: 0 (`False`) or omitting the argument - returns the value of the player, 1 (`True`) - returns the value set for other critters\n\nThe `get/set_pc_base/extra_stat` functions are equivalent to calling `get/set_critter_base/extra_stat` with `dude_obj` as the critter pointer. None of these stat functions take perks into account, and neither do they do range clamping to make sure the stats are valid. Use the normal `get_critter_stat` function to get a correctly perk adjusted and range clamped value for a stat." } }, "set_critter_base_stat": { @@ -3200,19 +3218,43 @@ "get_string_pointer": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_string_pointer(string text)\n```\nReturns a pointer to a string variable or to a text." + "value": "```fallout-ssl-tooltip\nint get_string_pointer(string text)\n```\n(DEPRECATED) Returns a pointer to a string variable or to a text\n- __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function\n" + } + }, + "string_find": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint string_find(string haystack, string needle)\n```\nReturns the position of the first occurrence of a `needle` string in a `haystack` string, or -1 if not found. The first character position is 0 (zero)." + } + }, + "string_find_from": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint string_find_from(string haystack, string needle, int pos)\n```\nWorks the same as `string_find`, except you can specify the position to start the search.\n- If `pos` is negative - it indicates a position starting from the end of the string, similar to `substr()`.\n" } }, "string_format": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring string_format(string format, any val1, any val2, ...)\n```\nFormats given value using standard syntax of C printf function (google \"printf\" for format details). However it is limited to formatting up to 4 values.\n- formatting is only supported for %s and %d, and the format string is limited to 1024 characters\n" + "value": "```fallout-ssl-tooltip\nstring string_format(string format, any val1, any val2, ...)\n```\nFormats given values using standard syntax of C `printf` function (google \"printf\" for format details). However, it is limited to formatting up to 7 values.\n- The format string is limited to 1024 characters\n" + } + }, + "string_format_array": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nstring string_format_array(string format, int array)\n```\nThe same as string_format, but accepts an array of parameters." + } + }, + "string_replace": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nstring string_replace(string str, string search, string replace)\n```\nReplaces all occurances of a given search string in a string with a given replacement string." } }, "string_split": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\narray string_split(string, split)\n```\nTakes 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. You can use this to search for a substring in a string like this: `strlen(get_array(string_split(haystack, needle), 0))`" + "value": "```fallout-ssl-tooltip\narray string_split(string text, split)\n```\nTakes 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. You can use this to search for a substring in a string like this: `strlen(get_array(string_split(haystack, needle), 0))`" } }, "string_to_case": { @@ -3230,7 +3272,7 @@ "substr": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring substr(string, start, length)\n```\nCuts a substring from a string starting at \"start\" up to \"length\" characters. The first character position is 0 (zero).\n- 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\").\n- 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\").\n- If length is zero - it will return a string from the starting position to the end of the string **New behavior** for sfall 4.2.2/3.8.22\n" + "value": "```fallout-ssl-tooltip\nstring substr(string text, int start, int length)\n```\nCuts a substring from a string starting at \"start\" up to \"length\" characters. The first character position is 0 (zero).\n- If start is negative - it indicates a position starting from the end of the string (for example `substr(\"test\", -2, 2)` will return last 2 charactes: \"st\").\n- 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\").\n- If length is zero - it will return a string from the starting position to the end of the string. **New behavior** for sfall 4.2.2/3.8.22\n" } }, "add_iface_tag": { @@ -3266,13 +3308,25 @@ "get_tile_fid": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint get_tile_fid(int tile)\n```" + "value": "```fallout-ssl-tooltip\nint get_tile_fid(int tileData)\n```\n- Returns FID information about the square under the given tile at elevation 0\n- Pass elevation as 4-bit number in bits 25-28 to access other elevations\n- Pass result mode in bits 29-32: 0 - ground FID, 1 - roof FID, 2 - raw data.\n" + } + }, + "get_tile_ground_fid": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_tile_ground_fid(int tileNum, int elevation)\n```\nReturns FID of a ground tile at given tile number and elevation." + } + }, + "get_tile_roof_fid": { + "contents": { + "kind": "markdown", + "value": "```fallout-ssl-tooltip\nint get_tile_roof_fid(int tileNum, int elevation)\n```\nReturns FID of a roof tile at given tile number and elevation. Note that FID of 1 is used when there is no actual roof." } }, "obj_blocking_line": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)\n```\nReturns first object which blocks direct linear path from `objFrom` to `tileTo` using selected blocking function (see `BLOCKING_TYPE_*` constants in `sfall.h`). If path is clear (no blocker was encountered by selected function) - returns 0. `objFrom` is always excluded from calculations, but is required to be a valid object." + "value": "```fallout-ssl-tooltip\nObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)\n```\nReturns first object which blocks direct linear path from `objFrom` to `tileTo` using selected blocking function (see `BLOCKING_TYPE_*` constants in **sfall.h**). If path is clear (no blocker was encountered by selected function) - returns 0. `objFrom` is always excluded from calculations, but is required to be a valid object." } }, "obj_blocking_tile": { @@ -3332,7 +3386,7 @@ "sprintf": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nstring sprintf(string format, any value)\n```\nFormats given value using standart syntax of C printf function (google \"printf\" for format details). However it is limited to formatting only 1 value. Can be used to get character by ASCII code (\"%c\")." + "value": "```fallout-ssl-tooltip\nstring sprintf(string format, any value)\n```\nFormats given value using standart syntax of C `printf` function (google \"printf\" for format details). However, it is limited to formatting only 1 value.\n- Can be used to get character by ASCII code (\"%c\").\n" } }, "typeof": { @@ -3512,7 +3566,7 @@ "get_window_attribute": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint sfall_func1(\"get_window_attribute\", int winType)\n```\nAlternative form: `int sfall_func2(\"get_window_attribute\", int winType, int attrType)`\nReturns the attribute of the specified interface window by the `attrType` argument.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n- `attrType`: `0` - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)\n `1` - X position, `2` - Y position (relative to the top-left corner of the game screen)\n `3` - interface width size, `4` - interface height size\n `-1` - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle\n (use standard syntax to access array values, e.g. `winRect.top`, `winRect.bottom`)\n- returns -1 if the specified attribute cannot be obtained\n" + "value": "```fallout-ssl-tooltip\nint sfall_func1(\"get_window_attribute\", int winType)\n```\nAlternative form: `int sfall_func2(\"get_window_attribute\", int winType, int attrType)`\nReturns the attribute of the specified interface window by the `attrType` argument.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n- `attrType`: `0` - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)\n `1` - X position, `2` - Y position (relative to the top-left corner of the game screen)\n `3` - interface width size, `4` - interface height size\n `-1` - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle\n (use standard syntax to access array values, e.g. `winRect.top`, `winRect.bottom`)\n- returns -1 if the specified attribute cannot be obtained\n" } }, "get_window_under_mouse": { @@ -3524,7 +3578,7 @@ "interface_art_draw": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\n```\n```c++\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\nint sfall_func5(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame)\nint sfall_func6(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame, array param)\n```\n- draws the specified PCX or FRM image in the game interface window, returns -1 on any error\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n this also takes the value of the flag (0x1000000) to prevent immediate redrawing of the interface window\n- `artFile/artId`: path to the PCX/FRM file (e.g. `art\\\\inven\\\\5mmap.frm`), or its FRM ID number (e.g. `0x7000026`, see specification of the FID format)\n- `x/y`: offset relative to the top-left corner of the window\n\noptional arguments:\n- `frame`: frame number, the first frame starts from zero\n- `param`: an array which specifies additional parameters, where:\n index 0 - sprite direction for multi-directional FRM\n index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height\n" + "value": "```fallout-ssl-tooltip\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\n```\n```c++\nint sfall_func4(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y)\nint sfall_func5(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame)\nint sfall_func6(\"interface_art_draw\", int winType, string artFile/int artID, int x, int y, int frame, array param)\n```\n- draws the specified PCX or FRM image in the game interface window, returns -1 on any error\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n this also takes the value of the flag (0x1000000) to prevent immediate redrawing of the interface window\n- `artFile/artId`: path to the PCX/FRM file (e.g. `art\\\\inven\\\\5mmap.frm`), or its FRM ID number (e.g. `0x7000026`, see specification of the FID format)\n- `x/y`: offset relative to the top-left corner of the window\n\noptional arguments:\n- `frame`: frame number, the first frame starts from zero\n- `param`: an array which specifies additional parameters, where:\n index 0 - sprite direction for multi-directional FRM\n index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height\n" } }, "interface_print": { @@ -3542,13 +3596,13 @@ "nterface_overlay": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nsfall_func2(\"interface_overlay\", int winType, int mode)\n```\nAlternative form: `int sfall_func6(\"interface_overlay\", int winType, 2, int x, int y, int width, int height)`.\n\nCreates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of `interface_art_draw` and `interface_print` functions will draw on it.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in `sfall.h`)\n- `mode`: 1 - creates a new overlay surface\n 2 - clears the overlay area or the specified rectangle defined by the `x`, `y`, `width`, `height` arguments\n 0 - destroys the created overlay surface (frees up the memory allocated to the surface)\n" + "value": "```fallout-ssl-tooltip\nsfall_func2(\"interface_overlay\", int winType, int mode)\n```\nAlternative form: `int sfall_func6(\"interface_overlay\", int winType, 2, int x, int y, int width, int height)`.\n\nCreates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of `interface_art_draw` and `interface_print` functions will draw on it.\n- `winType`: the type number of the interface window (see `WINTYPE_*` constants in **sfall.h**)\n- `mode`: 1 - creates a new overlay surface\n 2 - clears the overlay area or the specified rectangle defined by the `x`, `y`, `width`, `height` arguments\n 0 - destroys the created overlay surface (frees up the memory allocated to the surface)\n" } }, "set_window_flag": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nvoid set_window_flag(string winName/int winID, int flag, bool value)\n```\nChanges the specified flag for the created script or game interface window.\n- winName: the window name, assigned to the window by the `CreateWin/create_win` function\n- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface\n- flag: the flag to change (see `WIN_FLAG_*` constants in `define_extra.h`)\n- value: `true` - set the flag, `false` - unset the flag\n" + "value": "```fallout-ssl-tooltip\nvoid set_window_flag(string winName/int winID, int flag, bool value)\n```\nChanges the specified flag for the created script or game interface window.\n- winName: the window name, assigned to the window by the `CreateWin/create_win` function\n- winID: the ID number of the interface or script window obtained with the `get_window_under_mouse` function, or 0 for the current game interface\n- flag: the flag to change (see `WIN_FLAG_*` constants in **define_extra.h**)\n- value: `True` - set the flag, `False` - unset the flag\n" } }, "win_fill_color": { @@ -3764,13 +3818,13 @@ "HOOK_AMMOCOST": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_AMMOCOST\n```\nRuns when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
\nBy default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.
\nTo add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.\n\n```\nItem arg0 - The weapon\nint arg1 - Number of bullets in burst or 1 for single shots\nint arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)\n NOTE: for hook type 2, this value is the ammo cost per round (default is always 1)\nint arg3 - Type of hook:\n 0 - when subtracting ammo after single shot attack\n 1 - when checking for \"out of ammo\" before attack\n 2 - when calculating number of burst rounds\n 3 - when subtracting ammo after burst attack\n\nint ret0 - The new amount of ammo to be consumed, or ammo cost per round for hook type 2 (set to 0 for unlimited ammo)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_AMMOCOST\n```\nRuns when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.
\nBy default, a weapon can perform an attack with at least one ammo, regardless of ammo cost calculation.
\nTo add proper checks for ammo before attacking (hook type 1 `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.\n\n__NOTE:__ The return value must be greater than or equal to 0 to be valid.\n\n```\nItem arg0 - The weapon\nint arg1 - Number of bullets in burst or 1 for single shots\nint arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)\n NOTE: for hook type 2, this value is the ammo cost per round (default is always 1)\nint arg3 - Type of hook:\n 0 - when subtracting ammo after single shot attack\n 1 - when checking for \"out of ammo\" before attack\n 2 - when calculating number of burst rounds\n 3 - when subtracting ammo after burst attack\n\nint ret0 - The new amount of ammo to be consumed, or ammo cost per round for hook type 2 (set to 0 for unlimited ammo)\n```\n" } }, "HOOK_BARTERPRICE": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_BARTERPRICE\n```\nRuns whenever the value of goods being purchased is calculated.\n\nNOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC.\n\n```\nCritter arg0 - the critter doing the bartering (either dude_obj or inven_dude)\nCritter arg1 - the critter being bartered with\nint arg2 - the default value of the goods\nCritter arg3 - table of requested goods (being bought from NPC)\nint arg4 - the amount of actual caps in the barter stack (as opposed to goods)\nint arg5 - the value of all goods being traded before skill modifications\nCritter arg6 - table of offered goods (being sold to NPC)\nint arg7 - the total cost of the goods offered by the player\nint arg8 - 1 if the \"offers\" button was pressed (not for a party member), 0 otherwise\nint arg9 - 1 if trading with a party member, 0 otherwise\n\nint ret0 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)\nint ret1 - the modified value of all offered goods\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_BARTERPRICE\n```\nRuns whenever the value of goods being purchased is calculated.\n\nNOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC.\n\n```\nCritter arg0 - the critter doing the bartering (either dude_obj or inven_dude)\nCritter arg1 - the critter being bartered with\nint arg2 - the default value of the goods\nCritter arg3 - table of requested goods (being bought from NPC)\nint arg4 - the number of actual caps in the barter stack (as opposed to goods)\nint arg5 - the value of all goods being traded before skill modifications\nCritter arg6 - table of offered goods (being sold to NPC)\nint arg7 - the total cost of the goods offered by the player\nint arg8 - 1 if the \"offers\" button was pressed (not for a party member), 0 otherwise\nint arg9 - 1 if trading with a party member, 0 otherwise\n\nint ret0 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)\nint ret1 - the modified value of all offered goods\n```\n" } }, "HOOK_BESTWEAPON": { @@ -3782,13 +3836,13 @@ "HOOK_CALCAPCOST": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_CALCAPCOST\n```\nRuns whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
\nNote that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
\nYou can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.\n\n```\nCritter arg0 - The critter performing the action\nint arg1 - Attack Type (see ATKTYPE_* constants)\nint arg2 - Is aimed attack (1 or 0)\nint arg3 - The default AP cost\nItem arg4 - The weapon for which the cost is calculated. If it is 0, the pointer to the weapon can still be obtained by the aforementioned method\n\nint ret0 - The new AP cost\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_CALCAPCOST\n```\nRuns whenever Fallout calculates the AP cost of using an active item in hand (or unarmed attack). Doesn't run for moving.
\nNote that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
\nYou can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.\n\n```\nCritter arg0 - The critter performing the action\nint arg1 - Attack Type (see ATKTYPE_* constants)\nint arg2 - Is aimed attack (1 or 0)\nint arg3 - The default AP cost\nItem arg4 - The weapon for which the cost is calculated. If it is 0, the pointer to the weapon can still be obtained by the aforementioned method\n\nint ret0 - The new AP cost\n```\n" } }, "HOOK_CANUSEWEAPON": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_CANUSEWEAPON\n```\nRun when the AI checks whether it can use a weapon.\nThis mostly happens when NPCs try to find weapons in their inventory or on the map.\n\n```\nCritter arg0 - the critter doing the check\nItem arg1 - the weapon being checked\nint arg2 - attack type (see ATKTYPE_* constants)\nint arg3 - original result of engine function: 1 - can use, 0 - can't use\n\nint ret0 - overrides the result of engine function. Any non-zero value allows using the weapon\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_CANUSEWEAPON\n```\nRun when the AI checks whether it can use a weapon.\nThis mostly happens when NPCs try to find weapons in their inventory or on the map.\n\n```\nCritter arg0 - the critter doing the check\nItem arg1 - the weapon being checked\nint arg2 - attack type (see ATKTYPE_* constants)\nint arg3 - original result of engine function: 1 - can use, 0 - cannot use\n\nint ret0 - overrides the result of engine function. Any non-zero value allows using the weapon\n```\n" } }, "HOOK_CARTRAVEL": { @@ -3800,13 +3854,13 @@ "HOOK_COMBATDAMAGE": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_COMBATDAMAGE\n```\nRuns when:\n1. Game calculates how much damage each target will get. This includes primary target as well as all extras (explosions and bursts). This happens BEFORE the actual attack animation.\n2. AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.\n\nDoes not run for misses, or non-combat damage like dynamite explosions.\n\n```\nCritter arg0 - The target\nCritter arg1 - The attacker\nint arg2 - The amount of damage to the target\nint arg3 - The amount of damage to the attacker\nint arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags)\nint arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)\nint arg6 - The weapon used in the attack\nint arg7 - The bodypart that was struck\nint arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)\nint arg9 - Number of bullets actually hit the target (1 for melee attacks)\nint arg10 - The amount of knockback to the target\nint arg11 - Attack Type (see ATKTYPE_* constants)\nmixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)\n\nint ret0 - The damage to the target\nint ret1 - The damage to the attacker\nint ret2 - The special effect flags for the target\nint ret3 - The special effect flags for the attacker\nint ret4 - The amount of knockback to the target\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_COMBATDAMAGE\n```\nRuns when:\n1. Game calculates how much damage each target will get. This includes primary target as well as all extras (explosions and bursts). This happens BEFORE the actual attack animation.\n2. AI decides whether it is safe to use area attack (burst, grenades), if he might hit friendlies.\n\nDoes not run for misses, or non-combat damage like dynamite explosions.\n\n```\nCritter arg0 - The target\nCritter arg1 - The attacker\nint arg2 - The amount of damage to the target\nint arg3 - The amount of damage to the attacker\nint arg4 - The special effect flags for the target (use bwand DAM_* to check specific flags)\nint arg5 - The special effect flags for the attacker (use bwand DAM_* to check specific flags)\nItem arg6 - The weapon used in the attack\nint arg7 - The bodypart that was struck\nint arg8 - Damage Multiplier (this is divided by 2, so a value of 3 does 1.5x damage, and 8 does 4x damage. Usually it's 2; for critical hits, the value is taken from the critical table; with Silent Death perk and the corresponding attack conditions, the value will be doubled)\nint arg9 - Number of bullets actually hit the target (1 for melee attacks)\nint arg10 - The amount of knockback to the target\nint arg11 - Attack Type (see ATKTYPE_* constants)\nmixed arg12 - computed attack data (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)\n\nint ret0 - The damage to the target\nint ret1 - The damage to the attacker\nint ret2 - The special effect flags for the target\nint ret3 - The special effect flags for the attacker\nint ret4 - The amount of knockback to the target\n```\n" } }, "HOOK_COMBATTURN": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_COMBATTURN\n```\nRuns before and after each turn in combat (for both PC and NPC).\n\n```\nint arg0 - event type:\n 1 - start of turn\n 0 - normal end of turn\n -1 - combat ends abruptly (by script or by pressing Enter during PC turn)\n -2 - combat ends normally (hook always runs at the end of combat)\nCritter arg1 - critter doing the turn\nbool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise\n\nint ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_COMBATTURN\n```\nRuns before and after each turn in combat (for both PC and NPC).\n\n```\nint arg0 - event type:\n 1 - start of turn\n 0 - normal end of turn\n -1 - combat ends abruptly (by script or by pressing Enter during PC turn)\n -2 - combat ends normally (hook always runs at the end of combat)\nCritter arg1 - critter doing the turn\nint arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise\n\nint ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat\n```\n" } }, "HOOK_DEATHANIM1": { @@ -3830,7 +3884,7 @@ "HOOK_DESCRIPTIONOBJ": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_DESCRIPTIONOBJ\n```\nRuns when using the examine action icon to display the description of an object. You can override the description text.\nAn example usage would be to add an additional description to the item based on player's stats/skills.\n\nDoes not run if the script of the object overrides the description.\n\n```\nObj arg0 - the object\n\nint ret0 - a pointer to the new text received by using \"get_string_pointer\" function\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_DESCRIPTIONOBJ\n```\nRuns when using the examine action icon to display the description of an object. You can override the description text.\nAn example usage would be to add an additional description to the item based on player's stats/skills.\n\nDoes not run if the script of the object overrides the description.\n\n__NOTE:__ Returning a pointer to the new text received from the `get_string_pointer` function is still valid, but the method is DEPRECATED and is left for backward compatibility only.\n\n```\nObj arg0 - the object\n\nString ret0 - the new description text to use\n```\n" } }, "HOOK_ENCOUNTER": { @@ -3866,7 +3920,7 @@ "HOOK_INVENTORYMOVE": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_INVENTORYMOVE\n```\nRuns before moving items between inventory slots in dude interface. You can override the action.\nWhat you can NOT do with this hook:\n- force moving items to inappropriate slots (like gun in armor slot)\nWhat you can do:\n- restrict player from using specific weapons or armors\n- add AP costs for all inventory movement including reloading\n- apply or remove some special scripted effects depending on PC's armor\n\n```\nint arg0 - Target slot:\n 0 - main backpack\n 1 - left hand\n 2 - right hand\n 3 - armor slot\n 4 - weapon, when reloading it by dropping ammo\n 5 - container, like bag/backpack\n 6 - dropping on the ground\n 7 - picking up item\n 8 - dropping item on the character portrait\nItem arg1 - Item being moved\nItem arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)\n\nint ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_INVENTORYMOVE\n```\nRuns before moving items between inventory slots in dude interface. You can override the action.\n\nWhat you can NOT do with this hook:\n- force moving items to inappropriate slots (like gun in armor slot)\nWhat you can do:\n- restrict player from using specific weapons or armors\n- add AP costs for all inventory movement including reloading\n- apply or remove some special scripted effects depending on PC's armor\n\n```\nint arg0 - Target slot:\n 0 - main backpack\n 1 - left hand\n 2 - right hand\n 3 - armor slot\n 4 - weapon, when reloading it by dropping ammo\n 5 - container, like bag/backpack\n 6 - dropping on the ground\n 7 - picking up item\n 8 - dropping item on the character portrait\nItem arg1 - Item being moved\nItem arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)\n\nint ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)\n```\n\nNotes for the event of dropping items on the ground:\n- the event is called for each item when dropping multiple items from the stack\n- for ammo type items, the number of dropped ammo in a pack can be found by using the `get_weapon_ammo_count` function\n- for the `PID_BOTTLE_CAPS` item, the event is called only once, and the number of dropped units can be found from the value of the `OBJ_DATA_CUR_CHARGES` object field (or with the `get_weapon_ammo_count` function)\n" } }, "HOOK_ITEMDAMAGE": { @@ -3944,19 +3998,19 @@ "HOOK_STDPROCEDURE": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDURE\n```\nRuns before Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\n\nint ret0 - pass -1 to cancel the execution of the handler\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDURE\n```\nRuns before Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see *_proc in define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - always 0 (1 for _END version)\nObj arg4 - the object that is acted upon by this handler (target_obj, can be 0)\nint arg5 - the parameter of this call (fixed_param), useful for combat_proc\n\nint ret0 - pass -1 to cancel the execution of the handler\n```\n" } }, "HOOK_STDPROCEDUREEND": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDUREEND\n```\nRuns after Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - 1 after procedure execution\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STDPROCEDUREEND\n```\nRuns after Fallout executes a standard procedure (handler) in any script of any object.\nNOTE: this hook will not be executed for `start`, `critter_p_proc`, `timed_event_p_proc`, and `map_update_p_proc` procedures.\n\n```\nint arg0 - the number of the standard script handler (see *_proc in define.h)\nObj arg1 - the object that owns this handler (self_obj)\nObj arg2 - the object that called this handler (source_obj, can be 0)\nint arg3 - always 1 (procedure end)\nObj arg4 - the object that is acted upon by this handler (target_obj, can be 0)\nint arg5 - the parameter of this call (fixed_param), useful for combat_proc\n```\n" } }, "HOOK_STEAL": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_STEAL\n```\nRuns when checking an attempt to steal or plant an item in other inventory using Steal skill.\n\nThis is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player (\"You steal the %s\", \"You are caught planting the %s\", etc.).\nExample message (vanilla behavior):
\n`display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3 * 2), obj_name(arg2)));`\n\n```\nCritter arg0 - Thief\nObj arg1 - The target\nItem arg2 - Item being stolen/planted\nint arg3 - 0 when stealing, 1 when planting\n\nint ret0 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_STEAL\n```\nRuns when checking an attempt to steal or plant an item in other inventory using Steal skill.\n\nThis is fired before the default handlers are called, which you can override. In this case you MUST provide message of the result to player (\"You steal the %s\", \"You are caught planting the %s\", etc.).\nExample message (vanilla behavior):
\n`display_msg(sprintf(mstr_skill(570 + (isSuccess != false) + arg3 * 2), obj_name(arg2)));`\n\n```\nCritter arg0 - Thief\nObj arg1 - The target\nItem arg2 - The item being stolen/planted\nint arg3 - 0 when stealing, 1 when planting\nint arg4 - quantity of the item being stolen/planted\n\nint ret0 - overrides hard-coded handler (2 - force fail without closing window, 1 - force success, 0 - force fail, -1 - use engine handler)\nint ret1 - overrides experience points gained for stealing this item (must be greater than or equal to 0)\n```\n" } }, "HOOK_SUBCOMBATDAMAGE": { @@ -3974,7 +4028,7 @@ "HOOK_TOHIT": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_TOHIT\n```\nRuns when Fallout is calculating the chances of an attack striking a target.
\nRuns after the hit chance is fully calculated normally, including applying the 95% cap.\n\n```\nint arg0 - The hit chance (capped)\nCritter arg1 - The attacker\nCritter arg2 - The target of the attack\nint arg3 - The targeted bodypart\nint arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)\nint arg5 - Attack Type (see ATKTYPE_* constants)\nint arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack\nint arg7 - The raw hit chance before applying the cap\n\nint ret0 - the new hit chance\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_TOHIT\n```\nRuns when Fallout is calculating the chances of an attack striking a target.
\nRuns after the hit chance is fully calculated normally, including applying the 95% cap.\n\n```\nint arg0 - The hit chance (capped)\nCritter arg1 - The attacker\nCritter arg2 - The target of the attack\nint arg3 - The targeted bodypart\nint arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)\nint arg5 - Attack Type (see ATKTYPE_* constants)\nint arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack\nint arg7 - The raw hit chance before applying the cap\n\nint ret0 - The new hit chance. The value is limited to the range of -99 to 999\n```\n" } }, "HOOK_USEANIMOBJ": { @@ -4004,7 +4058,7 @@ "HOOK_USESKILLON": { "contents": { "kind": "markdown", - "value": "```fallout-ssl-tooltip\nHOOK_USESKILLON\n```\nRuns before using any skill on any object. Lets you override the critter that uses the skill.\n\n__NOTE:__ The user critter can't be overridden when using Steal skill.\n\n```\nCritter arg0 - the user critter (usually dude_obj)\nObj arg1 - the target object/critter\nint arg2 - skill being used\n\nint ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value\nint ret1 - pass 1 to allow the skill being used in combat (only for dude_obj or critter being controlled by the player)\n```\n" + "value": "```fallout-ssl-tooltip\nHOOK_USESKILLON\n```\nRuns before using any skill on any object. Lets you override the critter that uses the skill.\n\n__NOTE:__ The user critter can't be overridden when using Steal skill.\n\n```\nCritter arg0 - the user critter (usually dude_obj)\nObj arg1 - the target object/critter\nint arg2 - skill being used\n\nint ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value\nint ret1 - pass 1 to allow the skill to be used in combat (only for dude_obj or critter being controlled by the player)\n```\n" } }, "HOOK_WITHINPERCEPTION": { diff --git a/server/out/hover.weidu-baf.json b/server/out/hover.weidu-baf.json index 7abf624..8513014 100644 --- a/server/out/hover.weidu-baf.json +++ b/server/out/hover.weidu-baf.json @@ -692,7 +692,7 @@ "Enemy": { "contents": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nEnemy()\n```\nThis action is used to change the allegiance of the active creature to enemy (making them hostile to the PC). This example script, from a peasant, will turn the creature hostile if it is attacked.\n\n```\nIF\n AttackedBy([GOODCUTOFF],Myself)\n Allegiance(Myself,NEUTRAL)\nTHEN\n RESPONSE #100\n Enemy()\nEND\n```" + "value": "```weidu-baf-tooltip\nEnemy()\n```\nThis action is used to change the allegiance of the active creature to enemy (making them hostile to the PC). This example script, from a peasant, will turn the creature hostile if it is attacked.\n\n```\nIF\n AttackedBy([GOODCUTOFF],DEFAULT)\n Allegiance(Myself,NEUTRAL)\nTHEN\n RESPONSE #100\n Enemy()\nEND\n```" } }, "EquipItem": { @@ -2264,19 +2264,25 @@ "UseItem": { "contents": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItem(S:Object, O:Target)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItem(S:Object, O:Target)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" + } + }, + "UseItemAbility": { + "contents": { + "kind": "markdown", + "value": "```weidu-baf-tooltip\nUseItemAbility(S:Object, O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, "UseItemSlot": { "contents": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItemSlot(O:Target, I:Slot)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItemSlot(O:Target, I:Slot)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, "UseItemSlotAbility": { "contents": { "kind": "markdown", - "value": "```weidu-baf-tooltip\nUseItemSlotAbility(O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```" + "value": "```weidu-baf-tooltip\nUseItemSlotAbility(O:Target, I:Slot, I:Ability)\n```\nThis action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.\n\n```\nIF\n HPPercentLT(Myself,50)\n HasItem(\"potn52\",Myself)\nTHEN\n RESPONSE #100\n DisplayStringHead(Myself,46150) //quaffs a potion\n UseItem(\"potn52\",Myself)\n Continue()\nEND\n```\n\nIWDEE supports also the `UseItemAbility` signature:\n```\nIF\n !StateCheck(Myself,STATE_MIRRORIMAGE)\n GlobalLT(\"MO_UsedIlbratha\",\"GLOBAL\",1)\n HasItemEquiped(\"SW1H26\",Myself) // Ilbratha +1\nTHEN\n RESPONSE #100\n SetInterrupt(FALSE)\n UseItemAbility(\"SW1H26\",Myself,SLOT_AMMO3,1) // Ilbratha +1\n SetInterrupt(TRUE)\n IncrementGlobal(\"MO_UsedIlbratha\",\"GLOBAL\",1)\nEND\n```" } }, "VEquip": { diff --git a/server/out/hover.weidu-tp2.json b/server/out/hover.weidu-tp2.json index 87a4f5e..7b163ac 100644 --- a/server/out/hover.weidu-tp2.json +++ b/server/out/hover.weidu-tp2.json @@ -608,7 +608,7 @@ "ADD_PROJECTILE": { "contents": { "kind": "markdown", - "value": "```weidu-tp2-tooltip\nADD_PROJECTILE modpath/PROName.PRO\n```\nAppends an entry for PROName to PROJECTL.IDS and assigns it the next available ProRef number. Then copies the file modpath/PROName.PRO to the override folder. The new ProRef number can be accessed through the variable %PROName% and used to updated the Projectile type field of an ITM or SPL file's Item Ability or Spell Ability sub-structures." + "value": "```weidu-tp2-tooltip\nADD_PROJECTILE modpath/PROName.PRO [idsName]\n```\nAppends an entry for PROName to PROJECTL.IDS and assigns it the next available ProRef number. Then copies the file modpath/PROName.PRO to the override folder. The new ProRef number can be accessed through the variable %PROName% and used to updated the Projectile type field of an ITM or SPL file's Item Ability or Spell Ability sub-structures.\nIf `idsName` is specified, then it will give the projectile the name `idsName` in `MISSILE.IDS`." } }, "ADD_SCHOOL": { @@ -2489,6 +2489,12 @@ "value": "```weidu-tp2-tooltip\n%WEIDU_ARCH%\n```\nThe special variable WEIDU_ARCH is set to either \"x86\", \"amd64\" or \"mac\" at WeiDU startup and can be used to determine the architecture of the WeiDU binary." } }, + "%WEIDU_EXECUTABLE%": { + "contents": { + "kind": "markdown", + "value": "```weidu-tp2-tooltip\n%WEIDU_EXECUTABLE%\n```\nThe special variable WEIDU_EXECUTABLE contains the full path of the current WeiDU binary." + } + }, "%WEIDU_OS%": { "contents": { "kind": "markdown", @@ -4685,6 +4691,12 @@ "value": "```weidu-tp2-tooltip\ndword offset ITM_weight = 0x4c\n```\nWeight" } }, + "SPL_description": { + "contents": { + "kind": "markdown", + "value": "```weidu-tp2-tooltip\ndword offset SPL_description = 0x50\n```\nSpell Description" + } + }, "SPL_exclusion_flags": { "contents": { "kind": "markdown", @@ -4715,12 +4727,6 @@ "value": "```weidu-tp2-tooltip\ndword offset SPL_level = 0x34\n```\nSpell Level\n\n- There is no good reason for a Special/Psionic/Innate/Bard song to be any Spell level except `1`.\n- If the SPL is never learned/gained (only force-cast by script/opcode), Spell level doesn't matter, but there may be some niche cases that check it (f.i. HaveSpell())." } }, - "SPL_unidentified_description": { - "contents": { - "kind": "markdown", - "value": "```weidu-tp2-tooltip\ndword offset SPL_unidentified_description = 0x50\n```\nSpell Description - Unidentified (strref)" - } - }, "SPL_unidentified_name": { "contents": { "kind": "markdown", diff --git a/syntaxes/fallout-ssl.tmLanguage.json b/syntaxes/fallout-ssl.tmLanguage.json index 9c957c7..860517a 100644 --- a/syntaxes/fallout-ssl.tmLanguage.json +++ b/syntaxes/fallout-ssl.tmLanguage.json @@ -1262,10 +1262,6 @@ "match": "\\b(?i)(start_gdialog)\\b", "name": "support.function.fallout-ssl.base" }, - { - "match": "\\b(?i)(start_gialog)\\b", - "name": "support.function.fallout-ssl.base" - }, { "match": "\\b(?i)(stopmovie)\\b", "name": "support.function.fallout-ssl.base" @@ -5862,10 +5858,6 @@ "match": "\\b(sprintf2)\\b", "name": "entity.name.function.fallout-ssl.header-defines" }, - { - "match": "\\b(start_dialogue)\\b", - "name": "entity.name.function.fallout-ssl.header-defines" - }, { "match": "\\b(stat_success)\\b", "name": "entity.name.function.fallout-ssl.header-defines"