diff --git a/alter-min-max/index.html b/alter-min-max/index.html index 6fc3a4c1..cd6d892e 100644 --- a/alter-min-max/index.html +++ b/alter-min-max/index.html @@ -1,4 +1,4 @@ - Alter min/max | sfall Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Alter min/max

The set_stat_max/min functions can be used to set the valid ranges on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only affects the player, the set_npc_ functions only affects other critters, and the set_ functions affects both.

Functions


set_npc_stat_max

void set_npc_stat_max(int stat, int value)
+             Alter min/max | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Alter min/max

The set_stat_max/min functions can be used to set the valid ranges on stats. Values returned by get_current_stat will be clamped to this range. The set_pc_ function only affects the player, the set_npc_ functions only affects other critters, and the set_ functions affects both.

Functions


set_npc_stat_max

void set_npc_stat_max(int stat, int value)
 

set_npc_stat_min

void set_npc_stat_min(int stat, int value)
 

set_pc_stat_max

void set_pc_stat_max(int stat, int value)
 

set_pc_stat_min

void set_pc_stat_min(int stat, int value)
diff --git a/animations/index.html b/animations/index.html
index b6e61722..598ea0cd 100644
--- a/animations/index.html
+++ b/animations/index.html
@@ -1,4 +1,4 @@
-             Animations | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Animations

Functions


reg_anim_animate_and_hide

void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay)
+             Animations | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Animations

Functions


reg_anim_animate_and_hide

void reg_anim_animate_and_hide(ObjectPtr, int animID, int delay)
 

Works exactly like reg_anim_animate but the object will automatically disappear after the last animation frame (but not destroyed).

  • delay: delay from the previous animation. A value of -1 will execute the specified animation immediately after the previous one in the sequence ends.

reg_anim_animate_and_move

sfall.h

void reg_anim_animate_and_move(ObjectPtr, int tile, int animID, int delay)
 

Plays the specified animation while simultaneously moving the object to the given tile.

  • delay: delay from the previous animation. A value of -1 will execute the specified animation immediately after the previous one in the sequence ends.

reg_anim_callback

void reg_anim_callback(procedure proc)
 

Adds the given procedure to an animation sequence-list and executes it in the registered sequence.


reg_anim_change_fid

void reg_anim_change_fid(ObjectPtr, int FID, int delay)
diff --git a/array-functions/index.html b/array-functions/index.html
index 356bffda..41ec7902 100644
--- a/array-functions/index.html
+++ b/array-functions/index.html
@@ -1,4 +1,4 @@
-             Array functions | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Array functions

Functions


array_key

mixed array_key(int arrayID, int index)
+             Array functions | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Array functions

Functions


array_key

mixed array_key(int arrayID, int index)
 

Don’t use it directly; it is generated by the compiler in foreach loops.

  • for lists, returns index back (no change).
  • for maps, returns a key at the specified numeric index (don’t rely on the order in which keys are stored though).
  • can be checked if given array is associative or not, by using index (-1): 0 - array is list, 1 - array is map.

arrayexpr

int arrayexpr(mixed key, mixed value)
 

Don’t use it directly; it is used by compiler to create array expressions.

  • assigns value to a given key in an array, created by last create_array or temp_array call.
  • always returns 0.

create_array

int create_array(int size, int nothing)
 

Creates permanent array (but not “saved”).

  • if size >= 0, creates list with given size.
  • if size == -1, creates map (associative array).
  • 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.
  • returns array ID (valid until array is deleted).

fix_array

void fix_array(int arrayID)
diff --git a/arrays/index.html b/arrays/index.html
index e0bc9719..75817043 100644
--- a/arrays/index.html
+++ b/arrays/index.html
@@ -1,4 +1,4 @@
-             Arrays | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Arrays

sfall introduces new method of storing variables - arrays.

Array is basically a container which can store variable number of values (elements). Each element in array can be of any type. Arrays can be extremely useful for some more advanced scripting, in conjunction with loops. See array function reference here.

Arrays concept

Array elements are accessed by index or key. For example:

// this code puts some string in array "list" at index 5:
+             Arrays | sfall                        Skip to main content   Link      Menu      Expand       (external link)    Document      Search       Copy       Copied        

Arrays

sfall introduces new method of storing variables - arrays.

Array is basically a container which can store variable number of values (elements). Each element in array can be of any type. Arrays can be extremely useful for some more advanced scripting, in conjunction with loops. See array function reference here.

Arrays concept

Array elements are accessed by index or key. For example:

// this code puts some string in array "list" at index 5:
 list[5] := "Value";
 

There are 2 different types of arrays currently available: