GameObj

From Legends of Aria Admin and Modding Wiki
Revision as of 16:15, 29 October 2016 by Kade CS (talk | contribs) (Created page with "Game Object (GameObj) is a Dynamic object within the game that can occupy a position of the world, including a container. Game Objects are the most common of all Objects and c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Game Object (GameObj) is a Dynamic object within the game that can occupy a position of the world, including a container. Game Objects are the most common of all Objects and can have Variables and/or Modules attached to them.

A potion, a monster, a door, and a sword are all examples of GameObjs.


Object Variables

Object Variables are saved when a backup is ran. This means that after a full restart of the server, the data will persist on the GameObj.

gameObj:SetObjVar("Name", "Larry")
name = gameObj:GetObjVar("Name")
gameObj:SetObjVar("SomeObjVarNameIChose", 53.2)
aUserNum = gameObj:GetObjVar("SomeObjVarNameIChose")

You can save Numbers, Strings, Bools, and Tables in an ObjVar and can specify any String name of your choice.

Tips

Obj variables should only contain data you are try to persist, especially since reading from an ObjVar immediately after setting it will not always return the new value.