Tanga wrote:
Oops - just changed it back from 'rideable animal' to 'rideable vehicle' and it works again. Must be something to do with the location of the player when riding an animal. Though 'in' doesn't work either. I kind of wanted the broom to have animal like reactions when being interacted with, but I guess it will be best to write my own exceptions to 'touch' etc.
Thanks
Does anyone know where the player is when in relation to a rideable animal?
Rideable Vehicles by Graham Nelson wrote:
Code:
A rideable animal is a kind of animal.
Therefore, since a rideable animal is defined as an animal, the player would be carried by the rideable animal. Unusually, you're not defined as "on" the rideable animal. I guess it's the same way as the player's possessions aren't "on" but "carried by" the player. In essence, the player is in the rideable animal's inventory. "In" won't work with any of them, because you're meant to be on a rideable vehicle or carried by a rideable animal. So, if you wanted to use the broom as a rideable animal, then you'd want to use something like this.
Code:
"Test"
Include Rideable Vehicles by Graham Nelson.
Check going east:
if the player is carried by the broom begin;
say "You skim through the window on the broom, your knees brushing the sides of the window.";
now the player is in the town instead;
otherwise if the window is unvisited;
now the window is visited;
say "You lean out the window. It's a long way down. Your head spins and to save yourself you grab hold of the ledge." instead;
otherwise;
say "Seeing no other alternative you climb up onto the edge. You spring out and away from the window. Just you and the sky. Then the ground.";
end the story saying "You have died." instead;
end if.
The Testing Room is A Room. The Window is east of The Testing Room. The Town is east of The Window. The broom is a rideable animal in the testing room.
Test me with "e / enter broom / e".
Hope this helps.