Home   Help Search Login Register  

Author Topic: problem with trigger activations  (Read 2195 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
problem with trigger activations
« on: 02 Mar 2008, 17:29:37 »
hi
been playing with hoz s dofollowunit script .. an excellent script which does away with ai having to join the player group ..

im stuck trying to figure out how to call the script on the person who activates the trigger..
how could i get the name of the player so i could change the way the script is called
at the min i have it  fired  with this command
dummy = [hostage,leader_1] execVM DoFollowUnit.sqf

problem is if leader_6 finds the hostage id like him to follow leader_6

many thanx in advancve   :)
great script ...

"HOLY SARDINE" - see Shark-Attack meet his match

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: problem with trigger activations
« Reply #1 on: 02 Mar 2008, 17:32:32 »
How about trying to get the hostage to follow the leader of whoever triggers the trigger?
Code: [Select]
dummy = [hostage, leader (thisList select 0)] execVM "DoFollowUnit.sqf";
« Last Edit: 03 Mar 2008, 16:23:23 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline sharkattack

  • Former Staff
  • ****
Re: problem with trigger activations
« Reply #2 on: 03 Mar 2008, 15:50:11 »
thanks mate
 :good:
"HOLY SARDINE" - see Shark-Attack meet his match

Offline sharkattack

  • Former Staff
  • ****
Re: problem with trigger activations
« Reply #3 on: 04 Mar 2008, 11:12:27 »
A new problem with triggers

how could i set up a trigger which is fired by any group memeber (team1)
coming within a certain distance from an objective .
i can do it with a single named unit

condition
soldier1  distance objective  < 5

how could i fire the trigger  if any member of team 1 is less than 5 meters from objective

thanks   :)
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: problem with trigger activations
« Reply #4 on: 04 Mar 2008, 11:24:28 »
Well, I'm assuming the objective moves, otherwise a normal area trigger would make more sense. Assuming team1 has been set to the group we are talking about (e.g. by "team1 = group this" in init line):
Code: (condition: Any living member of team1 is within range) [Select]
({ (alive _x) and ((_x distance objective) < 5) } count (units team1)) > 0

If the objective is stationary, the simple way is to synchronise the group with an area trigger so that only that group will cause the trigger to activate.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline sharkattack

  • Former Staff
  • ****
Re: problem with trigger activations
« Reply #5 on: 04 Mar 2008, 11:45:10 »
the objective is stationary in this case.

i group the trigger to team one
and set activation to any group memeber present
 
how do i include the distance from objective  to the condition of the trigger

edit
====

got it mate .. i put the above code in the grouped trigger and it works a treat ... many thanx




« Last Edit: 04 Mar 2008, 11:50:43 by shark attack »
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: problem with trigger activations
« Reply #6 on: 04 Mar 2008, 11:50:39 »
But you don't need to use the distance, since the trigger area implies a distance. Either that or I'm misunderstanding what you need.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline sharkattack

  • Former Staff
  • ****
Re: problem with trigger activations
« Reply #7 on: 04 Mar 2008, 11:54:33 »
the objective is an ammo crate inside a building .. getting it to fire is a bit unreliable using the trigger size .. sometimes the objective is ticked before the player can even see the crate ..

the above code seems to be a bit more accurate  :)
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: problem with trigger activations
« Reply #8 on: 04 Mar 2008, 12:00:47 »
Well, the code I gave above should be fine then.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline sharkattack

  • Former Staff
  • ****
Re: problem with trigger activations
« Reply #9 on: 06 Mar 2008, 13:17:01 »
it is mate ... works a treat

many thanx
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Nixer6

  • Members
  • *
Re: problem with trigger activations
« Reply #10 on: 06 Mar 2008, 15:44:55 »
Thanks here too Spooner.

That little snippet helped me solve a little headache I was dealing with.  :good:
Why do I have to be a Rocket Scientist to make a good mission?