The place to discuss the ADRIFT Interactive Fiction toolkit

Altering several Objects at once?

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.

Altering several Objects at once?

Postby trivega » Fri Apr 29, 2016 11:12 am

Hey! Is it possible to change the stats/properties of several/group of objects at once? Let's say the Player jumps into a pool, how do I make it so everything he is wearing/holding gets wet? Is it possible to do something like that without having to change each of those objects individually?

The situation I'm trying to work out is this: 1. Player enters pool/wet area. 2. Everything gets wets. 3. The now wet objects stay wet until the player does something to dry them. 4. However, any wet object still worn decreases Players temp and makes them open to sickness.

I figured out how to change an objects property, but can't find a solution to changing all worn/held objects properties all at once.

Thank you in advance
Posts: 5
Joined: Thu Apr 28, 2016 3:17 pm

Re: Altering several Objects at once?

Postby ParadoxGames » Fri Apr 29, 2016 1:44 pm

I believe there's an "everything worn/carried by character..." as a refiner for actions... I don't have aDRIFT in front of me at the moment. Am I right?
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am
Points: 10

Re: Altering several Objects at once?

Postby ElliotM » Fri Apr 29, 2016 4:06 pm

Welcome to the forum. The following 3 things will let you do the first three things of your list:

Create a state property for objects called 'Moisture' to track whether something is dry or wet. Give it the following states:
adrift Code: Select all

Optionally, make it mandatory for all dynamic objects. This will make it so any dynamic object you make afterwards will have this property by default if it is a dynamic object. You may need to open and 'refresh' previously created dynamic objects.

Create a task called 'Object becomes Wet' and give it the following syntax:
adrift Code: Select all
# %object% becomes wet

Then in the task actions change the Moisture property of the Referenced Object to Wet. Now this task will do the work of telling objects that they are wet. Call it from other tasks, such as the following:

Create another task for when the player goes in the pool that tells them they became soaked. For example, you could make a specific task that runs before Go Inside Object, change the blue line to your pool object, add a new completion message, and uncheck the display parent message. Then in the task actions, create a new action that executes task 'Object becomes Wet' and click on the parameter button to add the following:
adrift Code: Select all

Now whenever the player gets in the pool object, everything they are wearing or holding will become wet and stay wet until you update their moisture property. You can probably just track the player's dryness by using a different state property that includes things like dry, wet, and sick.
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Altering several Objects at once?

Postby trivega » Fri May 06, 2016 11:30 am

Thanks! That should work out great for me. Cheers!
Posts: 5
Joined: Thu Apr 28, 2016 3:17 pm

Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 6 guests