ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Player clothes

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Player clothes

Postby P/o Prune » Fri Aug 24, 2018 8:42 am

Is there a quick fix to make it impossible to wear clothes?

In my game the player is starting out wearing a business suit, white shirt, tie and shoes.
When he enters his room for the first time he automatically changes into jeans, a shortsleeved shirt and comfortable shoes.
I want it to be inpossible for him to put on two layers of clothes.
I could probably do it by creating a task for each piece of clothing and set a restriction, but I wonder if there's an easier way.
D-Day V.5 in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 29Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4244
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Player clothes

Postby Denk » Fri Aug 24, 2018 12:34 pm

Assuming that you have no other types of wearable items (e.g. no hats, rings etc) it can be done quite simple. Simply make a specific task overriding "wear objects". Leave objects undefined. Enter the text which will display e.g. "You are already wearing some clothes.". In this way it overrides for all wearable objects, as long as the restrictions are fulfilled.

Now make a restriction with the expression: Player.Worn.Count>0

Thus if you are already wearing something, the task will execute.

I have made a small demo:
SimpleClothes.taf
(14.85 KiB) Downloaded 31 times


If you have other wearable objects besides clothes, e.g. a ring, things are a bit more complicated. If this is the case, let me know, and I can extend the demo.
-----------------------------------------------------------------------------------------
Out now: The Royal Puzzle, The Way Home & The Dragon Diamond
-----------------------------------------------------------------------------------------
Denk
 
Posts: 154
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: Player clothes

Postby ice_wanted » Sat Aug 25, 2018 1:34 pm

You could have a look at my layered clothing system in the adult section, but that is probably overkill for what you need.

Here is what I would do for a simple 1 layer (torso, legs, feet) system. Create 3 groups (torso, legs, feets). Put each item of clothing in its respective group. Create 3 override tasks for the default "wear %objects%" task
1- First one with restriction a) referenced object need to be in group torso, b) player must not be wearing any item in torso group
2- Second one with restriction a) referenced object need to be in group legs, b) player must not be wearing any item in legs group
3- third one with restriction a) referenced object need to be in group feet, b) player must not be wearing any item in feet group
The tasks action should be the same as the default "wear %object" task.

Make sure all items are at least in one group (ie: a dress could be in two groups).

You may want to also add additional restrictions to prevent wearing multiple items at the same time (ie: wear shirt, blouse, pullover) or using the "all" word (wear all).
ice_wanted
 
Posts: 93
Joined: Thu Aug 22, 2013 1:12 am
Points: 10

Re: Player clothes

Postby ralphmerridew » Sat Aug 25, 2018 9:53 pm

Question: Is it important to your game that the player be able to treat the individual parts separately? If it isn't, I'd strongly recommend treating each set as a single object.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2558
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: Player clothes

Postby P/o Prune » Sun Aug 26, 2018 9:59 am

Not important at all.
I just realized during the beta testing that it was possible for the player to wear two shirts etc. I'm sure that someone will stumble over that little issue so I wanted to clear it.
D-Day V.5 in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 29Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4244
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58


Return to ADRIFT 5.0

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests