Jump to content
Sign in to follow this  
Franklin

Set name of group leader

Recommended Posts

Is there a way to set the name of a group leader for a dynamically spawned group?

I'm very new to scripting and this is my attempt to do this, I have no issues getting the group to spawn.

grpNgarrison5 = [getMarkerPos "MNgarrison5", east, ["RW_RU_Soldier_SL", "RW_RU_Soldier_AR", "RW_RU_Soldier_LAT", "RW_RU_Soldier_Marksman", "RW_RU_Soldier_MG", "RW_RU_Soldier_GL", "RW_RU_Soldier", "RW_RU_Soldier_Medic"],[], ["SERGEANT", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE"],[0.3,0.1,0.1,0.1,0.1,0.1,0.1,0.1],[],[],round (random 360)] call BIS_fnc_spawnGroup;

unit5 = leader grpNgarrison5;

unit5 setVehicleInit "nul=[this,"town1"] execVM "ups.sqf";";

processInitCommands;

I'm pretty sure the way im using the "leader" command, is 100% backwards from how its supposed to be used.

also should I be using double quotations around the ups.sqf?

Should i just spawn a separate unit, and then have him join and lead the group? If so, how would i do that without waypoints?

Share this post


Link to post
Share on other sites

You dont need to pass it through the init, just exec ups straight from the spawn script.

Share this post


Link to post
Share on other sites

I've used the BIS_Fnc_Help interface to try to figure out how to do this, but nowhere does it say how to do this. Can you give me an example of how this can be done?

Share this post


Link to post
Share on other sites

waituntil {BIS_fnc_init};
_g = [getMarkerPos "MNgarrison5", east, ["RW_RU_Soldier_SL", "RW_RU_Soldier_AR", "RW_RU_Soldier_LAT", "RW_RU_Soldier_Marksman", "RW_RU_Soldier_MG", "RW_RU_Soldier_GL", "RW_RU_Soldier", "RW_RU_Soldier_Medic"],[], ["SERGEANT", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE"],[0.3,0.1,0.1,0.1,0.1,0.1,0.1,0.1],[],[],round (random 360)] call BIS_fnc_spawnGroup; 
[leader _g,"town1"] execVM "ups.sqf";

Just tested, worked fine.

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  

×