Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "NAME"

From Creatures Wiki
Jump to navigation Jump to search
(oops!)
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''NAME''' is a [[CAOS]] command which allows access to named [[local variables]].
+
'''NAME''' is a DS-only  [[CAOS]] command which allows access to named [[local variables]].
  
 
==Usage==
 
==Usage==
Line 6: Line 6:
 
This returns the target agent variable referred to by ''varname''. ''varname'' may be anything at all - integer, string, agent, etc.
 
This returns the target agent variable referred to by ''varname''. ''varname'' may be anything at all - integer, string, agent, etc.
  
NAME variables are effectively named [[OV''xx''|OVxx]] variables.
+
NAME variables are effectively named [[OVxx|OV''xx'']] variables.
  
 
==Examples==
 
==Examples==
Line 17: Line 17:
 
</pre>
 
</pre>
 
and so on.
 
and so on.
 +
 +
The names and results of the named variables can be anything, even the value of another variable.
 +
<pre>
 +
SETS NAME "Creature" "A norn"
 +
SETS va00 "variable1"
 +
SETV NAME va00 9
 +
SETS NAME 800 "Eight hundred"
 +
SETA ov00 NORN
 +
SETA NAME "myCreature" ov00
 +
</pre>
 +
 +
==Bugs==
 +
 +
If you alter/check the unnamed NAME variable (NAME ""), the [[NAMN]] function stops working for this agent. Any set named variables will not disappear, but NAMN won't be able to find any named variables for this agent.
 +
Getting the [[TYPE]] of the NAME "" variable will return 0. This also breaks the NAMN function.
 +
<pre>
 +
OUTV TYPE NAME ""
 +
    0
 +
</pre>
  
 
==See also==
 
==See also==
Line 23: Line 42:
 
*[[MAME]] and [[GAME]], the other named variables
 
*[[MAME]] and [[GAME]], the other named variables
  
[[Category:C3 CAOS Commands]]
+
==External links==
 +
*[http://armaina.com/xan/creatures/caos_vars.html Variable types] (includes some information on NAME)
 +
 
 +
[[Category:DS CAOS Commands]]

Latest revision as of 06:44, 10 September 2022

NAME is a DS-only CAOS command which allows access to named local variables.

Usage[edit]

Syntax: NAME varname (anything)

This returns the target agent variable referred to by varname. varname may be anything at all - integer, string, agent, etc.

NAME variables are effectively named OVxx variables.

Examples[edit]

Assuming a Creature is selected:

SETV NAME NORN 42
DIVV NAME NORN 6
OUTV NAME NORN
    7

and so on.

The names and results of the named variables can be anything, even the value of another variable.

SETS NAME "Creature" "A norn"
SETS va00 "variable1"
SETV NAME va00 9
SETS NAME 800 "Eight hundred"
SETA ov00 NORN
SETA NAME "myCreature" ov00

Bugs[edit]

If you alter/check the unnamed NAME variable (NAME ""), the NAMN function stops working for this agent. Any set named variables will not disappear, but NAMN won't be able to find any named variables for this agent. Getting the TYPE of the NAME "" variable will return 0. This also breaks the NAMN function.

OUTV TYPE NAME ""
    0

See also[edit]

  • OVxx, the numbered target agent variables
  • NAMN, which loops over NAME variables
  • MAME and GAME, the other named variables

External links[edit]