intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 15, 2018 7:50 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Oct 22, 2018 9:46 pm 
Offline

Joined: Thu Aug 28, 2014 12:39 pm
Posts: 11
Hello,

I am having some difficulty getting a new clothing system working the way I want it to. Basically, I want to define clothes as occupying certain body slots, so that when the clothes get worn, the body slot becomes covered or uncovered. The problem I am bumping into is with the occupying relation I've defined: rather than treat it as a requirement, Inform 7 is creating a generic item of the specified kind, so when I say "The blue jeans occupy a pelvis, upper legs, and lower legs" a new instance of each of those body slots is created. Not sure how to fix this. Here's the most relevant code to give an idea of what I'm going for.
Code:
Clothes are a kind of thing. Clothes are usually wearable.
A body slot is a kind of thing.
Occupying relates various clothes to various body slots.
The verb to occupy means the occupying relation.
Upper legs are a kind of body slot. Every person incorporates upper legs.
Lower legs are a kind of body slot. Every person incorporates lower legs.
Covering relates various clothes to various body slots.
The verb to cover means the covering relation.
Carry out wearing something:
   Repeat with slot-in-question running through body slots which are occupied by the noun:
      Now slot-in-question is covered by the noun.
The blue jeans are clothes. The jeans occupy upper legs and lower legs.

So if a player types "wear jeans", then the generic upper legs and lower legs occupied by the jeans get covered, rather than the player character's upper and lower legs. Is my approach here even remotely correct?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 23, 2018 1:51 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2806
Location: US - Central
If you type SHOWME ME, does it show that you have body parts attached to the player? You might need to build the player's anatomy specifically. I remember running into this problem when creating detailed body parts for AIF.

Code:
A nose is a kind of thing. One nose is part of every person.
your nose is a nose. it is part of the player. understand "my nose" as your nose.


You might also want to specify "Covering relates one clothes to one body slot." If you do various-to-various that means one sock could cover an army of people and multiples can cover the same body part. Also, various-to-various relations, especially when used on a kind of which there can be large numbers of operating in the game, is probably one of the easiest ways to bog the system down and cause a noticeable lag in the game due to memory issues.

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 23, 2018 6:29 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5438
Location: Burlington, VT
It looks to me as though you might want "The blue jeans occupy every upper legs. The blue jeans occupy every lower legs." That way the clothing item will have that relation to every appropriate body part of every person, which looks like what you want. (I'm not absolutely positive you can do this in an initial declaration; you might need to set it in a "When play begins:" rule.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 23, 2018 8:21 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2806
Location: US - Central
Right, you might want to specify "Covering relates one clothing to various body slots." instead of various-to-various. Don't forget you can type RELATIONS in the IDE as a debug command to check what relations are currently set in the game.

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 23, 2018 8:55 am 
Offline

Joined: Thu Aug 28, 2014 12:39 pm
Posts: 11
HanonO wrote:
You might also want to specify "Covering relates one clothes to one body slot." If you do various-to-various that means one sock could cover an army of people and multiples can cover the same body part. Also, various-to-various relations, especially when used on a kind of which there can be large numbers of operating in the game, is probably one of the easiest ways to bog the system down and cause a noticeable lag in the game due to memory issues.

HanonO wrote:
Right, you might want to specify "Covering relates one clothing to various body slots." instead of various-to-various. Don't forget you can type RELATIONS in the IDE as a debug command to check what relations are currently set in the game.

I am looking for various to various (I think) because: one slot can be covered by multiple items of clothing (such as a dress shirt being worn over a t-shirt), and multiple slots can be covered by the same item of clothing (such as a t-shirt covering a person's chest, abdomen, shoulders, and upper arms).
matt w wrote:
It looks to me as though you might want "The blue jeans occupy every upper legs. The blue jeans occupy every lower legs." That way the clothing item will have that relation to every appropriate body part of every person, which looks like what you want. (I'm not absolutely positive you can do this in an initial declaration; you might need to set it in a "When play begins:" rule.)

This! This is what I was looking for. I had to change the word order around, but once I wrote
Code:
Every upper legs is occupied by the blue jeans. Every lower leg is occupied by the blue jeans.

I started to get the results I was looking for.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 23, 2018 9:21 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5839
Another approach is to define a kind-of-value, which is distinct from the body slot kind but mappable to it:

Body-location is a kind of value. The body-locations are upper-legs-loc, lower-legs-loc, feet-loc, torso-loc.
A body slot has a body-location.
The body-location of upper legs is always upper-legs-loc. [...]

Then you can write a relation which applies to body-location. The rest should be doable.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Oct 28, 2018 7:09 am 
Offline

Joined: Sat Oct 17, 2015 5:48 am
Posts: 85
I think, if the objective is crossing an hostile environment, setting a "covered" flag when all appropriate garment is weared is more simple.

Best regards from Italy,
dott. Piergiorgio.


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