This commit is contained in:
github-actions[bot]
2023-03-31 14:16:17 +00:00
parent db41a5a677
commit d0b05dc6cd
14 changed files with 48 additions and 48 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/sfall/feed.xml" rel="self" type="application/atom+xml" /><link href="/sfall/" rel="alternate" type="text/html" /><updated>2023-03-20T02:05:46+00:00</updated><id>/sfall/feed.xml</id><title type="html">sfall</title><subtitle>Sfall documentation</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/sfall/feed.xml" rel="self" type="application/atom+xml" /><link href="/sfall/" rel="alternate" type="text/html" /><updated>2023-03-31T14:16:06+00:00</updated><id>/sfall/feed.xml</id><title type="html">sfall</title><subtitle>Sfall documentation</subtitle></feed>
File diff suppressed because one or more lines are too long
+6 -6
View File
@@ -3,14 +3,14 @@
</code></pre></div></div> <p>Gets the value of hook argument with the specified argument number (first argument of hook starts from 0)</p><hr /> <h3 id="get_sfall_args"> <a href="#get_sfall_args" class="anchor-heading" aria-labelledby="get_sfall_args"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_sfall_args</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">get_sfall_args</span><span class="p">()</span>
</code></pre></div></div> <p>Returns all hook arguments as a new temp array.</p><hr /> <h3 id="init_hook"> <a href="#init_hook" class="anchor-heading" aria-labelledby="init_hook"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>init_hook</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">init_hook</span><span class="p">()</span>
</code></pre></div></div> <p>The hook script equivalent of <code class="language-plaintext highlighter-rouge">game_loaded</code>; it returns 1 when the script is loaded for the first time or when the player reloads the game, and 0 otherwise.</p><hr /> <h3 id="register_hook"> <a href="#register_hook" class="anchor-heading" aria-labelledby="register_hook"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>register_hook</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">register_hook</span><span class="p">(</span><span class="kt">int</span> <span class="n">hookID</span><span class="p">)</span>
</code></pre></div></div> <p>Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, <code class="language-plaintext highlighter-rouge">start</code> proc will be executed in current global script. You can use all above functions like normal.</p><hr /> <h3 id="register_hook_proc"> <a href="#register_hook_proc" class="anchor-heading" aria-labelledby="register_hook_proc"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>register_hook_proc</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">register_hook_proc</span><span class="p">(</span><span class="kt">int</span> <span class="n">hookID</span><span class="p">,</span> <span class="n">proc</span> <span class="n">procedure</span><span class="p">)</span>
</code></pre></div></div> <p>The same as <code class="language-plaintext highlighter-rouge">register_hook</code>, 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 dont use “hs_*.int” scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).</p> <p>Use zero (0) as second argument to unregister hook script from current global script.</p> <p><strong>NOTE:</strong> you can hook several scripts to a single hook point, for example if its 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 <code class="language-plaintext highlighter-rouge">set_sfall_return</code>, the next script may override this value if calls <code class="language-plaintext highlighter-rouge">set_sfall_return</code> again. Sometimes you need to multiply certain value in a chain of hook scripts.</p> <p>Example: lets say we have a Mod A which reduces all “to hit” chances by 50%. The code might look like this:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">original_chance</span> <span class="o">=</span> <span class="nx">get_sfall_arg</span><span class="p">;</span>
</code></pre></div></div> <p>Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, <code class="language-plaintext highlighter-rouge">start</code> procedure will be executed in current global script. You can use all above functions like normal.</p><hr /> <h3 id="register_hook_proc"> <a href="#register_hook_proc" class="anchor-heading" aria-labelledby="register_hook_proc"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>register_hook_proc</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">register_hook_proc</span><span class="p">(</span><span class="kt">int</span> <span class="n">hookID</span><span class="p">,</span> <span class="n">proc</span> <span class="n">procedure</span><span class="p">)</span>
</code></pre></div></div> <p>The same as <code class="language-plaintext highlighter-rouge">register_hook</code>, 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!</p> <p>Use zero (0) as second argument to unregister hook script from current global script.</p> <p><strong>NOTE:</strong> you can hook several scripts to a single hook point, for example if its 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 <code class="language-plaintext highlighter-rouge">set_sfall_return</code>, the next script may override this value if calls <code class="language-plaintext highlighter-rouge">set_sfall_return</code> again.</p> <p><strong>Example:</strong> Sometimes you need to multiply certain value in a chain of hook scripts. Lets say we have a <strong>Mod A</strong> which reduces all “to hit” chances by 50%. The code might look like this:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">original_chance</span> <span class="o">=</span> <span class="nx">get_sfall_arg</span><span class="p">;</span>
<span class="nx">set_sfall_return</span><span class="p">(</span><span class="nx">original_chance</span> <span class="o">/</span> <span class="mi">2</span><span class="p">);</span>
</code></pre></div></div> <p>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:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">set_sfall_arg</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">(</span><span class="nx">original_chance</span> <span class="o">/</span> <span class="mi">2</span><span class="p">));</span>
</code></pre></div></div> <p>This basically changes hook argument for the next script. Mod B code:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">original_chance</span> <span class="o">=</span> <span class="nx">get_sfall_arg</span><span class="p">;</span>
</code></pre></div></div> <p><strong>Mod B</strong> 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 <strong>Mod A</strong> hook script:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">set_sfall_arg</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">(</span><span class="nx">original_chance</span> <span class="o">/</span> <span class="mi">2</span><span class="p">));</span>
</code></pre></div></div> <p>This basically changes hook argument for the next script. <strong>Mod B</strong> code:</p> <div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">original_chance</span> <span class="o">=</span> <span class="nx">get_sfall_arg</span><span class="p">;</span>
<span class="nx">set_sfall_return</span><span class="p">(</span><span class="nx">original_chance</span> <span class="o">*</span> <span class="mf">1.5</span><span class="p">);</span>
<span class="nx">set_sfall_arg</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">(</span><span class="nx">original_chance</span> <span class="o">*</span> <span class="mf">1.5</span><span class="p">));</span>
</code></pre></div></div> <p>So if you combine both mods together, they will run in chain and the end result will be a 75% from original hit chance (hook register order doesnt matter in this case, if you use <code class="language-plaintext highlighter-rouge">set_sfall_arg</code> in both hooks).</p> <p>The defines to use for the <code class="language-plaintext highlighter-rouge">hookID</code> are in <code class="language-plaintext highlighter-rouge">sfall.h</code>.</p><hr /> <h3 id="register_hook_proc_spec"> <a href="#register_hook_proc_spec" class="anchor-heading" aria-labelledby="register_hook_proc_spec"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>register_hook_proc_spec</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">register_hook_proc_spec</span><span class="p">(</span><span class="kt">int</span> <span class="n">hookID</span><span class="p">,</span> <span class="n">procedure</span> <span class="n">proc</span><span class="p">)</span>
</code></pre></div></div> <p>Works very similar to <code class="language-plaintext highlighter-rouge">register_hook_proc</code>, 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 <code class="language-plaintext highlighter-rouge">hs_*.int</code> 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 <code class="language-plaintext highlighter-rouge">register_hook/register_hook_proc</code> functions.</p><hr /> <h3 id="set_sfall_arg"> <a href="#set_sfall_arg" class="anchor-heading" aria-labelledby="set_sfall_arg"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_sfall_arg</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_sfall_arg</span><span class="p">(</span><span class="kt">int</span> <span class="n">argNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div> <p>Changes argument value. The argument number (argNum) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see <code class="language-plaintext highlighter-rouge">register_hook_proc</code>).</p><hr /> <h3 id="set_sfall_return"> <a href="#set_sfall_return" class="anchor-heading" aria-labelledby="set_sfall_return"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_sfall_return</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_sfall_return</span><span class="p">(</span><span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div> <p>Works the same as <code class="language-plaintext highlighter-rouge">register_hook_proc</code>, 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 <code class="language-plaintext highlighter-rouge">hs_&lt;name&gt;.int</code> 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 <code class="language-plaintext highlighter-rouge">register_hook</code> and <code class="language-plaintext highlighter-rouge">register_hook_proc</code> functions, scripts are executed in reverse order of how they were registered. <strong>The execution chain of script procedures for a hook is as follows:</strong> 1. Procedures registered with <code class="language-plaintext highlighter-rouge">register_hook</code> and <code class="language-plaintext highlighter-rouge">register_hook_proc</code> functions (executed in reverse order of registration). 2. The <code class="language-plaintext highlighter-rouge">hs_&lt;name&gt;.int</code> script. 3. Procedures registered with the <code class="language-plaintext highlighter-rouge">register_hook_proc_spec</code> function (executed in the exact order of registration).</p><hr /> <h3 id="set_sfall_arg"> <a href="#set_sfall_arg" class="anchor-heading" aria-labelledby="set_sfall_arg"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_sfall_arg</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_sfall_arg</span><span class="p">(</span><span class="kt">int</span> <span class="n">argNum</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div> <p>Changes argument value. The argument number (<code class="language-plaintext highlighter-rouge">argNum</code>) is 0-indexed. This is useful if you have several hook scripts attached to one hook point (see <code class="language-plaintext highlighter-rouge">register_hook_proc</code>).</p><hr /> <h3 id="set_sfall_return"> <a href="#set_sfall_return" class="anchor-heading" aria-labelledby="set_sfall_return"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_sfall_return</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_sfall_return</span><span class="p">(</span><span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div> <p>Used to return the new values from the script. Each time its called it sets the next value, or if youve already set all return values it does nothing.</p> </div> </div> <div class="search-overlay"></div> </div> </body> </html>
+4 -4
View File
@@ -121,7 +121,7 @@ int arg3 - 1 if the hex would normally be blocking
Obj ret0 - 0 if the hex doesn't block, or any sort of object pointer if it does
</code></pre></div></div> <h2 id="descriptionobj"> <a href="#descriptionobj" class="anchor-heading" aria-labelledby="descriptionobj"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> DescriptionObj </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_DESCRIPTIONOBJ</code> (hs_descriptionobj.int)</p> <p>Runs when using the examine action icon to display the description of an object. You can override the description text. An example usage would be to add an additional description to the item based on players stats/skills.</p> <p>Does not run if the script of the object overrides the description.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Obj arg0 - the object
int ret0 - a pointer to the new text received by using "get_string_pointer" function
int ret0 - a pointer to the new text received by using the get_string_pointer function
</code></pre></div></div> <h2 id="encounter"> <a href="#encounter" class="anchor-heading" aria-labelledby="encounter"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Encounter </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_ENCOUNTER</code> (hs_encounter.int)</p> <p>Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map. You can override the map for loading or the encounter.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int arg0 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map
int arg1 - the map ID that the encounter will load (see MAPS.h or Maps.txt)
int arg2 - 1 when the encounter occurs is a special encounter, 0 otherwise
@@ -153,7 +153,7 @@ int arg3 - 1 when wielding, 0 when unwielding
int arg4 - 1 when removing an equipped item from inventory, 0 otherwise
int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED
</code></pre></div></div> <h2 id="inventorymove"> <a href="#inventorymove" class="anchor-heading" aria-labelledby="inventorymove"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> InventoryMove </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_INVENTORYMOVE</code> (hs_inventorymove.int)</p> <p>Runs before moving items between inventory slots in dude interface. You can override the action. What you can NOT do with this hook:</p> <ul> <li>force moving items to inappropriate slots (like gun in armor slot) What you can do:</li> <li>restrict player from using specific weapons or armors</li> <li>add AP costs for all inventory movement including reloading</li> <li>apply or remove some special scripted effects depending on PCs armor</li> </ul> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int arg0 - Target slot:
</code></pre></div></div> <h2 id="inventorymove"> <a href="#inventorymove" class="anchor-heading" aria-labelledby="inventorymove"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> InventoryMove </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_INVENTORYMOVE</code> (hs_inventorymove.int)</p> <p>Runs before moving items between inventory slots in dude interface. You can override the action.</p> <p>What you can NOT do with this hook:</p> <ul> <li>force moving items to inappropriate slots (like gun in armor slot) What you can do:</li> <li>restrict player from using specific weapons or armors</li> <li>add AP costs for all inventory movement including reloading</li> <li>apply or remove some special scripted effects depending on PCs armor</li> </ul> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int arg0 - Target slot:
0 - main backpack
1 - left hand
2 - right hand
@@ -167,7 +167,7 @@ Item arg1 - Item being moved
Item arg2 - Item being replaced, weapon being reloaded, or container being filled (can be 0)
int ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)
</code></pre></div></div> <h2 id="itemdamage"> <a href="#itemdamage" class="anchor-heading" aria-labelledby="itemdamage"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> ItemDamage </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_ITEMDAMAGE</code> (hs_itemdamage.int)</p> <p>Runs when retrieving the damage rating of the players used weapon. (Which may be their fists.)</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int arg0 - The default min damage
</code></pre></div></div> <p>Notes for the event of dropping items on the ground:</p> <ul> <li>the event is called for each item when dropping multiple items from the stack</li> <li>for ammo type items, the number of dropped ammo in a pack can be found by using the <code class="language-plaintext highlighter-rouge">get_weapon_ammo_count</code> function</li> <li>for the <code class="language-plaintext highlighter-rouge">PID_BOTTLE_CAPS</code> item, the event is called only once, and the number of dropped units can be found from the value of the <code class="language-plaintext highlighter-rouge">OBJ_DATA_CUR_CHARGES</code> object field (or with the <code class="language-plaintext highlighter-rouge">get_weapon_ammo_count</code> function)</li> </ul> <h2 id="itemdamage"> <a href="#itemdamage" class="anchor-heading" aria-labelledby="itemdamage"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> ItemDamage </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_ITEMDAMAGE</code> (hs_itemdamage.int)</p> <p>Runs when retrieving the damage rating of the players used weapon. (Which may be their fists.)</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>int arg0 - The default min damage
int arg1 - The default max damage
Item arg2 - The weapon used (0 if unarmed)
Critter arg3 - The critter doing the attacking
@@ -310,7 +310,7 @@ Obj arg1 - the target object/critter
int arg2 - skill being used
int ret0 - a new critter to override the user critter. Pass -1 to cancel the skill use, pass 0 to skip this return value
int ret1 - pass 1 to allow the skill being used in combat (only for dude_obj or critter being controlled by the player)
int ret1 - pass 1 to allow the skill to be used in combat (only for dude_obj or critter being controlled by the player)
</code></pre></div></div> <h2 id="withinperception"> <a href="#withinperception" class="anchor-heading" aria-labelledby="withinperception"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> WithinPerception </h2> <p><code class="language-plaintext highlighter-rouge">HOOK_WITHINPRECEPTION</code> (hs_withinperception.int)</p> <p>Runs when checking if one critter sees another critter. This is used in different situations like combat AI. You can override the result.</p> <p><strong>NOTE:</strong> <code class="language-plaintext highlighter-rouge">obj_can_see_obj</code> calls this first when deciding if critter can possibly see another critter with regard to perception, lighting, sneak factors.<br /> If check fails, the end result is false. If check succeeds (e.g. critter is within perception range), another check is made if there is any blocking tile between two critters (which includes stuff like windows, large bushes, barrels, etc.) and if there is - check still fails.<br /> You can override “within perception” check by returning 0 or 1, OR, as a convenience, you can also override blocking check after the perception check by returning 2 instead. In this case you should add “line of sight” check inside your hook script, otherwise critters will detect you through walls.</p> <p>This is fired after the default calculation is made.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Critter arg0 - Watcher object
Obj arg1 - Target object
int arg2 - Result of vanilla function: 1 - within perception range, 0 - otherwise
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -32,14 +32,14 @@ else
X := value2;
</code></pre></div> </div> </li> </ul> </li> <li>To assign values, you can use the alternative assignment operator from <strong>C/Java</strong> instead of <strong>Pascal</strong> syntax. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>x = 5;
</code></pre></div> </div> </li> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>x := 5;
</code></pre></div> </div> </li> </ul> </li> <li>Multiple variable declaration: Multiple variables can be declared on one line, seperated by commas. This is an alterative to the ugly begin/end block, or the bulky single variable per line style. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable a, b, c;
</code></pre></div> </div> </li> </ul> </li> <li>Multiple variable declaration: Multiple variables can be declared on one line, separated by commas. This is an alternative to the ugly begin/end block, or the bulky single variable per line style. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable a, b, c;
</code></pre></div> </div> </li> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable begin a; b; c; end
</code></pre></div> </div> </li> </ul> </li> <li>Variable initialization with expressions: You can now initialize local variables with complex expressions instead of constants. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable tile := tile_num(dude_obj);
</code></pre></div> </div> </li> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable tile;
tile := tile_num(dude_obj);
</code></pre></div> </div> <p><strong>NOTE:</strong> If your expression starts with a constant (eg. <code class="language-plaintext highlighter-rouge">2 + 2</code>), enclose it in parentheses, otherwise compiler will be confused and give you errors.</p> </li> </ul> </li> <li>Hexadecimal numerical constants: Simply prefix a number with <code class="language-plaintext highlighter-rouge">0x</code> to create a hexadecimal. The numbers 0 to 9 and letters A to F are allowed in the number. The number may not have a decimal point. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a := 0x1000;
</code></pre></div> </div> </li> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a := 4096;
</code></pre></div> </div> </li> </ul> </li> <li>Increment/decrement operators: <code class="language-plaintext highlighter-rouge">++</code> and <code class="language-plaintext highlighter-rouge">--</code> can be used as shorthand for <code class="language-plaintext highlighter-rouge">+= 1</code> and <code class="language-plaintext highlighter-rouge">-= 1</code> respectively. They are mearly a syntactic shorthand to improve readability, and so their use is only allowed where <code class="language-plaintext highlighter-rouge">+= 1</code> would normally be allowed. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a++;
</code></pre></div> </div> </li> </ul> </li> <li>Increment/decrement operators: <code class="language-plaintext highlighter-rouge">++</code> and <code class="language-plaintext highlighter-rouge">--</code> can be used as shorthand for <code class="language-plaintext highlighter-rouge">+= 1</code> and <code class="language-plaintext highlighter-rouge">-= 1</code> respectively. They are merely a syntactic shorthand to improve readability, and so their use is only allowed where <code class="language-plaintext highlighter-rouge">+= 1</code> would normally be allowed. <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a++;
</code></pre></div> </div> </li> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a += 1;
</code></pre></div> </div> </li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">break</code> &amp; <code class="language-plaintext highlighter-rouge">continue</code> statements: They work just like in most high-level languages. <code class="language-plaintext highlighter-rouge">break</code> jumps out of the loop. <code class="language-plaintext highlighter-rouge">continue</code> jumps right to the beginning of the next iteration (see <code class="language-plaintext highlighter-rouge">for</code> and <code class="language-plaintext highlighter-rouge">foreach</code> sections for additional details). <ul> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>while (i &lt; N) begin
// ...
@@ -89,12 +89,12 @@ end else if tmp == ATKTYPE_KICK then begin
end else begin
display_msg("something else");
end
</code></pre></div> </div> </li> </ul> </li> <li>Empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the Fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now its always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#define my_macro diplay_msg("foo");
</code></pre></div> </div> </li> </ul> </li> <li>Empty statements in blocks are allowed: This is just a convenience to save scripters a bit of memory. Some of the macros in the Fallout headers include their own semicolons while others do not. With the original compiler you had to remember which was which, and if you got it wrong the script would not compile. Now its always safe to include your own semicolon, even if the macro already had its own. For example, this would not compile with the original sslc, but will with the sfall edition: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#define my_macro display_msg("foo");
procedure start begin
my_macro;
end
</code></pre></div> </div> <p><strong>NOTE:</strong> <strong>Does not work currently.</strong></p> </li> <li>Procedure stringify operator <code class="language-plaintext highlighter-rouge">@</code>: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceeded by <code class="language-plaintext highlighter-rouge">@</code> by a string constant. <ul> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>callbackVar := "Node000";
</code></pre></div> </div> <p><strong>NOTE:</strong> <strong>Does not work currently.</strong></p> </li> <li>Procedure stringify operator <code class="language-plaintext highlighter-rouge">@</code>: Designed to make callback-procedures a better option and allow for basic functional programming. Basically it replaces procedure names preceded by <code class="language-plaintext highlighter-rouge">@</code> by a string constant. <ul> <li>old: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>callbackVar := "Node000";
call callbackVar;
</code></pre></div> </div> </li> <li>new: <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>callbackVar := @Node000;
call callbackVar;
+2 -2
View File
@@ -3,8 +3,8 @@
</code></pre></div></div><hr /> <h3 id="get_pc_base_stat"> <a href="#get_pc_base_stat" class="anchor-heading" aria-labelledby="get_pc_base_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_pc_base_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">get_pc_base_stat</span><span class="p">(</span><span class="kt">int</span> <span class="n">StatID</span><span class="p">)</span>
</code></pre></div></div><hr /> <h3 id="get_pc_extra_stat"> <a href="#get_pc_extra_stat" class="anchor-heading" aria-labelledby="get_pc_extra_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_pc_extra_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="n">get_pc_extra_stat</span><span class="p">(</span><span class="kt">int</span> <span class="n">StatID</span><span class="p">)</span>
</code></pre></div></div><hr /> <h3 id="get_stat_max"> <a href="#get_stat_max" class="anchor-heading" aria-labelledby="get_stat_max"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_stat_max</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">get_stat_max</span><span class="p">(</span><span class="kt">int</span> <span class="n">stat</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">who</span> <span class="o">=</span> <span class="n">False</span><span class="p">)</span>
</code></pre></div></div> <ul> <li>Returns the maximum set value of the specified stat (see <code class="language-plaintext highlighter-rouge">set_stat_max</code> functions)</li> <li>who: 0 (<code class="language-plaintext highlighter-rouge">false</code>) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters</li> </ul><hr /> <h3 id="get_stat_min"> <a href="#get_stat_min" class="anchor-heading" aria-labelledby="get_stat_min"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_stat_min</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">get_stat_min</span><span class="p">(</span><span class="kt">int</span> <span class="n">stat</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">who</span> <span class="o">=</span> <span class="n">False</span><span class="p">)</span>
</code></pre></div></div> <ul> <li>Returns the minimum set value of the specified stat (see <code class="language-plaintext highlighter-rouge">set_stat_min</code> functions)</li> <li>who: 0 (<code class="language-plaintext highlighter-rouge">false</code>) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters</li> </ul><hr /> <h3 id="set_critter_base_stat"> <a href="#set_critter_base_stat" class="anchor-heading" aria-labelledby="set_critter_base_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_critter_base_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_critter_base_stat</span><span class="p">(</span><span class="n">CritterPtr</span><span class="p">,</span> <span class="kt">int</span> <span class="n">StatID</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div> <ul> <li>Returns the maximum set value of the specified stat (see <code class="language-plaintext highlighter-rouge">set_stat_max</code> functions)</li> <li>who: 0 (<code class="language-plaintext highlighter-rouge">False</code>) or omitting the argument - returns the value of the player, 1 (<code class="language-plaintext highlighter-rouge">True</code>) - returns the value set for other critters</li> </ul><hr /> <h3 id="get_stat_min"> <a href="#get_stat_min" class="anchor-heading" aria-labelledby="get_stat_min"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>get_stat_min</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">get_stat_min</span><span class="p">(</span><span class="kt">int</span> <span class="n">stat</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">who</span> <span class="o">=</span> <span class="n">False</span><span class="p">)</span>
</code></pre></div></div> <ul> <li>Returns the minimum set value of the specified stat (see <code class="language-plaintext highlighter-rouge">set_stat_min</code> functions)</li> <li>who: 0 (<code class="language-plaintext highlighter-rouge">False</code>) or omitting the argument - returns the value of the player, 1 (<code class="language-plaintext highlighter-rouge">True</code>) - returns the value set for other critters</li> </ul><hr /> <h3 id="set_critter_base_stat"> <a href="#set_critter_base_stat" class="anchor-heading" aria-labelledby="set_critter_base_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_critter_base_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_critter_base_stat</span><span class="p">(</span><span class="n">CritterPtr</span><span class="p">,</span> <span class="kt">int</span> <span class="n">StatID</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div><hr /> <h3 id="set_critter_extra_stat"> <a href="#set_critter_extra_stat" class="anchor-heading" aria-labelledby="set_critter_extra_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_critter_extra_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_critter_extra_stat</span><span class="p">(</span><span class="n">CritterPtr</span><span class="p">,</span> <span class="kt">int</span> <span class="n">StatID</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div><hr /> <h3 id="set_pc_base_stat"> <a href="#set_pc_base_stat" class="anchor-heading" aria-labelledby="set_pc_base_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_pc_base_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_pc_base_stat</span><span class="p">(</span><span class="kt">int</span> <span class="n">StatID</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
</code></pre></div></div><hr /> <h3 id="set_pc_extra_stat"> <a href="#set_pc_extra_stat" class="anchor-heading" aria-labelledby="set_pc_extra_stat"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> <strong>set_pc_extra_stat</strong> </h3> <div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">set_pc_extra_stat</span><span class="p">(</span><span class="kt">int</span> <span class="n">StatID</span><span class="p">,</span> <span class="kt">int</span> <span class="n">value</span><span class="p">)</span>
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long