Choosing a value every time the player enters a room

Heya all, I’m trying to learn to use randomly selected values and coming across a lot of errors and I think it might be because I’ve not found the specific language I need to use.

I’m trying to make a scene where every time the player enters a room that has a static object that has a random interactable, that doesn’t change every turn. In my example there’s a branch and a type of bird on that branch. Here’s what I’ve been starting with:

Bird type is a kind of value. The bird types are blue, red, green, yellow, black, and tawny.
A branch is a kind of thing. A branch has a bird type.

Definition: A room is birded if it contains a branch.

	[For testing]
Every turn:
	if the location is birded:
		say "birded"

This seems to all work fine. My goal is that while the player is in the room, the bird type remains the same, can be interacted with, and won’t change unless the player leaves the room and returns or completes an task that makes the bird change - like scaring it off.

I’ve been trying to have the game randomly choose one of these bird values and apply it to the branch when the player enters but can’t seen to find the right terminology that doesn’t give me an error message. Does anyone more experienced have any suggestions?

Does something like this work?


the bower is a room.  the bower-branch is a branch in the bower.  the description of the bower-branch is "A flock of birds flit around this neat little branch - there's a [bird type of the bower-branch] one now."

before going to the bower:
	now the bird type of the bower-branch is a random bird type from blue to tawny.

1 Like

That’s excellent Mike, yeah. I was just struggling to figure out the exact terminology I needed. Thank you!

1 Like