intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Oct 18, 2018 12:16 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jun 05, 2018 6:03 am 
Offline

Joined: Fri Aug 05, 2016 2:46 pm
Posts: 29
The same action, "entering", is used for both getting on top of things and into things,
and I can't figure out a way to specify which when writing a rule (for making a custom supporter-kind or container-kind).

For example:

Code:
There is a room.
The horse is here.

Instead of entering the horse:
    now the player is on the horse.


Produces the result:

Quote:
>Enter horse
room (in the horse)


I know it's easy to work around this, but I'm just curious as to how it's working.
Is there an I6 code specifically for supporters and containers?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 6:41 am 
Offline

Joined: Sun Oct 11, 2015 5:09 pm
Posts: 309
When you write the rule for "entering the horse," the compiler will assume that the horse is an enterable container (which means that during play the game will talk about being "in" the horse), *unless* a declaration elsewhere in the code specifies otherwise.

Try this:
Code:
There is a room.
The horse is here. The horse is an enterable supporter.

Instead of entering the horse:
    now the player is on the horse.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 8:57 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5768
Quote:
When you write the rule for "entering the horse," the compiler will assume that the horse is an enterable container


Mm, not true -- the compiler doesn't make assumptions based on rule headers like that. The horse winds up as neither a container nor a supporter (nor enterable). When you forcibly move the player to a generic thing like that, the room header is "(in the X)" by default.

(If you wrote "The saddle is in the horse," *then* the compiler would assume the horse is a container.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 9:52 am 
Offline

Joined: Fri Aug 05, 2016 2:46 pm
Posts: 29
Thanks for the replies! Yes, making the horse a supporter works as a workaround, but what if I want to make the horse an animal and not a kind of supporter?

Zarf, is there a way to force a room header for when being on or in a specific generic thing or kind of thing?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 10:37 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2639
Location: US - Central
The "Rideable Vehicles" extension is built into Inform 7:

Quote:
Rideable Vehicles by Graham Nelson

Inform's built-in "vehicle" kind assumes that the vehicle is a container, which is fine for cars or hot-air balloons, but not so good for a pony or a four-wheeled lawnmower, which one rides rather than gets inside. Rideable Vehicles is an extension which creates two more kinds: "rideable animal" (good for the pony) and "rideable vehicle" (good for the lawnmower).

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 12:05 pm 
Offline

Joined: Fri Aug 05, 2016 2:46 pm
Posts: 29
Thanks Hanon! I looked at the code of that extension and I found the snippet of I6 code that seems to make the difference:

Code:
Include (-
   has enterable supporter,
-) when defining a any kind or thing here.


That will make the header say "on" instead of "in", without implementing other supporter features on the kind.


Last edited by itsgallus on Tue Jun 05, 2018 2:08 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jun 05, 2018 1:54 pm 
Offline

Joined: Sun Oct 11, 2015 5:09 pm
Posts: 309
Whoops, thanks for the correction. I was getting it confused with the assumptions that the compiler makes based on certain declarations -- "A bucket is here. In the bucket is a turnip," automatically turns the bucket into a container, for example.

zarf wrote:
Quote:
When you write the rule for "entering the horse," the compiler will assume that the horse is an enterable container


Mm, not true -- the compiler doesn't make assumptions based on rule headers like that. The horse winds up as neither a container nor a supporter (nor enterable). When you forcibly move the player to a generic thing like that, the room header is "(in the X)" by default.

(If you wrote "The saddle is in the horse," *then* the compiler would assume the horse is a container.)


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 16 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