Questions about conditions involving rideable animals?

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]";
		otherwise:
			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]".
4 Likes

Try “otherwise if the player is carried by a rideable animal” (I thought your code should work, but did a test and SHOWME ME indicated the carried by relation was happening).

EDIT: Ninja’d, as always Zed’s response is the more comprehensive.

2 Likes

and yet lazier, being just copy-pasting a URL to a thread where other people did the heavy lifting. :grinning:

1 Like

That makes it even more impressive, in a wu wei/action without action sort of way!

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”.

2 Likes

Thanks, all!

Not entirely arbitrarily, since things can only be in rooms or containers; on supporters; or carried by persons- and in Inform a thing can only be one of a room, container, supporter or person.

The carried relationship therefore becomes inevitable as soon as it is decided that a rideable animal is… well, an animal… and therefore a person and not a supporter or container.

Analagously, since in Inform a vehicle is a kind of container, someone riding a motorcycle will be in it, not on it or carried by it.

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.

2 Likes