intfiction.org

The Interactive Fiction Community Forum
It is currently Tue Dec 11, 2018 3:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Basic relation question?
PostPosted: Mon Nov 05, 2018 11:46 am 
Offline

Joined: Sun Oct 21, 2018 10:05 am
Posts: 7
Hi,
I'd like to keep track of devices which process various objects.
For a toy example, an oven which processes food:
Code:
An oven is a kind of device.
Food is a kind of thing.
Cheese is a kind of food.
The kitchen is a room.

In the kitchen is an oven.
In the kitchen is a cheese called cheddar.

Processing relates various devices to various things.
The verb to have processed means the processing relation.
   
Melting it with is an action applying to one carried thing and one touchable thing.
Understand "melt [food] with [thing]" as melting it with.


Check melting when the second noun is not an oven:
   unless the second noun is food:
      say "You can only melt [the noun] with an oven." instead.
      
Check melting when the second noun is food:
   try melting the noun with the oven instead.
   
Carry out melting:
   now the second noun has processed the noun;
   
Report melting:
   say "Melted!"
   
Test relation with "take cheddar / melt cheddar with oven"


However, this gives me the error ;
Code:
Run-time problem P62: Tried to change a relation for objects with the wrong kinds: Processing relates various devices to various things, but you tried to relate (or unrelate) the oven to cheddar.


If I instead define the relation generally:
Code:
Processing relates various things to various things.
The verb to have processed means the processing relation.


The example runs alright.

What am I missing?

Thanks!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Nov 05, 2018 12:41 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2797
Location: US - Central
My first reaction would be try reversing the relation.
You have "Processing relates various devices to various things."
Try "Processing relates various things to various devices." It makes a difference if the types aren't the same, and it makes sense the way you wrote it - the "thing" "is processed by" "a device".

You might be able to do this without relations. If I remember the syntax:

Code:
A food has a thing called last-processed-by. The last-processed-by of a food is usually nothing.

Carry out processing a food (called processed):
    now the last-processed by of processed is the food processor.


Or possibly a list, though I haven't worked with those as much:
Code:
A food has a list called processed-by.

Carry out processing a food with something (called the processor):
    add processor to the processed-by list of the noun.


The syntax may be wrong, but there's a way to do this. Various-to-various relations can slow a game down if there's a lot of them.

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


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

All times are UTC - 6 hours [ DST ]


Who is online

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