|
Post by Major Pain on Feb 2, 2013 5:43:52 GMT 1
SJ: I'm not familiar with that mission, but have encountered the same issue on several occasions. In each case the culprits were Local Variables that were not reset to entry stage values on replay. The GlobalVars seem to be covered, but Locals also carry over between missions or replays. I use Local Vars to carry values from one mission to the next at times, as well as in many random formulas when using array-based data.
To fix each I added a Setup Function to set all Globals and Locals to zero or required values. You can list all sets or resets within one function and run it first after init.
Just a thought.
|
|
|
Post by Major Pain on Feb 2, 2013 19:41:54 GMT 1
SJ
I'm not sure if the entire script is shown, although it appears to be.
Just an observation:
It appears the order of functions might be setting the lose issue before the land function. It is just a matter of seconds but if placed very closely, they can give preference to order rather than time when very close. Also, Land functions do take a bit longer to execute, around 2 to 3 seconds. So it may be just slightly delayed upon the lose timer triggering.
On the first pass, values are not set, but function "ToBeDefeated" is run before LandReinforcments (1500) is triggered. Since the Guns are not at the location, the lose condition is true.
If the Lose & win functions conditions are run later in the script, you would not need to worry about resetting any global or local values.
You might trigger the Land function first then run the win/loose functions. Increase the times from 3000 to 12000 or perhaps higher thus providing some pad in the timing. Also, add a DisplayTrace in each function to help with debug... Examples: Guns landed... Checking for Lose Condition... etc...
Other than that, I don't see any other problems with the script order.
I hope this helps...
|
|