turns from now/at the time when

Hi guys, I’m brand new to this Inform 7 business and writing my first little adventure, but have come up against a brick wall. I’m having problems with the following bit of code:

After entering the cheese: say "You climb aboard the repellent, buoyant cheese. Others notice this and begin swimming towards you, crying out for mercy. Some grab at cheeses of their own, but they are insufficiently plump or fall apart like wet cake. One man manages to board a huge brie but then quickly sinks into it, suffocating fragrantly."; if bo's'n is not visible begin; move bo's'n to the location of the player; say "[line break]One man, the bo's'n, appears from somewhere and grabs on to your cheese. He is a large and burly man and his weight would be disastrous for the stability of the cheese. Already it bobbles precariously, threatening to flip over and send you plummeting back into the murky, unforgiving depths. His one good remaining eye boggles at you shinily. This bo's'n'll be the end of you if you don't do something about him tres quickly."; the bo's'n hijacks cheese in three turns from now; at the time when the bo's'n hijacks cheese; say "[line break]The bo's'n snarls and grabs you by the hair, pulling you forward and off the cheese. You beat and claw at his massive thick arm but it is useless. He tosses you far away into the water."; end if. instead of exiting [cheese], say "You're on the cheese now. No sense getting off. Seacheese!";

Debug tells me the following:

"Problem. In the sentence ‘the bo’s’n hijacks cheese in three turns from now’ , I was expecting to read a rule, but instead found some text that I couldn’t understand - ‘bo’s’n hijacks cheese’.

I was trying to match one of these phrases:

  1. (bo’s’n hijacks cheese - rule) in (three - number) turn/turns from now

  2. (bo’s’n hijacks cheese - rule) in (three turns - time) from now

This was what I found out:

bo’s’n hijacks cheese = something unrecognised

three turns = something unrecognised"

So obviously I’m doing something really obviously wrong, but I’m having a hard time figuring it out. I’ve trawled around a little bit but am not having much luck Any advice would be appreciated!

It looks like you have some organizational problems. See if it works better like this:

[code]After entering the cheese:
say “You climb aboard the repellent, buoyant cheese. Others notice this and begin swimming towards you, crying out for mercy. Some grab at cheeses of their own, but they are insufficiently plump or fall apart like wet cake. One man manages to board a huge brie but then quickly sinks into it, suffocating fragrantly.”;
if bo’s’n is not visible:
move bo’s’n to the location of the player;
say “[line break]One man, the bo’s’n, appears from somewhere and grabs on to your cheese. He is a large and burly man and his weight would be disastrous for the stability of the cheese. Already it bobbles precariously, threatening to flip over and send you plummeting back into the murky, unforgiving depths. His one good remaining eye boggles at you shinily. This bo’s’n’ll be the end of you if you don’t do something about him tres quickly.”;
the bo’s’n hijacks cheese in three turns from now.

At the time when the bo’s’n hijacks cheese:
say “[line break]The bo’s’n snarls and grabs you by the hair, pulling you forward and off the cheese. You beat and claw at his massive thick arm but it is useless. He tosses you far away into the water.”;

Instead of exiting when the player is in the cheese, say “You’re on the cheese now. No sense getting off. Seacheese!”;[/code]

I’m not sure if the “At the time when” rule would be able to fire from inside the if statement. You also had a semicolon after the “at the time when” when it needed to be a colon or a begin.

I also changed “exiting the cheese” to “exiting when the player is in the cheese” because the “exit” action doesn’t take an object (assuming you haven’t replaced it with your own version or anything), so that was giving me an error. You might want to check for getting off the cheese also.

That worked perfectly shammack, thank you very much! You’re right, I was all over the place and nesting too much stuff in too much other stuff. Your solution is much cleaner. Thank you again :slight_smile: