Home   Help Search Login Register  

Author Topic: individual triggering....  (Read 568 times)

0 Members and 3 Guests are viewing this topic.

keou

  • Guest
individual triggering....
« on: 20 Oct 2003, 17:53:07 »
i want to set up a trigger so that only one or two individuals detect the opposite side rather than a whole east vs. west trigger.

for example, i only want to trigger a specific east soldier to do or say something when he detects anyone from the west.  i can only see where to activate "detected by east", but i cannot fine tune it to only that individual.  i tried adding a condition field of east soldier name in thislist, but get no where (i think it's looking for the soldier name for the person that triggers the trigger).

any ideas or points in the right direction?

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:individual triggering....
« Reply #1 on: 20 Oct 2003, 18:50:37 »
this is not hard, quite easy actualy :)

i'll show how u can do it, first make a script sayin something like this:
code:

_object = _this select 0
_player = _this select 1
#loop
? (_object getDistance _player ) < 10 : do something(make _bool false 2)
? _bool : goto "loop"
exit

/code

then just execute the scipt by placing it somewhere and typing [object, player] exec "somename.sqs"

That's all there's too it ;)

Get those missions out there you morons!

mikeb

  • Guest
Re:individual triggering....
« Reply #2 on: 20 Oct 2003, 18:57:38 »
the problem with the detected by triggers is that the object of the trigger is the unit detected not the unit detectING. ... if that makes sense.

a better idea would be to use the KNOWSABOUT command (see command ref in editors depot)

UNIT1 knowsabout UNIT2 >=3

values are 0 to 4 4 being thatUNIT1 knows everything about UNIT2 (side, type, etc)

for checking each unit in a certain area try the following:

have a trigger in whatever area  you want this all to work activated by the detected side set on repeatedly (I think) and activate a script in the activation field.  In that script put...

?"UNIT1 knowsabout _x >=3" foreach _grouplist

this checks each unit in that area and whether UNIT1 knowsabout them.  you can then loop this to keep checking and I THINK the above is satisfied if UNIT! knowabout about ANY of the units to a value of 3 or above.  hence you could do the following:

?"UNIT1 knowsabout _x >=3" foreach _grouplist: goto "alarm"

then have an alarm point in your script that causes the soldier to say something.

Reading back over this post it's all a bit unclear - sorry!  I hope you get the idea and just experiment with it till it works

« Last Edit: 20 Oct 2003, 18:58:03 by mikeb »

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:individual triggering....
« Reply #3 on: 20 Oct 2003, 19:02:06 »
Yep mikeb's way is usualy better, but both will work fine, just depends on what u want to use the script for right ;)
Get those missions out there you morons!

keou

  • Guest
Re:individual triggering....
« Reply #4 on: 20 Oct 2003, 20:46:25 »
Reading back over this post it's all a bit unclear - sorry!  I hope you get the idea and just experiment with it till it works

i think i understand the broad aspect of it.  i'll start pounding away.  hell...i was just thrilled you two understood what i was trying to ask!  i think i confused myself more in trying to post my question ;)

thanks MachoMan and mikeb!