intfiction.org

The Interactive Fiction Community Forum
It is currently Tue Nov 20, 2018 1:43 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Fri Jul 06, 2018 11:11 am 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
Sorry to ask for help again, but I don't know what to do here as I don't see the error. What is wrong here:
Code:
The player has some text called CUE. The CUE of the player is usually "".

The CUE of the player is "now".

If the CUE of the player is "now", say "now".

The last line gives me an error ("the punctuation here ':' makes me think this should be a definition of a phrase") but I have no idea why.

Any explanations?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 06, 2018 11:24 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2664
Location: The Midwest
It's because that line is just sitting in the source code, not inside a rule or definition. The compiler needs to know when exactly the code should be run.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 06, 2018 12:17 pm 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
I don't think I can follow. I always use if clauses outside of rules and they work. Could you write an example that works?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 06, 2018 12:20 pm 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
To be a little more specific about my question, I want to have a rule that applies when the cue of the player changes to something specific.
Maybe I'm using a wrong approach for an ingame cue here. I hahe multiple cues when something should happen.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 06, 2018 1:18 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2664
Location: The Midwest
I don't believe there's any time that an if-clause will ever work outside a rule. It's like putting code outside of a function in C/C++.

Any of these will work:
Code:
When play begins:
    if the cue of the player is "now", say now.

Every turn:
    if the cue of the player is "now", say now.

After going nowhere:
    if the cue of the player is "now", say now.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jul 11, 2018 4:10 am 
Offline

Joined: Sat Oct 17, 2015 5:48 am
Posts: 84
I'm wrong, or "now" is a reserved word in I7 ?

(WI 8.11 and passim in WI ch.8)

Best regards from Italy,
dott. Piergiorgio


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jul 11, 2018 6:53 am 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
I've found a nice way to do what I want with
Code:
the player has some text called status.

now the status of the player is "restricted".

each turn when the player is in the alleyway:
    if the status is "restricted":
      bla

This is what I wanted.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group