This is an old revision of the document!


Salet unit

The SaletUnit class describes game units - portable or fixed in place.

The internal name of the unit. It's used for direct calls. Mandatory to have.

This property is used to sort the descriptions when examining the room. By default, it's 0. You can set to any number.

This property indicates whether the unit is visible when viewed from the room. By default, it's true - the unit's description in printed on ext.

This property indicates whether the unit can be taken by player. By default, it's false.

If it's true, then when this unit's link is clicked *Salet* would not call the act function. It would call the take one instead and move this unit to the player's inventory.

The name of the unit that can be seen by the player. Can be a function that returns a string, or a string.

A reaction when this unit is moved to the player's inventory.

Can be a function that returns a string, or a string.

A reaction when when this unit's link is clicked, if the unit is not portable (takeable = false).

Can be a function that returns a string, or a string.

Description of the item that is displayed each time the room (in which the unit is located) is examined.

If the description has something like this: link i.e. a text in curly braces, it would be transformed into a unit link. When this link is clicked, Salet would call act or take callback, depending on takeable property.

Can be a function that returns a string, or a string.

A description of the unit in the character's inventory after it was picked up by the player.

Can be a function that returns a string, or a string.

The name of the room where this unit is located. Always a string.

The put(location) function puts this unit in a location room and sets the location property to the name of that room.

If the room does not exist, there would appear an error in the browser's developer console.

Argument: room name. Mandatory argument.

The delete(location) function removes this unit from a location room. If the argument is omitted, it's current room.

Argument: room name, current room by default. Optional argument.

  • en/api/unit.1481875492.txt.gz
  • Last modified: 2021/01/24 10:41
  • (external edit)