Problem with instead or check rules

I suggested something about this a couple of days ago, but somehow my suggestion got deleted. Have you checked the code that creates exits for the room where Sam is?

You might have written an “instead of going south” rule for that room that is incorrectly structured.

Here is that code:

[/code]

[code]Instead of going south when player is in Hallway:
if Sam Phil carries fifty-dollar bill:
continue the action;
otherwise:
say “[’]You here again?[’] Sam says. [’]You got the money?[’]”;

That looks okay, in itself … but it isn’t actually the code that specifies what happens when the player DOES go south. We need to know what happens if “continue the action” is the result of the Instead rule. What are the map connections? In other words, how are the rooms themselves defined? I still think that’s the key to the problem. I could be wrong – I just want to rule that out before looking deeper.

There is A Street, which is north of Hallway (and studio door), which is north of recording studio. I think you may be right, but I just don’t see how the player keeps ending up in A Street.

Check to see if the fifty dollar bill has left your inventory. If so, that part worked.

You need to manually move the player south since you’ve already intercepted “Instead of Going South” in another rule (it sounds like). And it sounds like your’e checking for the fifty in that rule where this one has already taken it from him.

This is probably a lot simpler than you are making it.

[code]“Going South for Money”

Street is a room. “The movie theater is south.” Ticket Booth is south of Street. Movie Theater is south of Ticket Booth.

The player carries fifty bucks.

Sam is a man in ticket booth. “Sam awaits payment for a ticket to enter the movie theater to the south. A sign in the window says ‘All seats fifty bucks’. The street is back to the north.”

A movie ticket is a thing.

Sampaid is a truth state that varies.

Check going south from ticket booth:
if Sampaid is false:
say “‘Hey!’ Sam says, 'You need to give me fifty bucks first!” instead.

Instead of giving fifty bucks to sam:
say “‘Hey, thanks man, here’s your ticket!’”;
now the player carries movie ticket;
now fifty bucks is off-stage;
now sampaid is true.

[Previous rule - since “fifty bucks” is a single object there’s no problem if the player tries it again - the rule will fail “You can’t see any such thing” since the fifty bucks doesn’t exist anymore. If we put the fifty bucks in Sam’s inventory, it might try to take it and give you “That seems to belong to Sam.” as an error. If you have other money in the world…say “fifty bucks” is a kind and there are several of them and the player has two of them, you would need to account for that, such as with another rule:

Instead of giving fifty bucks to sam when sampaid is true:
say “Are you trying to pay me twice? Get out of here!”

]

Every turn when the location is Movie Theater:
end the story finally saying “Ah, you’ve been waiting months to finally see GIGLI. This should be good.”[/code]

You could also block the player from going south if they don’t have the movie ticket. There’s not a lot of reason to confuse going south with paying the fifty bucks.

After a couple of days of rest, I am back programming, and still having the same problem: instead of going south from a room called Hallway into a room called Studio, whenever the player is in Hallway and types “s”, he ends up back in a room north of Hallway.

Here is the code that mentions Hallway:

[code]The description of Hallway is “You admire the portraits of all the million-selling artists who got their starts here: Blind Jeffy Melonboy, Hillbilly Hank, Alvin Parsely. You look forward to the day when your own portrait hangs beside them.”

The studio door is a closed openable door. It is south of A Street and north of Hallway.

Check going south when player is in Hallway:
if fifty-dollar bill is off-stage:
continue the action;
otherwise:
say “[’]You here again?[’] Sam says. [’]You got the money?[’]”;
stop the action.

The studio is south of Hallway.

Portraits are a thing in Hallway.[/code]

Odder and odder.

I changed the code thusly:

Instead of going south when player is in Hallway: if fifty-dollar bill is off-stage: now player is in studio; otherwise: say "[']You here again?['] Sam says. [']You got the money?[']"; stop the action.

and now the player seems stuck in the hallway.

Transcript:

give fifty-dollar bill to sam
Sam eagerly accepts the money.
‘Great!’ he says. ‘Now we can pay the rent and get this thing on wax!’
You aren’t holding the fifty-dollar bill.

You really should do something, man.

s
Hallway (in the studio door)
You admire the portraits of all the million-selling artists who got their starts here: Blind Jeffy Melonboy, Hillbilly Hank, Alvin Parsely. You look forward to the day when your own portrait hangs beside them.

You can see Sam Phil and Portraits here.

In the studio door you can see Microphone.

Mickey says it’s getting late. What’cha gonna do about it?

s
You would have to get out of the studio door first.

If you’re waiting for Elvis to call, forget it and do something useful instead.

l
Hallway (in the studio door)
You admire the portraits of all the million-selling artists who got their starts here: Blind Jeffy Melonboy, Hillbilly Hank, Alvin Parsely. You look forward to the day when your own portrait hangs beside them.

You can see Sam Phil and Portraits here.

In the studio door you can see Microphone.

There’s a whole lot of movin’ goin’ on. Be a part of it.

s
You would have to get out of the studio door first.

I’m all ears!

l
Hallway (in the studio door)
You admire the portraits of all the million-selling artists who got their starts here: Blind Jeffy Melonboy, Hillbilly Hank, Alvin Parsely. You look forward to the day when your own portrait hangs beside them.

You can see Sam Phil and Portraits here.

In the studio door you can see Microphone.

Try renaming the studio to “the recording studio”, Inform is reading studio as the studio door.

Taaaaa-Daaaaaaaa!

That did it! Thanks, Unreluctance, and everybody else!