TRIG-SET

From 4Dimensions
Revision as of 11:27, 14 July 2017 by Loran (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

TRIG-SET

Usage: set <variable> <value>


Set sets variable to value, without evaluating it.

Example: set foobar 15 - 5

sets the variable foobar to the string "15 - 5"


  • this example sets the value of result to '%self.hitp% * 100 / %self.maxhitp%'

set result %self.hitp% * 100 / %self.maxhitp%

  • The %result% var now works as a 'function' every time it's accessed.

say My hitpoint percentage is %result% %damage% %self% 30

say My hitpoint percentage is %result%


The set command is used to set (or create) the specified variable equal to

the provided expression, which will be evaluated when the variable is accessed.

There also exists an "eval" command, with the same syntax. Eval differs in that

the expression is evaluated immediately.


See Also: EVAL