Separate Scenes/Rooms

My story contains 2 scenes, each are in a different room. The scenes both begin and end at certain times and contain the same objects.

The scenes/rooms keep mixing up together so when you try to touch something in scene 1 it will give you the response for scene 2.

Any ideas? Thank you!

This is what makes writing IF fun (not). There are lots of weird ways this could happen. You need to get very meticulous about troubleshooting your code.

Turn on the actions and rules while running your game. Turn on scenes as well. This will give you more information. Try commenting out sections until the problem goes away.

The situation is probably that both scenes are running at the same time. As Jim suggested, you can type ACTIONS in the game to see which scenes are running at a given moment. If you want each scene to run only when the player is in a certain room, there’s probably something missing from the scene ending rules that would stop the scene when the player leaves the room.

Does it have to be the same objects each time?

I don’t know how much you’ve got set up, and how much trouble it would be to rewrite vs. fix, but one option I might look at would be having privately named objects. (The before_chair is a privately named object in Room One. The printed name of the before_chair is “chair”. The after_chair is a privately named object in Room Two.)

Because the objects would be privately named, the player would never notice a difference, and you could give each of them their own descriptions. The only transitions you’d need to write would be when one has a state that needs to be transferred; if you have a box in the first scene, and the PC puts in an apple, do you want the apple to show up in the second scene? If so, you’d need to transfer it.

Depends on the exact situation, obviously, but I prefer having one virtual object per actual game world object whenever possible. With the same effort as making two objects you can just as well give the one object a property, like “the chair can be intact or broken”, and refer to it as the intact chair or the broken chair (instead of using separate broken_chair and intact_chair objects). You can then refer to it as “chair” when the state doesn’t matter (and therefore don’t have to write rules that apply to both broken_chair and intact_chair).