intfiction.org

The Interactive Fiction Community Forum
It is currently Fri May 24, 2013 5:13 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Sep 28, 2011 8:57 pm 
Offline

Joined: Wed Jan 05, 2011 11:09 am
Posts: 16
I'm working on a project in which the player must decide when to go to sleep for the day, thereby moving the plot forward. So far, I have days set up into individual scenes as such: Day One is a scene. Day Two is a scene. Day Two begins when Day One ends. What I'm trying to do is set up some kind of numerical indicator so that when the player chooses to sleep I can have something to the effect of:

Code:
Instead of sleeping:
     if the player is in the barracks:
           say "you go to sleep etc."
           Now Day is 2.


Of course this code doesn't work but what I'm attempting to do is something to this effect where I can assign a varying numerical value to a letter such as T or a word like Day that will change each time the player sleeps but so far I can't find anything to specifically address this in the handbook.

If anyone can help I'd be grateful!


Top
 Profile Send private message  
 
PostPosted: Thu Sep 29, 2011 6:32 am 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
I7 has a built-in mechanism for keeping track of time, so you may want to look into that. However, if your question is just how to set up a number variable, you can use a statement like: Day is a number that varies. Then, when you want to change its value (such as when a player sleeps) you can use (I believe) "increment day by 1." This will not itself trigger the scene changes, but you could add "Day One ends when Day is 2" and "Day Two begins when Day One ends" to have the scenes follow the days.

There's probably a better way to do all of this -- I'm sure somebody who knows a lot more than I do will suggest it.

Robert Rothman

Edit: I just saw that you've already gotten the answer in the other forum.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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