Jump to content
Smart Games

Get position of trigger

Recommended Posts

I use a function that needs the coordinates of a trigger.

 

trigger init:

 null = [(getpos this),thislist] spawn fnc_enemy_spawn; 

 

But (getpos this) for a trigger doesn´t work..

Any ideas?

 

 

Share this post


Link to post
Share on other sites
11 minutes ago, Smart Games said:

But (getpos this) for a trigger doesn´t work..

 

It should work. are you sure this is pointing to a trigger?

 

Share this post


Link to post
Share on other sites

thats my function:

fnc_enemy_spawn =
{

	_pos = _this select 0;
	_count = count (_this select 1);

	hint format ["%1 %2", _count, _pos];

	if (_count >= 5) then {} else
	{

		_rnd =  floor (random 2);

		if (_rnd == 1) then
		{

			_group = createGroup east;
			_rnd = floor (random 5);

			for "i" from 1 to _rnd do
			{
				_unit = (selectRandom UDSSR_Men) createUnit [_pos, _group];
			};

			[_group, _pos] call bis_fnc_taskDefend;

		};

		if (_rnd == 2) then
		{

			_group1 = createGroup east;
			_group2 = createGroup east;
			_rnd = floor (random 5);
			_rnd2 = floor (random 3);

			for "i" from 1 to _rnd do
			{
				_unit = (selectRandom UDSSR_Men) createUnit [_pos, _group1];
			};

			for "i" from 1 to _rnd2 do
			{
				_unit = (selectRandom UDSSR_Men) createUnit [_pos, _group2];
			};

			[_group1, _pos] call bis_fnc_taskDefend;
			[_group2, _pos, 250] call bis_fnc_taskPatrol;

		};


	};


};

the _count works, 

for _pos it shows "array".

 

And i get the error message:

undefined variable in expression _pos

  • Like 1

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

×