Welcome to the Creatures Wiki! Log in and join the community.
AVAR
Jump to navigation
Jump to search
AVAR | ||
---|---|---|
This article is about a CAOS command or function. | ||
Category | Variables | |
Version | CV/C3/DS | |
Command | ||
Parameters | agent (agent) index (integer) | |
Function | ||
Parameters | ||
Return type | [[CAOS types|]] | |
Related | ||
CAOS | TARG | |
Concepts | Object_Variables |
AVAR returns an object variable from the agent, without having to set TARG.
Contents
Command[edit]
Syntax: AVAR AGENT(agent) nn(integer)
Returns the OVnn variable of AGENT. It is equivalent to TARG AGENT, OVnn, but you don't need to target it first. You can also use AVAR to create simple arrays.
Arrays[edit]
While you cannot do
TARG VA00 OVVA01
to get an object variable depending on what another variable is, you can do
AVAR VA00 VA01
This is how a simple array can be implemented.
- Archengule: This is confusing. Can anybody else explain it better?
Example[edit]
This code gets an object variable the typical way, TARGing the agent first: (VA00 is an agent)
TARG VA00 OV00
This code gets the object variable using AVAR: (Again, VA00 is an agent)
AVAR VA00 00
External links[edit]
- Variable types (includes some information on AVAR)