OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Ext3rmin4tor on 30 Jul 2011, 18:03:30

Title: Load variable in Outro
Post by: Ext3rmin4tor on 30 Jul 2011, 18:03:30
Is it possible to save a variable during the mission and then load it in the mission Outro? Does it work?
Title: Re: Load variable in Outro
Post by: Wolfrug on 30 Jul 2011, 22:56:32
It might work in campaigns (saveVar probably doesn't care if you're in the intro, mission or outro), but I believe this is not something that can easily be fixed for SP. I distinctly remember that MacGuba's famous "Un-Impossible Mission" had some kind of cheat that allowed him to count the number of living/dead units left for the outro (all I remember was that he had to add and remove magazines and maybe do something with magazine counting commands...or something) - but it's very probable that whatever bug he used to do it has since been fixed.

Unless someone else can tell me otherwise, in which case: that'd be great!

But AFAIK, this isn't possible (in a single mission).

What do you need it for? Everyone knows that saving vars between mission and outro isn't something that is usually done or seen, so if there's a burning wreck of your guy is holding the "wrong" weapon, no-one is probably going to react. :)

Wolfrug out.
Title: Re: Load variable in Outro
Post by: Ext3rmin4tor on 31 Jul 2011, 09:27:41
I tried a test mission, I saved a string inside a global variable called testVar, then I used saveVar "testVar" and then ended the mission with a end #1 trigger.

In the intro I used cutText [testVar, "PLAIN DOWN", 0.5] and it display correctly the variable.

EDIT: It just works in the editor preview, maybe because the editor preview is built to allow you to test campaigns and it always keeps trace of saved variables.
Title: Re: Load variable in Outro
Post by: F2kSel on 31 Jul 2011, 11:48:52
Has anyone tried using the copytocliboard command, It will only work with text so I'm not sure how you could extract numbers from it.  I've only tested in the editor.