ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Task action with expression containing integer property of r

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.

Task action with expression containing integer property of r

Postby Flerponius » Thu Mar 22, 2018 1:41 am

Hi! I'm new to Adrift, and I was wondering what I'm doing wrong. I have an object called SATCHEL, and I gave it a new selection property called contains_money, and an integer property called money_count. I have also created a variable called player_money. I made a task that runs after Take Objects From Object, that only runs if the object you are taking has the property contains_money. The action is to increase player_money by %object%.money_count, but when I try to inter the command, it gives me the error Bad Expression. Can anyone tell me what I'm doing wrong?
Flerponius
 
Posts: 2
Joined: Thu Mar 22, 2018 1:35 am
Points: 10

Re: Task action with expression containing integer property

Postby Denk » Thu Mar 22, 2018 8:49 am

Hi and welcome to the forum!

Since the task "Take OBJECTS from object" work on multiple objects (the player may type: get stone and hammer from satchel), you must also use %objects% instead of %object% when you increase the variable. Thus you must increase player_money by %objects%.money_count. Hope that helps :-)
-----------------------------------------------------------------------------------------
Out now: The Royal Puzzle, The Way Home & The Dragon Diamond
-----------------------------------------------------------------------------------------
Denk
 
Posts: 96
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 11

Re: Task action with expression containing integer property

Postby Flerponius » Fri Mar 23, 2018 3:08 am

Thank you so much! It worked like a charm!
Flerponius
 
Posts: 2
Joined: Thu Mar 22, 2018 1:35 am
Points: 10


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 7 guests