intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 10:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: In and On a container
PostPosted: Sat Jan 12, 2019 3:01 pm 
Offline

Joined: Sat Aug 19, 2017 8:32 am
Posts: 10
Hi.

I'm trying to place things in the chest with some description but it doesnt work. I can only get it working with the word on even though without the following code you can "get diamond" and "put diamond in chest".

So would I just have to replace the chest with something that the diamonds can sit on?

"test in and on things" by Michelle

Cave is a room.

diamonds are things in the cave

A chest is an open container in the cave.

Instead of putting diamonds on the chest:
say "you carefully place the diamonds on the chest using ON";
move the diamonds to the chest.


Instead of putting diamonds in the chest:
say "you carefully place the diamonds on the chest using IN";
move the diamonds to the chest.


Thanks.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jan 12, 2019 4:48 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 428
When the player types PUT DIAMONDS IN CHEST, their command gets mapped to an action called "inserting it into". This is the name you need to write rules for the action. So the rule you want is
Code:
Instead of inserting diamonds into the chest:
    say "you carefully place the diamonds on the chest using IN";
    move the diamonds to the chest.

The command PUT DIAMONDS ON CHEST maps to the "putting it on" action.

You can check out the names of Inform actions, and the commands that map to them, by consulting the Index (the ACTIONS tab) in the IDE.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 15, 2019 8:03 am 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 67
As an additional hint - when playing/testing the game in the IDE you can type "actions" to enable action tracking. This will tell you what Inform is actually doing or trying to do. In your case it would have shown you that it uses "inserting someting into something" when you try to "put something into something". It's always my #1 thing to do when something doesn't work as I expect it to.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 15, 2019 9:50 am 
Offline

Joined: Sat Aug 19, 2017 8:32 am
Posts: 10
Thank you!! This will be very useful.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 19 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