Home   Help Search Login Register  

Author Topic: Triggers that follow units  (Read 756 times)

0 Members and 1 Guest are viewing this topic.

Nobby

  • Guest
Triggers that follow units
« on: 21 Nov 2002, 00:49:34 »
How do I get a trigger to have a unit as its centre point and then when the unit moves the trigger moves with them so that there is always a trigger surrounding a unit and performing the neceassary actions until the unit dies?

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Triggers that follow units
« Reply #1 on: 21 Nov 2002, 01:08:23 »
create a script like this:
Code: [Select]
_unit = _this select 0
_trigger = _this select 1

#loop
~0.5
_trigger setpos getpos _unit
?!alive _unit:exit
goto "loop"

In the init field of the unit, put:

[this,triggername] exec "thisscript.sqs"
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Nobby

  • Guest
Re:Triggers that follow units
« Reply #2 on: 21 Nov 2002, 14:44:32 »
Cheers mate, looks good, now as a little extra, how do I get a unit to join my group if they enter that trigger? (The trigger will be no more than a 10 circle).

Offline Ottie

  • Members
  • *
  • And you think this is personal
Re:Triggers that follow units
« Reply #3 on: 21 Nov 2002, 17:58:51 »
in the activation field of the trigger

"_x join player" foreach unit thislist

I think this is the correct syntax
If you can't beat them, buy them

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Triggers that follow units
« Reply #4 on: 21 Nov 2002, 18:40:53 »
@ Ottie - u r wrong  ;)

its

"[_x] join player" foreach thislist

LCD OUT
« Last Edit: 22 Nov 2002, 12:45:41 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Nobby

  • Guest
Re:Triggers that follow units
« Reply #5 on: 22 Nov 2002, 03:01:41 »
Guys it's not workin. The first bit worked fine with the trigger followin you, but the "join me" syntax int workin. The "thislist" command comes up as the unknown operator. Wats goin on?


Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Triggers that follow units
« Reply #6 on: 22 Nov 2002, 06:35:26 »
Remove 'unit'. The list allready contains units.


"_x join player" foreach thislist
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.