Page 1 of 1

Reset Variables?

PostPosted: Sat Apr 15, 2017 9:36 pm
by PHatDriver
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…

Re: Reset Variables?

PostPosted: Sun Apr 16, 2017 6:20 am
by Lazzah
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?

Re: Reset Variables?

PostPosted: Sun Apr 16, 2017 7:43 am
by PHatDriver
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+?

Re: Reset Variables?

PostPosted: Sun Apr 16, 2017 8:41 am
by P/o Prune
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.

Re: Reset Variables?

PostPosted: Sun Apr 16, 2017 11:59 am
by ralphmerridew
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%

Re: Reset Variables?

PostPosted: Sun Apr 16, 2017 9:37 pm
by PHatDriver
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%?

Re: Reset Variables?

PostPosted: Mon Apr 17, 2017 1:49 am
by R2T1
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.

Re: Reset Variables?

PostPosted: Mon Apr 17, 2017 9:45 am
by PHatDriver
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…

Re: Reset Variables?

PostPosted: Mon Apr 17, 2017 11:46 am
by ralphmerridew
Don't feel bad. All you need is experience.

Re: Reset Variables?

PostPosted: Mon Apr 17, 2017 11:55 pm
by PHatDriver
ralphmerridew wrote:Don't feel bad. All you need is experience.

If I had a middle name, it wouldn't be experience.

Re: Reset Variables?

PostPosted: Sun Jul 16, 2017 2:58 pm
by ParadoxGames
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%