ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

How do you add/sub with property value?

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.

How do you add/sub with property value?

Postby DazaKiwi » Mon Apr 30, 2018 12:29 pm

I want to set properties (integer property) to a new value but rather than replace i want to add onto to its current value.

At the moment this is how i am trying to do this, but it gives me an error: Set Property: name of object - property name to objectkey.propertykey + %number%

But this doesn't work. What is the correct way to increase of decrease a property value by a variable?
User avatar
DazaKiwi
 
Posts: 524
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: How do you add/sub with property value?

Postby ElliotM » Mon Apr 30, 2018 2:09 pm

Sample files would probably make this easier to figure out, can you attach one showing what you are trying to do? One thing I do notice is that %number% is a reference like %object% or %character% or %text%. While you can use it like a variable, if your task command syntax doesn't include %number% it won't actually be set to anything.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: How do you add/sub with property value?

Postby DazaKiwi » Mon Apr 30, 2018 11:12 pm

It works now. Yeah %number% was a # param it was valid. It turns out the problem was restriction for the task. I posted this after midnight, when my brain isn't firing on all cylinders (mental note dont post when tired lol). So yeah, objectkey.propertykey + value does work when increasing a property integer value.
User avatar
DazaKiwi
 
Posts: 524
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: How do you add/sub with property value?

Postby ElliotM » Tue May 01, 2018 2:30 am

Glad you figured it out.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron