Jump to content
Sign in to follow this  
pd3

BIS_fnc_spawnGroup: Examples of use?

Recommended Posts

Hi, I would like to use BIS_fnc_spawnGroup in a mission I'm creating, however I'm not exactly sure how to get the syntax right for a particular parameter.

http://community.bistudio.com/wiki/BIS_fnc_spawnGroup

It says here that the sixth parameter is the skill range that you can set.

This is what I'm working with currently:

GroupSquad8 = [getMarkerPos "Squad8", east, ["GUE_Soldier_CO","GUE_Soldier_Medic","GUE_Soldier_3","GUE_Soldier_CO","GUE_Soldier_AT","GUE_Soldier_AT","GUE_Soldier_GL","GUE_Soldier_CO"]] call BIS_fnc_spawnGroup;

How would I properly set the skill range?

Or better put, because I only have three parameters here, how would I skip the fourth and fifth parameter and change the sixth?

Any help with this issue would be appreciated.

EDIT:

I attempted just leaving empty arrays and then placed [0.3,0.6] for the skill range?

This is correct?

Edited by Pd3

Share this post


Link to post
Share on other sites

Based on the third example of the BIKI-article you posted, providing empty arrays is the way to disregard those parameters until the one you want to set.

This is the part of the script which handles the skill:

//If a range was given, set a random skill.
	if ((count _skillRange) > 0) then 
	{
		private ["_minSkill", "_maxSkill", "_diff"];
		_minSkill = _skillRange select 0;
		_maxSkill = _skillRange select 1;
		_diff = _maxSkill - _minSkill;

		_unit setUnitAbility (_minSkill + (random _diff));	
	};

So there you have it, your syntax is correct :)

GroupSquad8 = [getMarkerPos "Squad8", east, ["GUE_Soldier_CO","GUE_Soldier_Medic","GUE_Soldier_ 3","GUE_Soldier_CO","GUE_Soldier_AT","GUE_Soldier_ AT","GUE_Soldier_GL","GUE_Soldier_CO"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;

Share this post


Link to post
Share on other sites
Based on the third example of the BIKI-article you posted, providing empty arrays is the way to disregard those parameters until the one you want to set.

This is the part of the script which handles the skill:

//If a range was given, set a random skill.
	if ((count _skillRange) > 0) then 
	{
		private ["_minSkill", "_maxSkill", "_diff"];
		_minSkill = _skillRange select 0;
		_maxSkill = _skillRange select 1;
		_diff = _maxSkill - _minSkill;

		_unit setUnitAbility (_minSkill + (random _diff));	
	};

So there you have it, your syntax is correct :)

GroupSquad8 = [getMarkerPos "Squad8", east, ["GUE_Soldier_CO","GUE_Soldier_Medic","GUE_Soldier_ 3","GUE_Soldier_CO","GUE_Soldier_AT","GUE_Soldier_ AT","GUE_Soldier_GL","GUE_Soldier_CO"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;

Thanks so much, I just wasn't sure if that was exactly how it worked.

Much appreciated.

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  

×