intfiction.org

The Interactive Fiction Community Forum
It is currently Fri May 24, 2013 10:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Supplying a Missing Noun
PostPosted: Sun Jun 24, 2012 9:28 am 
Offline

Joined: Thu Mar 10, 2011 1:21 pm
Posts: 26
Location: Boston, MA
Here's what I've got:

Code:
"Wolves"

The Canine Cave is a room.  The Canine Den is north of the Canine Cave.  The Cave Tunnel is north of the Canine Den.  The Dead End is north of the Cave Tunnel.

A wolf is a kind of person.  A wolf called the first wolf is in the Canine Cave.  A wolf called the second wolf is in the Canine Den.  A wolf called the third wolf is in the Dead End.

Section 1 - Howling

Howling is an action applying to nothing.

The block vaguely going rule is not listed in the for supplying a missing noun rules.

Carry out a wolf howling:
   say "The wolf rears its head and lets out a bloodcurdling howl.";
   repeat with the monster running through wolves:
      let the current place be the location of the monster;
      if the number of moves from the current place to the location of the actor is less than 3:
         let the way be the best route from the current place to the location of the actor;
         try the monster going the way.
         
Every turn:
   try the first wolf howling.


What I want is for the wolf's howling to attract other nearby wolves, and it works, but a message appears during run-time that says "You must supply a noun." This message appears once for each wolf except the howling one, presumably because it is running through them, but I can't figure out what noun is missing. Any ideas? Here's what the game looks like when it's played:

Quote:
Canine Cave
You can see the first wolf here.

>z
Time passes.

The wolf rears its head and lets out a bloodcurdling howl.

You must supply a noun.

The second wolf arrives from the north.

>z
Time passes.

The wolf rears its head and lets out a bloodcurdling howl.

You must supply a noun.

You must supply a noun.

_________________
Lance Calemor


Top
 Profile Send private message  
 
PostPosted: Sun Jun 24, 2012 10:00 am 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 986
Location: Gothenburg, Sweden
For the wolves that are already in the location of the howling wolf (including the howling wolf itself), the 'way' variable is 'nothing', which doesn't count as a noun – that's why Inform complains about a missing noun: the wolves that are already in the howler's location all try going 'nothing'.

I guess the most transparent way to avoid it is to exclude wolves that have already arrived from the 'monster' variable.
Code:
Carry out a wolf howling:
   say "The wolf rears its head and lets out a bloodcurdling howl.";
   repeat with the monster running through wolves that are not in the location of the actor:
      let the current place be the location of the monster;
      if the number of moves from the current place to the location of the actor is less than 3:
         let the way be the best route from the current place to the location of the actor;
         try the monster going the way;

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Sun Jun 24, 2012 12:02 pm 
Offline

Joined: Thu Mar 10, 2011 1:21 pm
Posts: 26
Location: Boston, MA
Thanks, works perfectly! My problem was that I thought that the "missing noun" was applying to the wolves NOT in the location, but it was actually the other way around.

_________________
Lance Calemor


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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