ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Reset Variables?

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.

Reset Variables?

Postby PHatDriver » Sat Apr 15, 2017 9:36 pm

Hi all,

Beware, questions inbound…

Is there a way to reset all variables to zero?
Trying to implement a manual reset for win or lose
for undisclosed reasons!.. :shock:

And how do you reset the %turns% (moves)?

Or is there a way to change the defaults?

Thank you…
Remanence, The Chosen. Expected release date: 2117!
65+kb and sill to finish part one! <- Nightmare
Carbide 100R window - XFX 750 Black - Asus Z170 AURA - i5 6600k
RX480 Saphire Nitro+ - Vengeance 2x8gb - Crucial MX300. [No OC]
User avatar
PHatDriver
 
Posts: 35
Joined: Sat Feb 11, 2017 11:47 am
Location: London

Re: Reset Variables?

Postby Lazzah » Sun Apr 16, 2017 6:20 am

PHatDriver wrote: Hi all,

Beware, questions inbound…

Is there a way to reset all variables to zero?

Not that I know of. It would be a useful thing to be able to do.

PHatDriver wrote:And how do you reset the %turns% (moves)?

You cannot because, as yet, Campbell has not allowed access to the %turns% variable.

Maybe you could add both the above to the enhancement requests page?
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2016
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: Reset Variables?

Postby PHatDriver » Sun Apr 16, 2017 7:43 am

Lazzah wrote:Maybe you could add both the above to the enhancement requests page?


Will do my good man.

Is there gonna be a 5.0.36+?
Remanence, The Chosen. Expected release date: 2117!
65+kb and sill to finish part one! <- Nightmare
Carbide 100R window - XFX 750 Black - Asus Z170 AURA - i5 6600k
RX480 Saphire Nitro+ - Vengeance 2x8gb - Crucial MX300. [No OC]
User avatar
PHatDriver
 
Posts: 35
Joined: Sat Feb 11, 2017 11:47 am
Location: London

Re: Reset Variables?

Postby Po. Prune » Sun Apr 16, 2017 8:41 am

PHatDriver wrote:Is there gonna be a 5.0.36+?


I would guess so, but only there's only one guy who can really answer that question.
I wrote Campbell some time ago, and he hasn't given up on Adrift. But there are more important things going on in his life right now so we just have to be patient.
D-Day V.5 in progress 79Kb so far (slowly getting there)
Anno 1700 in progress 111Kb
User avatar
Po. Prune
Moderator
 
Posts: 3947
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark

Re: Reset Variables?

Postby ralphmerridew » Sun Apr 16, 2017 11:59 am

To reset all the variables, just do a bunch of "set variable to 0" task actions.

To reset turns, can you fake it?
- Create a variable called "phony_turns"
- Find every usage of %turns% in the game and library and change it to use %phony_turns% instead
- Have an event call a task once per turn, and have that event increase %phony_turns%
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: 2501
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Reset Variables?

Postby PHatDriver » Sun Apr 16, 2017 9:37 pm

ralphmerridew wrote:To reset all the variables, just do a bunch of "set variable to 0" task actions.

Yeah… Nightmare.
Trying to close them all as I go along and when done with, back to = 0

ralphmerridew wrote:"phony_turns"

The thought crossed my mind, then I paniced! I know ya can put variables on the bar at the bottom, can you remove the %turns%?
Remanence, The Chosen. Expected release date: 2117!
65+kb and sill to finish part one! <- Nightmare
Carbide 100R window - XFX 750 Black - Asus Z170 AURA - i5 6600k
RX480 Saphire Nitro+ - Vengeance 2x8gb - Crucial MX300. [No OC]
User avatar
PHatDriver
 
Posts: 35
Joined: Sat Feb 11, 2017 11:47 am
Location: London

Re: Reset Variables?

Postby R2T1 » Mon Apr 17, 2017 1:49 am

I know ya can put variables on the bar at the bottom, can you remove the %turns%?

In the Developer, choose Options then on the General tab - Set your Custom Status Bar to how you want it.
I have a game I have been converting from BASIC which I have set to The island will be destroyed in %TurnsLeft% minutes. where %TurnsLeft% is a variable that counts down from 150 each turn. (performed by an event which calls a System Task every turn)
So my status bar in Runner only shows the current location plus the text above in red.
User avatar
R2T1
 
Posts: 69
Joined: Thu Dec 20, 2012 10:41 am
Location: Sydney, Australia

Re: Reset Variables?

Postby PHatDriver » Mon Apr 17, 2017 9:45 am

Yeah, just me having another brain fart! Sorry.
Speak, act first and realise I knew all along.
Think I turned the %turns% on in the first place myself! :x
All has become clear thanks to you lovely people.

Right, okay. When I say all...

ralphmerridew wrote:Find every usage of %turns% in the game and library and change it to use %phony_turns% instead

Everytime you or sabbie say something I feel my IQ and consciousness slipping into darkness!

Much love to you all…
Remanence, The Chosen. Expected release date: 2117!
65+kb and sill to finish part one! <- Nightmare
Carbide 100R window - XFX 750 Black - Asus Z170 AURA - i5 6600k
RX480 Saphire Nitro+ - Vengeance 2x8gb - Crucial MX300. [No OC]
User avatar
PHatDriver
 
Posts: 35
Joined: Sat Feb 11, 2017 11:47 am
Location: London

Re: Reset Variables?

Postby ralphmerridew » Mon Apr 17, 2017 11:46 am

Don't feel bad. All you need is experience.
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: 2501
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Reset Variables?

Postby PHatDriver » Mon Apr 17, 2017 11:55 pm

ralphmerridew wrote:Don't feel bad. All you need is experience.

If I had a middle name, it wouldn't be experience.
Remanence, The Chosen. Expected release date: 2117!
65+kb and sill to finish part one! <- Nightmare
Carbide 100R window - XFX 750 Black - Asus Z170 AURA - i5 6600k
RX480 Saphire Nitro+ - Vengeance 2x8gb - Crucial MX300. [No OC]
User avatar
PHatDriver
 
Posts: 35
Joined: Sat Feb 11, 2017 11:47 am
Location: London

Re: Reset Variables?

Postby ParadoxGames » Sun Jul 16, 2017 2:58 pm

I just thought up a trick to "manipulating" Turns variable, without doing so.

1) Create a variable, name it %TurnsAlt%, or something. Set it to Zero.
2) At the time you want the turns to be reset, set it to the value of %Turns%
3) Whenever you want to refer to turn number, use %Turns% minus %TurnsAlt%

When TurnsAlt = 0, Turns - TurnsAlt = the turn number.
When TurnsAlt > 0, Turns - TurnsAlt = the turn number since the last time TurnsAlt reset.

So you're expressing the turn number in terms of %Terms%
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron