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

Difference between revisions of "Object Variables"

From Creatures Wiki
Jump to navigation Jump to search
(Added warning about storing agent references in OBVx variables in C1)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
'''Object Variables''' are [[variable]]s used to store information about a particular [[agent]].
 
'''Object Variables''' are [[variable]]s used to store information about a particular [[agent]].
  
There are various [[CAOS]] commands to access/change them, '''OBVx''' (used in C1 and C2) and '''OVxx''' (C2 and above), for accessing the variables of [[TARG]], and '''MVxx''' (C3 and above) for accessing the variables of [[OWNR]], where 'x' is replaced by a number (for example, OBV1 for variable 1, or OV12 for variable 12). Creatures 1 has 10 of them, 0 to 9, and the other games have 100, from 0 to 99.
+
There are various [[CAOS]] commands to access/change them, '''OBVx''' (used in C1 and C2) and '''OVxx''' (C2 and above), for accessing the variables of [[TARG]], and '''MVxx''' (C3 and above) for accessing the variables of [[OWNR]], where 'x' is replaced by a number (for example, OBV1 for variable 1, or OV12 for variable 12). Creatures 1 has 3 OBVx variables, 0 to 2, with C2 having 10 OBVx variables, 0 to 9. C2 and the other games have 100 OVxx variables, from 0 to 99.
  
When a script begins running, they are initially all 0 (integer type), but can be assigned any value. Any value!  
+
When a script begins running, they are initially all 0 (integer type), but can be assigned any value in C2e, and integer or agent in C1 and C2, though agent references in OBVx variables in C1 become invalid on game close, and can crash a game when used after restart.
  
 
{{stub}}
 
{{stub}}
  
 
==External Links==
 
==External Links==
*[http://www.gamewareeurope.com/GWDev/cdn/cdn_more.php?CDN_article_id=7 C3 permanent variable usage] at the [[CDN]] - partial list of typical usages of object variables in C3.
+
*[https://web.archive.org/web/20100103112913/http://www.gamewaredevelopment.co.uk:80/cdn/cdn_more.php?CDN_article_id=7 C3 permanent variable usage] at the [[CDN]] - partial list of typical usages of object variables in C3.
*[http://creatures.treesprite.com/Slink11.html Slink's COB Author's Guide]
+
*[https://web.archive.org/web/20200116112051/http://creatures.treesprite.com/Slink11.html Slink's COB Author's Guide]
*[https://web.archive.org/web/20160709010937/http://armaina.com/xan/creatures/caos_vars.html Variable types] (includes some information on object variables)
+
*[http://armaina.com/xan/creatures/caos_vars.html Variable types] (includes some information on object variables)
 
[[category:C3 CAOS Commands]]
 
[[category:C3 CAOS Commands]]

Revision as of 21:09, 2 December 2022

Object Variables are variables used to store information about a particular agent.

There are various CAOS commands to access/change them, OBVx (used in C1 and C2) and OVxx (C2 and above), for accessing the variables of TARG, and MVxx (C3 and above) for accessing the variables of OWNR, where 'x' is replaced by a number (for example, OBV1 for variable 1, or OV12 for variable 12). Creatures 1 has 3 OBVx variables, 0 to 2, with C2 having 10 OBVx variables, 0 to 9. C2 and the other games have 100 OVxx variables, from 0 to 99.

When a script begins running, they are initially all 0 (integer type), but can be assigned any value in C2e, and integer or agent in C1 and C2, though agent references in OBVx variables in C1 become invalid on game close, and can crash a game when used after restart.

Editnorn.png This stub could use more information.

External Links