Home   Help Search Login Register  

Author Topic: Distance Trig and Array combo  (Read 9253 times)

0 Members and 1 Guest are viewing this topic.

Offline eegore

  • Members
  • *
Re: Distance Trig and Array combo
« Reply #15 on: 24 Feb 2014, 06:03:53 »

  The last portion of this mission is to have a trigger activate when all 5 goats are found or near the barn.

  I think I can have one trigger contain a condition that all 5 goats are near one Game Logic right?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Distance Trig and Array combo
« Reply #16 on: 24 Feb 2014, 06:58:16 »
Yes.

Set the trigger to activate from civilian side (animals are civilians), set the correct size for it (something like 10x10 is probably enough), set to activate repeatedly and in the condition field
Code: [Select]
this && {_x in thisList} count goats == 5
Should trigger only when the 5 goats are in.
Note that I use array stored in variable goats (goats = [goat1, goat2, etc ]) instead of writing the array manually, just to make it a bit more tidy.
« Last Edit: 24 Feb 2014, 07:00:04 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline eegore

  • Members
  • *
Re: Distance Trig and Array combo
« Reply #17 on: 25 Feb 2014, 01:50:55 »

  Ok I have the trigger set for Civilian present Repeated but it never goes off.

  I also tried it reverse as Not Present.

  Not sure whats up, the only alteration I did to the script was the goat classnames.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Distance Trig and Array combo
« Reply #18 on: 25 Feb 2014, 07:16:24 »
Here's the test mission I've used.
It also includes yet again updated herder.sqf (removed more useless code from it).
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline eegore

  • Members
  • *
Re: Distance Trig and Array combo
« Reply #19 on: 26 Feb 2014, 03:48:08 »

  I realize my init had no "civilian" side for the goats like the current init.

  The trigger works fine now.