Page 1 of 1
Array values get overwritten between turns
Posted: Mon Jul 15, 2013 2:11 pm
by rf900
Was using the arrays (tried the 4 of them) to store some info that I need, but it seems they are getting filled with other values between turns. Is there any other way to use them or do I have to put all data in UniversalVars?
Re: Array values get overwritten between turns
Posted: Mon Jul 15, 2013 4:50 pm
by pipfromslitherine
The AI (amongst other things) uses the scratchpad arrays, so as you have found out you cannot rely on them to store non-temporary data. What kind of data do you need to store for extended periods?
Cheers
Pip
Re: Array values get overwritten between turns
Posted: Mon Jul 15, 2013 5:44 pm
by rf900
It was the cost of the units so I could easily look for it with a loop, I will try to do it with normal variables and the WorkingString trick.
Re: Array values get overwritten between turns
Posted: Tue Jul 16, 2013 6:07 am
by rf900
Brrr, simple enough, just need to initialize the array every turn. I was doing it in the panel INIT function which apparently is only called once on creation.