Jump to content
Sign in to follow this  
Jan_F_W

How to make createGroup <side> dynamic?

Recommended Posts

I would like to add a parameter for a respawn script where the side for a newly created group can be determined

something like this did not work:

working with static side "EAST":

"_group = createGroup EAST;"

not working:

_groupParameter = _this select 0;  // parameter is well passed in here...
_group = createGroup _groupParameter;

does not work^^

---------- Post added at 07:35 PM ---------- Previous post was at 07:26 PM ----------

just found out that the parameter for the groups CANNOT be passed in the function as string so it has to stand without quotes in the execVM call..

without quotes.

Share this post


Link to post
Share on other sites

pass the parameter as an object, then convert it to a string.

I believe there is a command in the comref somwhere that converts to string, even something simple like format should do it:

_groupstring = format ["%1",_groupParameter];
_group = createGroup _groupstring;

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  

×