Jump to content
Sign in to follow this  
saetheer

spawned unit attacking eachother

Recommended Posts

Hi.

My sqf runs ok, but the opfor units that I spawn with a trigger (they're spawning in waves) just attacking eachother.

Could anyone be kind with guidence here?

Thanks in advance

_pos1 = getmarkerpos "N_spawn";	//N_spawn are a opfor spawnpoint
_pos2 = getmarkerpos "W_spawn";	//W_spawn is another opfor spawnpoint
_target = getmarkerpos "target";	//Blufor campsite - Opfor will attack this position.

_rwave = 1;



_grp1 = creategroup west;
_grp2 = creategroup west;

_wp1 = _grp1 addwaypoint[_target,0];
_wp1 = _grp2 addwaypoint[_target,0];
_wp1 setwaypointtype "SAD"; 
_wp1 setwaypointbehaviour "AWARE";


// easy waves	
while {_rwave < 3} do
	{
	hint format ["Wave: %1",_rwave];
	_rwave = _rwave + 1;
	_unit1 = _grp1 createUnit ["O_Soldier_GL_F", [(_pos1) select 0,(_pos1) select 1,0], [], 3, "FORM"];
	sleep 10;	
	};

// moderate waves	
while {(_rwave > 2) and (_rwave < 5)} do
	{
	hint format ["Wave: %1",_rwave];
	_rwave = _rwave + 1;
	_unit2 = _grp2 createUnit ["O_Soldier_GL_F", [(_pos2) select 0,(_pos2) select 1,0], [], 3, "FORM"];
	sleep 10;	
	};

// hard waves	
while {(_rwave > 4) and (_rwave < 7)} do
	{	
	hint format ["Wave: %1",_rwave];
	_rwave = _rwave + 1;
	_unit1 = _grp1 createUnit ["O_Soldier_GL_F", [(_pos1) select 0,(_pos1) select 1,0], [], 3, "FORM"];
	_unit2 = _grp2 createUnit ["O_Soldier_GL_F", [(_pos2) select 0,(_pos2) select 1,0], [], 3, "FORM"];
	sleep 10;
	};

// unlimited hardcore waves	
while {wave > 6} do
	{

	hint format ["Wave: %1",_rwave];
	_rwave = _rwave + 1;
	_unit1 = _grp1 createUnit ["O_Soldier_GL_F", [(_pos1) select 0,(_pos1) select 1,0], [], 3, "FORM"];
	_unit1 = _grp1 createUnit ["O_Soldier_GL_F", [(_pos1) select 0,(_pos1) select 1,0], [], 3, "FORM"];
	_unit2 = _grp2 createUnit ["O_Soldier_GL_F", [(_pos2) select 0,(_pos2) select 1,0], [], 3, "FORM"];
	_unit2 = _grp2 createUnit ["O_Soldier_GL_F", [(_pos2) select 0,(_pos2) select 1,0], [], 3, "FORM"];	
	sleep 10;
	};

Share this post


Link to post
Share on other sites

Sorry, how is this a user mission ? Please put it in the correct thread ... Troubleshooting perhaps ? Or mission scripting ?

Share this post


Link to post
Share on other sites

Try changeing "creategroup west" to creategroup east;

since opfors team is east.

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  

×