intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Dec 12, 2018 10:31 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Jul 04, 2018 12:11 pm 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
Hi everyone! in my IF I wrote this:
Code:
the hole on the wall is a door. it is north of room1 and below room2.

before going north from room1:
   if the player is in room1:
      say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".

before entering in the hole on the wall:
   if the player is in room1:
      say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".


but if the player while he is in room1 writes
Code:
nord
it prints
Quote:
>nord
You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.

Room2
Description of room2.

and if he writes
Code:
enter in hole on the wall
it prints
Quote:
>nord

Room2
Description of room2.

???? what's the problem????
It is important because if the player read "there is a hole on the northern wall", he probably won't write "nord", but "enter in the hole"...


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jul 04, 2018 12:52 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5429
Location: Burlington, VT
The action name for entering would be "entering the hole in the wall." (The action name is "entering" followed by the noun.) When you type "Entering in the hole in the wall," Inform basically understands that as "before (entering) (in the hole in the wall)"--which is to say "before entering [something, anything] [when the player is] in the hole in the wall"--which never happens, because the player can never actually be in the hole in the wall.

By the way you don't need the if-clause in the first rule--since you have "from room1" in the room heading, you don't need another check that the player is in room1.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jul 04, 2018 12:54 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5429
Location: Burlington, VT
In fact you can take care of both cases with one rule:

Code:
the hole on the wall is a door. it is north of room1 and below room2.

before going from room1 through the hole on the wall:
   say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 2:54 am 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
matt w wrote:
The action name for entering would be "entering the hole in the wall." (The action name is "entering" followed by the noun.) When you type "Entering in the hole in the wall," Inform basically understands that as "before (entering) (in the hole in the wall)"--which is to say "before entering [something, anything] [when the player is] in the hole in the wall"--which never happens, because the player can never actually be in the hole in the wall.

By the way you don't need the if-clause in the first rule--since you have "from room1" in the room heading, you don't need another check that the player is in room1.

ahhh ok ok I understood, so it should be something like "entering through the hole in the wall"?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 2:55 am 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
matt w wrote:
In fact you can take care of both cases with one rule:

Code:
the hole on the wall is a door. it is north of room1 and below room2.

before going from room1 through the hole on the wall:
   say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".


Yess this is perfect!! thank you matt!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 7:37 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5429
Location: Burlington, VT
Tubbadù wrote:
matt w wrote:
The action name for entering would be "entering the hole in the wall." (The action name is "entering" followed by the noun.) When you type "Entering in the hole in the wall," Inform basically understands that as "before (entering) (in the hole in the wall)"--which is to say "before entering [something, anything] [when the player is] in the hole in the wall"--which never happens, because the player can never actually be in the hole in the wall.

By the way you don't need the if-clause in the first rule--since you have "from room1" in the room heading, you don't need another check that the player is in room1.

ahhh ok ok I understood, so it should be something like "entering through the hole in the wall"?


Just for posterity's sake, since the other approach worked, you would write this:

Code:
before entering the hole on the wall:
   if the player is in room1:
      say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".


just leaving out the word "in."


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 1:16 pm 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
matt w wrote:
Tubbadù wrote:
matt w wrote:
The action name for entering would be "entering the hole in the wall." (The action name is "entering" followed by the noun.) When you type "Entering in the hole in the wall," Inform basically understands that as "before (entering) (in the hole in the wall)"--which is to say "before entering [something, anything] [when the player is] in the hole in the wall"--which never happens, because the player can never actually be in the hole in the wall.

By the way you don't need the if-clause in the first rule--since you have "from room1" in the room heading, you don't need another check that the player is in room1.

ahhh ok ok I understood, so it should be something like "entering through the hole in the wall"?


Just for posterity's sake, since the other approach worked, you would write this:

Code:
before entering the hole on the wall:
   if the player is in room1:
      say "You enter in the hole on the wall. You walk in a narrow tunnel for a while, than you reach a wooden ladder. You start climbing it.".


just leaving out the word "in."


ahhhhhhh fantastic! thank you !


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: No registered users and 17 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