In my game I’ve set up the following adjectives for my rooms:
A room can be superrocking, rocking or verboten. A room is usually superrocking.
Now, I have a movement rule for moving people around. It includes the following line:
let target_room be a random rocking room that is adjacent to current actor;
- where current act is a person who varies.
When I first tested the movement rule, it crashed the game with a runtime error and talk of my interacting with ‘nothing’ variables. So I had the game print out the values of ‘target_room’ and ‘current_actor’ during the rule for test purposes, and I discovered that ‘target_room’ was not being set - its contents were ‘nothing’.
I then discovered that if I removed one of the three elements from the movement rule, it worked.
The elements are 1. random 2. rocking 3. adjacent-ness
So I could specify a random rocking room, or a random adjacent room etc., but not a random rocking room also adjacent to the actor.
How can I express that I want to randomly select a room adjacent to the current actor, and that it must be ‘rocking’? (note that this is always physically possible, no matter where the actor is)