intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Nov 16, 2018 6:24 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun May 27, 2018 5:48 pm 
Offline

Joined: Sun May 27, 2018 5:44 pm
Posts: 1
Is the current build Inform release 6M62?

Also I am getting an error with this code...

[LOOK IN + LOOK OUT]
Understand the command "look in" as something new.
Understand "look in [something]" as insearching.
Insearching is an action applying to one thing, requiring light.
Instead of insearching:
Try searching the noun;

Error says:

Problem. You wrote 'Understand the command "look in" as something new' : but 'understand the command ... as ...' is only allowed when the old command is a single word, so for instance 'understand the command "capture" as "get"' is okay, but 'understand the command "capture the flag" as "get"' is not.


This used to work with versions in the past in 2012... so how do i do 2 or more word commands....

Thanks!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun May 27, 2018 11:30 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5398
Location: Burlington, VT
6M62 is the latest release, yes.

As for your question, if you want to redirect "look in" to another action, one way to do it is just to target look:

Code:
Understand the command "look" as something new.


and then you have to put back in all the grammar lines for "look" that you actually want. Which is annoying.

Recent versions of Inform let you do something that might be simpler. You can say

Code:
Understand nothing as searching.


and this will delete all the grammar lines for the the searching action. Then you can redefine "look in" as you like and put back the old grammar lines for searching.

BUT it looks like the intended effect of your code is just to define a new action insearching for "look in [something]" and redirect that action for searching. And "look in [something]" is already understood as searching in the Standard Rules. So you might just be able to skip all that code and let the Standard Rules handle it.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 28, 2018 12:00 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2748
Location: US - Central
RodOfNOD wrote:
Understand the command "look in" as something new.
Understand "look in [something]" as insearching.
Insearching is an action applying to one thing, requiring light.
Instead of insearching:
Try searching the noun;

Error says:

Problem. You wrote 'Understand the command "look in" as something new' : but 'understand the command ... as ...' is only allowed when the old command is a single word, so for instance 'understand the command "capture" as "get"' is okay, but 'understand the command "capture the flag" as "get"' is not.


Isn't "look in [something]" already a synonym for search? ACTIONS command engage...

Quote:
>search rock
[searching the rock]
You find nothing of interest.
[searching the rock - failed the can't search unless container or supporter rule]

>look in rock
[searching the rock]
You find nothing of interest.
[searching the rock - failed the can't search unless container or supporter rule]


So are you trying to allow "look in" to work on non-containers and supporters and remap to examine?

Code:
"The Insearchable Dream"

Lab is a room. A rock is in lab. The description is "Rocky, Janet."

A box is a container in lab.

The can't search unless container or supporter rule does nothing.

Check searching:
   if the noun is not a container and the noun is not a supporter:
      try insearching the noun instead.
      
Insearching is an action applying to one thing and requiring light.

Instead of insearching something:
   try examining the noun.
   
      


Quote:
The Insearchable Dream
An Interactive Fiction
Release 1 / Serial number 180527 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Lab
You can see a rock and a box (empty) here.

>actions
Actions listing on.

>x box
[examining the box]
The box is empty.

[examining the box - succeeded]

>search box
[searching the box]
The box is empty.

[searching the box - succeeded]

>look in box
[searching the box]
The box is empty.

[searching the box - succeeded]

>x rock
[examining the rock]
Rocky, Janet.

[examining the rock - succeeded]

>search rock
[searching the rock]
[(1) insearching the rock]
[(2) examining the rock]
Rocky, Janet.

[(2) examining the rock - succeeded]

[(1) insearching the rock - failed]

[searching the rock - failed the Check searching]

>look in rock
[searching the rock]
[(1) insearching the rock]
[(2) examining the rock]
Rocky, Janet.

[(2) examining the rock - succeeded]

[(1) insearching the rock - failed]

[searching the rock - failed the Check searching

The search technically fails, but performs correctly for the player. Unless you have something pivoting on insearching failing or succeeding it should work for practical purposes.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 28, 2018 10:33 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5802
Quote:
Isn't "look in [something]" already a synonym for search?


One might want to treat "look in" and "search" differently for one object, but redirect "look in" back to "search" for the common case.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 28, 2018 3:21 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5398
Location: Burlington, VT
Since the regular grammar for searching includes "look/l inside/in/into/through [something]", and since you probably want to treat "in/into/inside" the same, it seems to me that if you're trying to special-case something the best way to do it would be to redirect "search" instead. That way you can use

Code:
Understand "search" as something new.


and you don't have to worry about reconstructing the rest of the grammar for "look."


Top
 Profile Send private message  
Reply with quote  
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: Bing [Bot], KitParsing and 27 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