Jump to content
Sign in to follow this  
KaRRiLLioN

Call command - uses for bool and arrays?

Recommended Posts

I've been searching this forum but have been unable to find this.

Is it possible to create dynamic bools and arrays using the call command?

For example, I have ["Unit1"] exec "script.sqs"

In the script I have it say:

_unitstring = _this select 0

_unit = Call _unitstring

That returns the object. Now let's say that I want to create a boolean var based on that units name, but I need the bool to be Global, so that other scripts running can also detect it.

format ["%1Ready",_unitstring] = FALSE doesn't work I get an error.

If I do:

_ready = format ["%1Ready",_unitstring]

_ready = FALSE

This creates some sort of boolean var, but of course it's local.

I tried making some dynamically named arrays in the same way, but no dice.

Anyone see what I'm missing, or is this impossible?

Share this post


Link to post
Share on other sites
format ["%1Ready",_unitstring] = FALSE doesn't work I get an error.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">call format ["%1Ready=false",_unitstring]

And then you can use Unit1Ready (boolean global variable).

tested

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×