ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Variable Value Problem

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.

Variable Value Problem

Postby Lazzah » Mon May 13, 2019 9:14 pm

Hi all, can one of the ADRIFT boffins please help me?

I want to increase the value of a variable by the value of another, which is a variable number itself. How can I do this?

Any help much appreciated.
W.I.P.: Magnetic Moon, Starship Quest & Revenge of the Space Pirates.
Also available: The Axe of Kolt - The Spectre of Castle Coris - The Fortress of Fear - Die Feuerfaust - The Lost Children - Run, Bronwynn, Run!"
User avatar
Lazzah
Moderator
 
Posts: 2198
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17

Re: Variable Value Problem

Postby DazaKiwi » Mon May 13, 2019 9:35 pm

Two methods;

Increase Variable A by %VariableB%

or

Set Variable A to %VariableA% + %VariableB%

Same goes for increasing property values for objects or characters;

Set PropertyA to %Player%.PropertyA + %Number%
User avatar
DazaKiwi
 
Posts: 626
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: Variable Value Problem

Postby Lazzah » Mon May 13, 2019 9:48 pm

Thanks Daza, that worked a treat!
W.I.P.: Magnetic Moon, Starship Quest & Revenge of the Space Pirates.
Also available: The Axe of Kolt - The Spectre of Castle Coris - The Fortress of Fear - Die Feuerfaust - The Lost Children - Run, Bronwynn, Run!"
User avatar
Lazzah
Moderator
 
Posts: 2198
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England
Points: 17


Return to ADRIFT 5.0

Who is online

Users browsing this forum: Google [Bot] and 6 guests