intfiction.org

The Interactive Fiction Community Forum
It is currently Wed May 22, 2013 12:35 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Nov 20, 2010 12:20 pm 
Offline

Joined: Sat Nov 20, 2010 11:53 am
Posts: 10
Maybe I'm searching for my answer in the wrong way, but I feel I've looked everywhere and found nothing (so I'm sorry if this is a redundant question(!)), but I hope you'll answer anyway, even if it is~

Code:
Every turn:
   If turn count/3 equals one:
      say "You feel hungry".


Returns:
Quote:
This is the report produced by Inform 7 (build 6F95) on its most recent run through:

Problem. In the sentence 'Unless turn count/3 equals one begin', I was expecting to read a condition, but instead found some text that I couldn't understand - 'turn count/3 equals one'.

I was trying to match this phrase:

If (turn count/3 equals one - a condition):

This was what I found out:

turn count/3 equals one = something unrecognised


Please help? :<


Top
 Profile Send private message  
 
PostPosted: Sat Nov 20, 2010 12:36 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 687
Try "every third turn" maybe.


Top
 Profile Send private message  
 
PostPosted: Sat Nov 20, 2010 1:32 pm 
Offline

Joined: Tue Dec 25, 2007 10:06 am
Posts: 887
Turn count divided by 3 will be 1 only when the turn count is exactly 3. You need to use remainder:

Code:
Every turn when the remainder after dividing the turn count by 3 is 0: [...]


Top
 Profile Send private message  
 
PostPosted: Sat Nov 20, 2010 1:33 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 985
Location: Gothenburg, Sweden
This is an annoying one.
For some reason you can't use "equals" or "=" when testing numerical conditions in Inform 7.
Use "is" instead.
Also don't forget the spaces before and after "/".
Code:
Every turn:
   If turn count / 3 is one:
      say "You feel hungry".

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Sat Nov 20, 2010 2:01 pm 
Offline

Joined: Sat Nov 20, 2010 11:53 am
Posts: 10
Oh, thank you so much for your quick responses! ^-^

It works, now! :D
*happy girl*


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group