Jump to content
Sign in to follow this  
Ninjaisfast

Creating radio channel with array of units

Recommended Posts

Hi, correct me if I use any of the incorrect terminology, I'm very new to this.
I'm trying to add an array of units to a created radio channel, but can't seem to get it to work when I want to access that array in the units selection.
This works (run from one of the units init boxes):

Quote

_index = radioChannelCreate [[1,1,1,1], "Direct Chat", "%UNIT_NAME", [greg, dom]];


But this doesn't, where I've defined clerkArray = [greg, dom] in my init.sqf. 

Quote

_index = radioChannelCreate [[1,1,1,1], "Direct Chat", "%UNIT_NAME", [{clerkArray select 0}, dom]];


I think my array is correctly defined, as clerkArray select 0 setdamage 1; works fine, and kills greg.
I feel like I'm doing something wrong with actually selecting from that array when that selection will itself be part of an array. 
Ideally, I would like to be able to add whatever unit names I want to my definition in my init.sqf, not the unit init box.

Share this post


Link to post
Share on other sites

That's my confusion. I'm not sure what to put there to make that happen. [clerkArray select 0, dom] doesn't work either.

Share this post


Link to post
Share on other sites
2 hours ago, Ninjaisfast said:

run from one of the units init boxes

Maybe this is the problem 

Share this post


Link to post
Share on other sites

Yep, putting it in the init.sqf worked instead. And if I put it in a radio trigger it works as well. The object init fields must be called before the init.sqf ?

Share this post


Link to post
Share on other sites
36 minutes ago, Ninjaisfast said:

Yep, putting it in the init.sqf worked instead. And if I put it in a radio trigger it works as well. The object init fields must be called before the init.sqf ?

Indeed they are.

 

Cheers

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  

×