Difference between pages "TRIGEDIT-OBJ-COMMAND TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND" and "EXPRESSIONS TRIGEDIT-EXPRESSIONS INCREMENTS MATHEMATICAL /="

From 4Dimensions
(Difference between pages)
Jump to: navigation, search
(Bot: Automated import of articles)
 
m
 
Line 1: Line 1:
'''TRIGEDIT-OBJ-COMMAND TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND'''
+
'''EXPRESSIONS TRIGEDIT-EXPRESSIONS INCREMENTS MATHEMATICAL /= || \'''
 
[[Category:Help Files]]
 
[[Category:Help Files]]
 +
[[Category:Building]]
  
TRIGEDIT-OBJ-COMMAND TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND
+
A false expression is any expression that evaluates to 0, or an empty string.
  
TRIGEDIT-OBJ-COMMAND TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND
+
A true expression is any expression that evaluates to anything other than a
  
TRIGEDIT-OBJ-COMMAND TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND
+
false expression. The following list are the recognized operators. The higher
  
 +
the operator is on the list, the higher the precedence. The expression is
  
 +
evaluated from left to right. Parenthesis can be used to group.
  
Activates when commands are performed in the same room as the object.
 
  
This does not work for level 32 and above.
+
<pre>
 +
|Operator|        Name          | Examples  0=False 1=True  |
 +
--------------------------------------------------------------
  
 +
|  ||  | logical or            | 0 || ( ) = 0; 5 || 0 = 1  |
  
 +
|  &&  | logical and          | 1 && 0 = 0; 5 && 3 = 1    |
  
Numeric Arg : a bitfield to indicate where the object must be in order to cause
+
|  ==  | equivalence          | 5 == 3 = 0; dog == DoG = 1|
  
the trigger to activate.
+
|  !=  | inequality            | 0 != Z = 0; dog != d = 1  |
  
Bits: 1: In character's worn equipment.
+
|  <    | less than            | 4 < 3 = 0; 4 < 5 = 1     |
  
2: In character's carried inventory.
+
|  >    | greater than          | 4 > 3 = 1; 4 > 4 = 0      |
  
4: In same room with the character.
+
|  <=  | less than or equal    | 4 <= 3 = 0; 4 <= 5 = 1    |
  
These bits can be set at once by adding the values.
+
|  >=  | greater than or equal | 4 >= 3 = 1; 4 >= 4 = 1    |
  
7= worn, inv, room. 3 = worn, inv. 5 = worn, room.
+
|  /=   | substring            | "concatenate" /= "cat"    |
  
Argument   : text which must be part of the command typed to filter out
+
|  -   | subtraction          | 15 - 10 = 5              |
  
uninteresting commands.
+
|  +    | addition              | 10 + 15 = 25              |
  
 +
|  *    | multiplication        | 10 * 20 = 400            |
  
 +
|  /    | division              | 100 / 20 = 5              |
  
If 0 is returned by the trigger, character will receive the same message as
+
|  !    | negation              | !() = 1; !0 = 1; !dog = 0;|
  
if the trigger did not exist, and any other command triggers will be checked.
+
--------------------------------------------------------------
 +
</pre>
  
  
 
+
Example: {cRTSTAT 63{c0
Variables:
 
 
 
%actor% - the character issuing the command
 
 
 
%cmd%  - the exact command (without arguments) issued
 
 
 
%arg%  - the arguments, if any, following the command
 
 
 
 
 
 
 
Example: {cRTSTAT 81{c0
 

Latest revision as of 12:25, 14 July 2017

EXPRESSIONS TRIGEDIT-EXPRESSIONS INCREMENTS MATHEMATICAL /= || \

A false expression is any expression that evaluates to 0, or an empty string.

A true expression is any expression that evaluates to anything other than a

false expression. The following list are the recognized operators. The higher

the operator is on the list, the higher the precedence. The expression is

evaluated from left to right. Parenthesis can be used to group.


|Operator|         Name          | Examples  0=False 1=True  |
--------------------------------------------------------------

|   ||   | logical or            | 0 || ( ) = 0; 5 || 0 = 1  |

|   &&   | logical and           | 1 && 0 = 0; 5 && 3 = 1    |

|   ==   | equivalence           | 5 == 3 = 0; dog == DoG = 1| 

|   !=   | inequality            | 0 != Z = 0; dog != d = 1  | 

|   <    | less than             | 4 < 3 = 0; 4 < 5 = 1      |

|   >    | greater than          | 4 > 3 = 1; 4 > 4 = 0      |

|   <=   | less than or equal    | 4 <= 3 = 0; 4 <= 5 = 1    |

|   >=   | greater than or equal | 4 >= 3 = 1; 4 >= 4 = 1    |

|   /=   | substring             | "concatenate" /= "cat"    |

|   -    | subtraction           | 15 - 10 = 5               |

|   +    | addition              | 10 + 15 = 25              |

|   *    | multiplication        | 10 * 20 = 400             |

|   /    | division              | 100 / 20 = 5              |

|   !    | negation              | !() = 1; !0 = 1; !dog = 0;| 

--------------------------------------------------------------


Example: {cRTSTAT 63{c0