# Requiring more than one condition

I have several parts of the game I’m working on where multiple conditions or tasks need to be complete before an action takes place. This is what I have so far but I’m doing or phrasing something wrong it seems. Any ideas?

``````After inserting the Justice Tile into Slot One and inserting the Interest Tile into Slot Two:
say "The board pops open like a door, revealing a small slender box in the space behind it.";
now the Slender Box is in the location.
``````

I’ll take an educated guess. You aren’t using two conditionals, but two ‘insert’ tasks. You might try breaking it down into two statements, using appropriate ‘if’ conditions, and see if that works.

1 Like

A condition like

``````inserting the Justice Tile into Slot One
``````

means testing whether the current action meets the specified conditions. In this case, that means the noun is Justice Tile and the second noun is Slot One.

It’s not possible for the current action (a stored action that varies which serves as a global variable) to simultaneously be two different actions, so your if condition can’t ever be satisfied. Indeed, attempting to construct an if condition like that produces a problem message without a lot of detail.

What you want to do is test the world state with something like:

``````Justice Tile is in Slot One and Interest Tile is in Slot Two
``````

This condition can be used in different ways, but the easiest is probably via an Every Turn rule (see WWI 9.5 Every turn).

2 Likes

An After rule only works during that turn and it looks like you’re attempting to make a rule for two separate actions. You can also check if something has happened in the past: (untested)

``````After inserting a tile:
if we have inserted the justice tile into slot one and we have inserted the interest tile into slot two: [...]
``````

That will calculate to true if the player has inserted both tiles into the correct slots at any time during the game, even if they’ve removed them.

If your slots are containers, you can just check for the existence of the tiles:

``````After inserting a tile:
if slot one contains the justice tile and slot two contains the interest tile: [...]
``````
3 Likes

Heh. You’re getting bombarded by solutions that would work. And here’s another.

``````A tile is a kind of thing.
A slot is a kind of container.

The Justice Tile is a tile.
The Interest Tile is a tile.
Slot One is a slot.
Slot Two is a slot.
The slender box is a thing.

After inserting a tile into a slot when the Justice Tile is in Slot One and the Interest Tile is in Slot Two (this is the tile-slot rule):
move the slender box to the location of Slot One;
say "You put [the noun] into [the second noun]. The board pops open like a door, revealing a small slender box in the space behind it.".
``````
1 Like

My guess is you probably want this to work only once, rather than let the tiles and slots teleport the box to the location later, so…

``````Slender-box-has-appeared is initially false.

After inserting a tile into a slot when slender-box-has-appeared is false (this is the tile-slot rule):
say "You put [the noun] into [the second noun].";
if the Justice Tile is in Slot One and the Interest Tile is in Slot Two begin;
now slender-box-has-appeared is true;
move the slender box to the location of Slot One;
say " The board pops open like a door, revealing a small slender box in the space behind it.";
end if.
``````

[Edited: moved the `say "You put [the noun] into [the second noun].";` outside the conditional, or there wouldn’t be any message at all for the first tile in a slot.]

1 Like

Bombardment in this case is a great problem to have!!!

1 Like

And I realize you don’t even need a global variable in the likely event that the slender box is off-stage until the right tiles are in the slots and that it will remain on-stage thereafter. You could forget `slender-box-has-appeared` and go with –

``````After inserting a tile into a slot when the slender box is off-stage
``````
1 Like