Jump to content
Sign in to follow this  
Purzel

Change name of Unit

Recommended Posts

Hi there,

Is it possible to change the name of a unit into another name?

I need this for a mission, where this "special" unit joins my team and i need to protect it.

(I don´t mean the group-id like "Alpha" or the units description...!)

See picture below:

Thx Purzel

namechangey4zb8.jpg

Edited by Purzel

Share this post


Link to post
Share on other sites

I've had some issues with getting setName to work (in SP!), but maybe they fixed it now. The wiki entry has been updated for sure since my last visit.

Share this post


Link to post
Share on other sites

THX guys - I´ve got it...!

:)

Share this post


Link to post
Share on other sites

Hi Guys
 
i've spawned a unit using  : _io2 = [getmarkerpos "Spawn_Marker", EAST, ["O_G_Survivor_F"],[],[],[],[],[],180] call BIS_fnc_spawngroup;
 
the question is how do i change its name from O_G_Survivor_F to io2 so that i can place a trigger condition : !alive io2

 

Thnx 

Share this post


Link to post
Share on other sites

The BIS_fnc_spawngroup returns group not unit.

Either use createGroup + createUnit or if you want it as is you need extract unit of returned group

 

If you want to use your condition in some other code ie trigger you need to make the variable global

_io2 = [getmarkerpos "Spawn_Marker", EAST, ["O_G_Survivor_F"],[],[],[],[],[],180] call BIS_fnc_spawngroup;
io2unit = ((units _io2) select 0);
!alive io2unit

If you need the condition in the same script you can use local variable

_io2 = [getmarkerpos "Spawn_Marker", EAST, ["O_G_Survivor_F"],[],[],[],[],[],180] call BIS_fnc_spawngroup;
_io2unit = ((units _io2) select 0);
!alive _io2unit

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  

×