Jump to content
Sign in to follow this  
Amazed

[QUESTION]Are dynamic identifiers for publicVariables possible?

Recommended Posts

Hi!

I am trying to avoid race conditions in a mp scenario by assigning each client a separate publicVariable it can broadcast to. I know you can have dynamic identifier names for variables like so:

_MyVariable = 20;
_MyVariableContent = "MyContent";
call compile format["MyDynamic_%1=_MyVariableContent",_MyVariable];

source: http://tactical.nekromantix.com/wiki/doku.php?id=arma:scripting#dynamic_variables

What I came up with so far is this:

_varIndex = 1;  
_varContent = "blabla";
publicVariable "" + format ["dynPubVar_%1=_varContent", _varIndex];

Sadly this seems to be not working. Any ideas?

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  

×