intfiction.org

The Interactive Fiction Community Forum
It is currently Mon May 20, 2013 1:52 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Apr 22, 2012 2:25 pm 
Offline

Joined: Sat Jul 09, 2011 2:09 am
Posts: 19
I think I tried that before, but after double checking, it still gives me an error. And since everything goes through if I replace that one word, I'm not sure what's going on. Looking at the debug log, I get a "Problem C24BadOptionalAPClause", but that doesn't seem to explain much.
Code:
Rule for setting action variables for an actor going (this is the timed set going variables rule):
   now the speed gone at is the number produced by the going speed selection rules for the actor;
   unless the redirect speed is 0:
      now the speed gone at is the redirect speed;
      now the redirect speed is 0;
   unless the redirect scale is 1:
      now the speed gone at is the speed gone at multiplied by the redirect scale;
      now the redirect scale is 1;
   now the first distance gone over is the default distance;
   now the second distance gone over is the default distance;
   repeat through the Table of Room Distances:
      if the start entry is the room gone from and the end entry is the room gone to:
         if there is a first entry, now the first distance gone over is the first entry;
         if there is a second entry, now the second distance gone over is the second entry;
      otherwise if the end entry is the room gone from and the start entry is the room gone to:
         if there is a second entry, now the first distance gone over is the second entry;
         if there is a first entry, now the second distance gone over is the first entry;
   now the total distance gone over is the first distance gone over plus the second distance gone over;
   now the time gone for is the total distance gone over multiplied by the speed gone at.

The going speed selection rules are a person based rulebook producing a number.
A going speed selection rule when someone (called the subject) is in an enterable vehicle (this is the default carriage speed rule):
   rule succeeds with result 15.
A going speed selection rule (this is the default going speed rule):
   rule succeeds with result 30.
The default going speed rule is listed last in the going speed selection rules.
Quote:
Problem. In 'now the speed gone at is the number produced by the going speed selection rules for the actor', I tried to read a description of an action - a complicated one involving optional clauses; but 'the actor' wasn't something I recognised.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 10:49 am 
Offline

Joined: Sun Dec 05, 2010 11:07 am
Posts: 321
Location: ኢትዮጵያ
Hmm, I can't reproduce that error. At best I get variable unrecognized errors if I don't define them at the start, but this code compiles fine for me:

Code:
There is room.

The going action has a number called the speed gone at.
The going action has a number called the redirect speed.
The going action has a number called the redirect scale.
The going action has a number called the first distance gone over.
The going action has a number called the second distance gone over.
The going action has a number called the total distance gone over.
The going action has a number called the time gone for.

The default distance is a number that varies.

Table of Room Distances
start   first   second   end
(a room)   (a number)   (a number)   (a room)

Rule for setting action variables for an actor going (this is the timed set going variables rule):
   now the speed gone at is the number produced by the going speed selection rules for the actor;
   unless the redirect speed is 0:
      now the speed gone at is the redirect speed;
      now the redirect speed is 0;
   unless the redirect scale is 1:
      now the speed gone at is the speed gone at multiplied by the redirect scale;
      now the redirect scale is 1;
   now the first distance gone over is the default distance;
   now the second distance gone over is the default distance;
   repeat through the Table of Room Distances:
      if the start entry is the room gone from and the end entry is the room gone to:
         if there is a first entry, now the first distance gone over is the first entry;
         if there is a second entry, now the second distance gone over is the second entry;
      otherwise if the end entry is the room gone from and the start entry is the room gone to:
         if there is a second entry, now the first distance gone over is the second entry;
         if there is a first entry, now the second distance gone over is the first entry;
   now the total distance gone over is the first distance gone over plus the second distance gone over;
   now the time gone for is the total distance gone over multiplied by the speed gone at.

The going speed selection rules are a person based rulebook producing a number.

A going speed selection rule when someone (called the subject) is in an enterable vehicle (this is the default carriage speed rule):
   rule succeeds with result 15.
The last going speed selection rule (this is the default going speed rule):
   rule succeeds with result 30.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 7:38 pm 
Offline

Joined: Sat Jul 09, 2011 2:09 am
Posts: 19
Yeah, I just tried isolating it myself, and it worked. So there must be a problem somewhere else in the code. Well, time to comment stuff out until I find it!

EDIT: Well, that was an interesting mistake. I had matched the time gone for as "for". No wonder Inform was getting confused! Thanks for giving me the working recode, though. It allowed me to compare blocks more directly.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 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