intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Aug 21, 2017 3:32 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Mon Mar 20, 2017 11:33 pm 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2058
Location: US - Central
jrb wrote:
I guess using "enclose" would work. You'll need to be careful with the names.
Code:
A body is a kind of thing. A body is part of every person.
A head is a kind of thing. A head is part of every body.
A nose is a kind of thing. A nose is part of every head.

Looks OK, but the player's nose will come out with the name "your body's head's nose", which is a trifle weird. (Of course there are plenty of ways round this, depending on exactly what effects you want.)


Another way is to specify the player's stuff.
Code:
A body is a kind of thing. A body is part of every person.
my body is a body. it is part of the player. The printed name of my body is "your body". 
A head is a kind of thing. A head is part of every body.
my head is a head. It is part of the player. The printed name of my head is "your head".


A nose is a kind of thing. A nose is part of every head.

Making the nose a part of the head will get you "John's head's nose" if you want automatic naming.
I think you can say:

Code:
When play begins: now the printed name of a random nose enclosed by John's head is "John's nose".

This way could lie madness, though, if your game is a cyberpunk Mr. Potato Head simulation!

_________________
http://hanonondricek.wix.com/pyramidif


Top
 Profile Send private message  
 
PostPosted: Tue Mar 21, 2017 12:49 am 
Offline

Joined: Wed Mar 09, 2016 7:15 am
Posts: 23
Hi folks, can someone please do me a favour and clarify the difference between "enclosure" and "incorporate" in this context? I think enclose means and object is made a child of another and incorporate means make the values part of the existing object, but i'm just not sure.

And yes, it's almost a MR Potato-head situation. THe idea was that unlike other games where you just level up with XP and apply perks, you engage other cyborgs/droids/people/etc... in battle and "take" parts from fallen enemies to increase your level and stats. So something like "left arm" may have a cannon so you get a damage buff and you can take it off a fallen NPC.

Combat system was going to be next after this, I had imagined it was basically a scene with a while loop and a truth state. But I wanted to obviously get the player trading component in place first.

But to your point matt W, the approach of nestling the values inside larger objects so I could swap objects at once was what I hoped for after you mentioned it could not be done generically based on a value/value approach in my other thread.


Top
 Profile Send private message  
 
PostPosted: Tue Mar 21, 2017 3:58 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 701
Location: Malmö, Sweden
Relations shouldn't be confused with inheritance. Relations are a yes-no answer to the question "are these connected by the [name] relation?". The answer is either a boolean computed as part of a relation, or a stored boolean (a flag in a table). The practical difference isn't always apparent and generally shouldn't matter.

The enclosure relation ("[x] encloses [y]") means an object is inside another. If x is in y and y is in z, z encloses both x and y. The depth of nesting doesn't matter.

The incorporation relation is more straightforward. When you declare x part of y, y is moved inside x and then the incorporation relation is set to true.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Tue Mar 21, 2017 8:14 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 4937
Location: Burlington, VT
For the official documentation of this, "enclosure" is explained in Writing with Inform §3.25;

Quote:
The idea of indirect containment is useful enough to have a name: Inform calls it "enclosure". A thing encloses whatever is a part of itself, or inside itself, or on top of itself, and it also encloses anything that they enclose. And when something moves around, anything it encloses will move with it.


The other relations are explained in a bit more detail in Writing with Inform §13.4:

Quote:
Inform has altogether five mutually exclusive ways in which one thing can be physically joined to another one:

containment relation - The coin is in the purse.
support relation - The coin is on the table.
incorporation relation - The coin is part of the sculpture.
carrying relation - The coin is carried by Peter.
wearing relation - The jacket is worn by Peter.


Top
 Profile Send private message  
 
PostPosted: Tue Mar 21, 2017 9:07 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 190
You could do this to get the names right.
Code:
A body is part of every person.
A head is part of every person.
A nose is part of every person.

When play begins:
	repeat with X running through people:
		let N be a random nose part of X;
		let H be a random head part of X;
		let B be a random body part of X;
		now N is part of H;
		now H is part of B.


Top
 Profile Send private message  
 
PostPosted: Wed Mar 22, 2017 6:34 am 
Offline

Joined: Wed Mar 09, 2016 7:15 am
Posts: 23
thanks guys, given me a lot of ideas to play with, i'm going to tinker with them and see which one works for what I need.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 9 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:  
cron
Powered by phpBB® Forum Software © phpBB Group