Not understanding commands on rooms/items

29 views
Skip to first unread message

Quilnux

unread,
Feb 12, 2021, 9:41:26 AM2/12/21
to Evennia
Ok, so I was reading the train tutorial which has commands for putting a character on a train and getting them back off again. Understand so far. However, the tutorial talks about being sure the character cannot get on the train when it's already on, and it looks like the CmdSet is attached to the room, yet somehow the character can access this? Is this a parent/child relationship? Such as, when a character (child) is in a room (parent) they inherit the parent's CmdSet?

Or am I misunderstanding this?

Griatch Art

unread,
Feb 12, 2021, 10:27:08 AM2/12/21
to Evennia
I think the confusion is that both the enter/leave commands sit on the TrainCmdset - so they are on the train, not on the room. You can see it added the the TrainObject in the example just after the cmdsets are explained.

Generally ...
  • You have access to cmdsets on yourself ...
  • Cmdsets of objects in your inventory ...
  • Cmdsets on your current location ...
  • and Cmdsets of objects in your current location
So in this case you will have access to enter also when you are on the train already (because you are in a location - the train - which has this command). Conversely you will have access to leave also when you are standing outside the train, because you have access to the command on the train (an object in this room). The tutorial explains how you can lock down those commands so that they are only available when it makes sense.

Hope that helps!
.
Griatch


Kovitikus

unread,
Feb 12, 2021, 10:28:25 AM2/12/21
to Evennia
All commandsets on objects and rooms, specific to those objects, are available in the general area to a character. Evennia then determines which commandsets are of the proper permissions for the character and then merges them into a master commandset at that given moment.

Quilnux

unread,
Feb 12, 2021, 1:36:43 PM2/12/21
to Evennia
Mind blown... nice! Thanks..
Reply all
Reply to author
Forward
0 new messages