Increasing score when moving the player around

Hi all. I wondered if anyone could help me with a small scoring issue.

Given the following minimal source, how do I make moving to the garden when using the portkey increment the score?

[code]Use scoring. A room can be scored or unscored.

Carry out going to a unvisited scored room:
increment the score.

Kitchen is a room. The player is in Kitchen. Dining Room is a scored room. It is north of Kitchen. Hall is a scored room. It is north of Dining Room. Garden is a scored room. It is north of Hall.

The portkey is in Dining Room.

Instead of taking the portkey:
now the player is in Garden.

If I type n / n / n I end up with three points, as entering each room increased my score. However if i go north and get the portkey, ‘teleporting’ me to the garden, I only end up with one point (for the initial northward step).

What am I doing wrong?

Well, the problem is that your rule is hooked to the going action–since the player didn’t get to the Garden by executing a going action, the rule to give them their point doesn’t fire.

One way to take care of this would be to give them the point at the moment that the room gets marked visited. This happens in a carry out looking rule (the check new arrival rule), so you could make a new carry out looking rule that runs before it:

Carry out looking when the location is an unvisited scored room: increment the score.

If you ever have “Move the player to the Garden, without printing a room description” that won’t fire, but you probably won’t want to do that with a scored room.

Thanks, Matt, that’s perfect. I thought the answer might be something along those lines but I couldn’t craft the correct query for Google to find it.

Many thanks. :slight_smile: