I’ve been having trouble getting results to change depending on whether the player is riding an animal.
I have something written to randomly print text during certain scenes, depending on where the player is. One of those places is on a rideable animal. The code I wrote compiles fine, which I assumed meant it had the right syntax, but it doesn’t actually work — when my player is on a rideable animal, the text it prints is the “otherwise” text and not the text that should be printing on a rideable animal. Have I written this incorrectly, or is this simply not possible to do with the rideable animals extension?
Every turn when Travel is happening:
if a random chance of 1 in 4 succeeds:
if the player is in a cart:
say "[one of]The wagon rumbles and jerks beneath you.[or]You hear a wagon wheel squeak.[or]The wood of the wagon feels rough against your skin.[at random]";
otherwise if the player is on a rideable animal:
say "[one of]Stiff fur scratches at your palms.[or]The zbu's ears twitch.[at random]";
say "[one of]You hold onto the wagon edge as you walk.[or]You walk at a steady pace.[or]The wagon train keeps moving, and you jog a few steps to keep up.[at random]".
As for why this is necessary, “in”, “on”, and “carried by” are separate relationships in Inform. They represent basically the same thing, but you need to use the right preposition or it won’t work.
Normally this isn’t a problem, since it’s generally pretty clear whether something is a container, a supporter, or a person. But rideable animals are a weird case where you could plausibly be both “on” the horse or “carried by” the horse. Somewhat arbitrarily, Inform has decided to use “carried by”.
Right; I’m saying a rideable animal could plausibly be a supporter-that-acts-like-an-animal or an animal-that-acts-like-a-supporter and the choice of which way to implement it was somewhat arbitrary.
Not entirely arbitrary, but a decision had to be made there, and I could also imagine a world where rideable animal was a subkind of rideable vehicle (and thus a subkind of supporter) with rules hacks to let it work like an animal too.