Page 1 of 1

Clothing Slots

PostPosted: Wed Jul 02, 2014 2:29 pm
by malenfant21
Hi everyone!
This is my first post on here but I've enjoyed IF since the days of Zork and Adventureland (on the Commodore Vic-20, no less!!!).

I just spent a fair bit of time working on Adrift to incorporate the infamous clothing layers I've read about a little bit on this site.

Right now, I have managed to build a working model that:
- uses 10 different slots (Head, Neck, Torso, Waist, Pelvis, Arms, Hands, Thighs, Calves, Feet)
- allows objects to be worn on multiple slots at the same time (ex. a hoodie can cover Head, Neck,Torso, and Arms; trousers can cover Waist, Pelvis, Thighs, and Calves)
- allows use of any number of clothing layers (
- restricts players from removing objects that are covered (ex. you cannot remove your shirt without removing your jacket first)
- restricts players from wearing objects when a higher-layer object in the same slot is already worn (ex. you cannot put on underwear if you are wearing pants)

I'm working on concealing clothing that is not the highest layer in a slot (ex. if you are wearing a jacket, the "inventory" command will not show your shirt which is hidden by the jacket.)

Does anyone want something like this?

What's the next step?

Thanks

Re: Clothing Slots

PostPosted: Wed Jul 02, 2014 4:29 pm
by malenfant21
Here's a link to the TAF file. http://www.4shared.com/file/d2juEksEce/clothing_layers.html?

Please let me know what you think.

Thanks

Re: Clothing Slots

PostPosted: Thu Jul 03, 2014 3:48 pm
by malenfant21
Here's the actual taf file.

Re: Clothing Slots

PostPosted: Wed Jul 09, 2014 1:51 am
by ice_wanted
Nicely done so far. I could use this if you get the visibility. Adding commands to pull up or unzip clothing items (while affecting visibility) would be the following step I would like to see.

Re: Clothing Slots

PostPosted: Wed Jul 09, 2014 4:06 pm
by Lumin
Malenfant, thanks for this, it's probably much more efficient than the mess I kludged together for my own game. I'd suggest uploading it to the demos section of the main site, I'm sure other people could make use of it too, and not everyone visits the forums.

(Actually lately it seems like no one visits the forums, but ah well, I guess we've gone through these phases before...)

Re: Clothing Slots

PostPosted: Wed Jul 09, 2014 11:43 pm
by Lazzah
Lumin wrote:Malenfant, thanks for this, it's probably much more efficient than the mess I kludged together for my own game. I'd suggest uploading it to the demos section of the main site, I'm sure other people could make use of it too, and not everyone visits the forums.

(Actually lately it seems like no one visits the forums, but ah well, I guess we've gone through these phases before...)

Well I'm still visiting at least once a day and I know PO Prune is as well. Campbell doesn't seem to be around very much these days, because of the new baby no doubt, but I noticed he has added a few more fixed bugs to the list on the bugs and enhancements page (24 to date). Who knows, we may even get a new version of ADRIFT sometime this year! :whistle:

Re: Clothing Slots

PostPosted: Sun Jul 13, 2014 11:40 pm
by malenfant21
ice_wanted wrote:Nicely done so far. I could use this if you get the visibility. Adding commands to pull up or unzip clothing items (while affecting visibility) would be the following step I would like to see.


Well, visibility is done. I used a trick where I move all clothes to a NPC (the mannequin) and then move ONLY the top-most layer to the player every time the player wears or removes something.

As for pulling-up or un-zipping... do you mean like unzipping a jacket to reveal the shirt beneath and the jacket?

Sounds like it would involve adding a property for clothing (can be unzipped) and then... I'm not sure :)

Re: Clothing Slots

PostPosted: Mon Jul 14, 2014 12:43 am
by Lumin
I'm sure the AIF crowd will put zippers to good use. :P

Re: Clothing Slots

PostPosted: Tue Dec 16, 2014 1:55 am
by Dastardly
I installed the library to a game I am working on and the following happens after hitting return:

First error
Image

Then, after clicking 'ok' on that, this comes up:

second error
Image

Any ideas? Suggestions?

Even after the item is worn, the game still says the PC is naked
i.e.
Image

I hope someone can help me understand what is going on here. :?

Thanks

Re: Clothing Slots

PostPosted: Wed Feb 26, 2020 5:34 pm
by The0didactus
This thread is a little old, but in the interest of giving credit where credit is due, I "stole" this method for use in Lost Coastlines. It's an elegant solution to a rather complex problem.