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

NAME

From Creatures Wiki
Jump to navigation Jump to search

NAME is a 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]