Objects

Objects are ASCII characters that can be inserted into the game world or the player's inventory. Everything you see and interact with in an AsciiMason game is an object. Objects are based on object templates. To modify attributes like an object's color, character, font, or functions, you will have to modify the object template, not the object itself. Every object in the world has a unique ID for referencing in commands.

Paint objects into the game world

 * 1) Switch to edit mode. See How to create an AsciiMason game
 * 2) Click the cursor button in the upper right corner. Change it to "cursor:paint".
 * 3) Use the left and right arrow buttons under the cursor button (OR the Z and X keys) to select which object template you're painting.
 * 4) Click the layer button in the upper right corner to change which layer you are painting into. See Layers.
 * 5) Click and drag anywhere in the game window to paint an object there.
 * 6) To stop painting, press the cursor button until it reads "cursor:none".

Erase objects

 * 1) Click the cursor button in the upper right corner. Change it to "cursor:erase"
 * 2) Click the layer button in the upper right corner to change which layer you are erasing in. See Layers.
 * 3) Click and drag anywhere in the game window to erase objects there.
 * 4) If the object is not being erased, you are erasing in the wrong layer. Press the layer button to change which layer you're in. See Layers.
 * 5) To stop erasing, press the cursor button until it reads "cursor:none".

See an object's ID

 * 1) Hover over an object with your cursor. In the upper right corner, text will appear with the object's ID and the name of the object template it uses.
 * 2) If you don't see this text appear, your cursor is in the wrong layer. Press the layer button to change which layer you're in. See Layers.

Move an object

 * 1) In the >> command window, select Object commands > Individual object commands > Move object.
 * 2) Replace these placeholders:
 * 3) * Integer. The ID of the object you wish to move
 * 4) *  String. The name of the layer you wish to move this object to. (Do not remove the 'apostrophes')
 * 5) *  Integer. The x coordinate you wish to move this object to.
 * 6) *  Integer. The y coordinate you wish to move this object to.

Reference an object by its ID

 * 1) In the >> command window, select Object commands > Individual object commands > Reference an object > Reference object by ID.
 * 2) Replace these placeholders:
 * 3) * Integer. The ID of the object you wish to reference
 * 4) The command above searches for the object with the ID you inputted and creates a READ-ONLY variable called myObject. myObject has several attributes you can use:
 * 5) * The x coordinate of the object you referenced
 * 6) *  The y coordinate of the object you referenced
 * 7) *  The name of the layer the object lives in
 * 8) *  The name of the object template the object uses.
 * 9) *  The unique ID of the object
 * 10) Important note: myObject is READ-ONLY. That means that you cannot modify the object you referenced by modifying myObject. For example, you cannot change the x-coordinate of an object to by executing . To move an object, you must use   (see above). However, you can use   to get the x-coordinate of the object.
 * 11) To actually modify the object with a command such as  or , simply use   as the argument.

More...
For more commands relating to individual objects, browse the >> command window.

Attributes
Note that individual objects do not have an x, y coordinate attribute or a layer attribute like the player does. This is because of the way AsciiMason stores objects. See Structure of the Game World.

You never need to reference these attributes in Javascript commands. They are just here for context, so you can see that an object does not store its own position.

name
String. The name of the object template that this object follows.

id
Integer. The unique ID of this object. Objects can be referenced by ID by opening the >> command window and selecting Object commands > Individual object commands > Reference an object > Reference object by ID.