Home   Help Search Login Register  

Author Topic: Who entered my sector ?  (Read 631 times)

0 Members and 1 Guest are viewing this topic.

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Who entered my sector ?
« on: 21 Oct 2002, 20:09:23 »
Got a big problem, can't figure it out by trial & error.  :-\

What i need: there's a trigger reacting to all west units entering it. I need to know which unit or which group has just entered it.

That's because i need to do a variety of things with the unit/group: spawn enemies depending on the unit's/group's direction, reveal them to the enemies, etc.

- I tried out the list trigger-command by setting everything up and testing it by :
i = player countEnemy list triggerOne; hint format ["Enemies: %1 ", i];

The problem is a 'knowAbout' problem: the list won't update until (in this case) me, the player, knows about the enemy units. So as long as i haven't spotted/revealed them, the list stays empty although they are already in the trigger.

- I can't do nearestObject because there are many different types of units and vehicles involved.


ppfffff - oh man, my head is smoking. someone can help me out ?  :P

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Who entered my sector ?
« Reply #1 on: 21 Oct 2002, 21:17:47 »
(ahem) Oh well... got it. I figured that basically the solution is the same trick that MP missions use when working with killzones. Search for info on that and got it working for me - i love this forum !  :D

A trigger generates a list with units that triggered it, called thislist. It's an array. So (thislist select 0) gives you the unit that triggered it first.

To know the direction of the 1st enemy unit in your sector (trigger), make a trigger for EAST units (when u are WEST),
condition: not this
On activation: obj=thislist select 0; bear=direction obj; hint format["Direction of %1 is %2",obj,bear];