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

Difference between revisions of "AVAR"

From Creatures Wiki
Jump to navigation Jump to search
(Added AVAR page, with (not very good) explanation on how to implement arrays)
 
Line 45: Line 45:
 
AVAR VA00 00
 
AVAR VA00 00
 
</pre>
 
</pre>
 +
 +
==External links==
 +
*[https://web.archive.org/web/20160709010937/http://armaina.com/xan/creatures/caos_vars.html Variable types] (includes some information on AVAR)
  
 
[[Category:C3 CAOS Commands]]
 
[[Category:C3 CAOS Commands]]

Revision as of 02:29, 26 September 2016

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.

Command

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

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

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