Outils pour utilisateurs

Outils du site


en:objects

Add objects

In the Basic syntax, you saw that each room has a line dedicated to adding objects (as well as states and variables, which you will see later!).
If there is no object, this box contains: “|

Now we will see what to put in this line to add an object or objects.
Each object has a name, the location (a piece of furniture for example) where it is located, the description of that location, the text that appears when you pick up the object, and the description of the object
This gives us:

Object_name|Location_where_is_object|Description of where the object is (a piece of furniture or drawer for example)(1)|Text when picking up the object(2)|Description of the object(3)
  • (1) will be displayed when the player examines the location (J!look location_where_it_is
  • (2) will be displayed when the player picks up the object (j!take object_name)
  • (3) will be displayed when the player examines the object (j!look object_name)

for example:

lamp|table|A table is a piece of furniture with 4 legs... Oh there is a lamp on it!!|You pick up the flashlight|The lamp allows you to light up.

It is possible to put several objects on the same line (and therefore in the same room) by separating them with “|”. It is also possible to space out your scenario by putting one object per line, and by putting “&&” at the end of the lines to indicate to the bot that the following lines are also part of this block of objects/states/variables
for example:

lamp|table|A table is a piece of furniture with 4 legs... Oh there's a lamp on it!|You pick up the flashlight|The lamp allows you to light up.|hammer|Cabinet|An open cabinet, with a hammer in it!|You grab the hammer|The hammer is red and heavy!|&&
carrot|fridge|A fridge with a carrot in it|You pick up the carrot|An orange carrot that looks delicious!

3 objects, two on the same line (lamp and hammer), and one on the next. As the bot sees the && when it returns to the line, it will indeed consider the carrot line as part of the objects/states/variables line.

Warning: each object can only be picked up once. If a player throws away an object (throw away object), he will not be able to pick it up again in the room where this object was.
You will see in Advanced objects how to allow to put a number of copies of an object (for example 3 lamps on the table), automatically remove an object from the inventory, etc.

Find us on the discord Make&Play