A choice that moves the player. SOLVED.

Hello everyone. I’m Rejera and I JUST got into interactive fiction. I’m actually developing one for a friend for his birthday, as when we were younger, we used to have similar pen and paper adventures. So, I decided to write an IF in the style of what we used to have for his birthday. SO, time is short. My quick question is, I am trying to present the player a question that moves the player depending on the answer given… I just have no idea how to do this as it seems whenever I put “If player consents, move player to (The name of the room).” Inform doesn’t like it. (I’m using version 6g60 if that matters.) Any suggestions? Thank you in advance!

I know this isn’t an answer to the question you actually asked (sorry, I’m short on time) but if you’re in a real hurry and the structure of your game is more choice-based than not, you might like Twine for this project: twinery.org/

You’d need to show more of your code or at least the exact error message for a definitive answer, but the most common problem is that the if phrase isn’t inside a rule so Inform doesn’t know when to ask the question from the player. For example:

When play begins:
    say "Do you want to go to the park?";
    if player consents, move player to the park.

(“move … to” is ok to use for changing object locations.)

I’m trying to set it up that the player is presented with the choice at the start of a scene. So it should say something like:

When The Path (name of scene) starts:
Say “do you agree with Samuel?”
If player consents, move player to The Deep Woods.
Otherwise, move player to Castle Entrance.

I get an “inform doesn’t know what to do with this sentence as it doesn’t see a verb it recognizes.” Error with the “move player” line. It might be that I didn’t give it a time to start, as I only recently came up with the idea to start a scene when the player gets there. I’ll try that and see if it works. Thanks for the help.

You need semicolons after the last three lines. A period ends the rule.

EDIT: Also, when posting code to the forums, wrapping it in [ code ] tags means the indentation won’t be messed up. That can make it a lot easier to diagnose problems.

Ok, I think I’m almost there. I have

When The Path Starts: Say "Do you follow Salase and take the safe path?"; if player consents, now the player is in The Deep Woods; Otherwise, now the player is in Castle Town Entrance.

It has no problem with the first line (If the player consents…) but it doesn’t like “Otherwise, now the player…” It says it doesn’t understand the second phrase. Any advice?

Edit: I think I just figured it out. I think it is because of the comma in the third line. I’ll test this and mark as solved if this is the case.

Edit 2: Yup. It was the comma. Figures. Thank you everyone for your help!