OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Trash Can Man on 09 Apr 2007, 05:18:50

Title: Trigger question
Post by: Trash Can Man on 09 Apr 2007, 05:18:50
I'm making a mission where I want Blufor troops to stay in a specific area. What I would like to do is setup a trigger so that is any blufor leaves that area, it will result in a failure of mission. Can this be done with trigger alone or does this have ot be scripted.
Also.... How do I de-activate that trigger once the enemy has been defeated??

TCM
Title: Re: Trigger question
Post by: BensTooCool on 09 Apr 2007, 18:10:08
I think this might work.

Trigger one
Name: West1
Activation: West - Not present
Type: End1

Trigger two
Name: East1
Activation: East - Not Present
Type: None
On Activation: west1 setTriggerActivation  ["none", "present", true]
Title: Re: Trigger question
Post by: Trash Can Man on 09 Apr 2007, 22:37:37
This west trigger didn't work so I couldn't tell if the other one will. I need to make the west trigger end in failure if ANY member of my squad leaves the area.
Title: Re: Trigger question
Post by: mcnorth on 09 Apr 2007, 22:54:02
This should be simple but like so many things it isn't. You should be able to group your trigger with your group, then select "Any Group Member" under activation and then "Not Present". Unfortunately it doesn't work. If you don't mind creating a trigger for each of your guys, grouping them to their respective guys then select "vehicle" under activation and "Not Present" then set it to type "Lose" it should work.
Title: Re: Trigger question
Post by: Trash Can Man on 09 Apr 2007, 23:04:47
To me that seems to be too many triggers for this situation.... I tried grouping but that was a total washout.... ???
Title: Re: Trigger question
Post by: Cheetah on 10 Apr 2007, 07:41:30
I'd try to count the men inside the trigger, then check if the number decreases, if that's the case, end the mission. Once the enemy is killed, I suggest trying to remove the trigger. Don't know if it would work if you deleteVehicle it though.

If deleting doesn't work, you might want to include a parameter in the condition fields which gets set to false once the enemy has been killed.
Title: Re: Trigger question
Post by: h- on 10 Apr 2007, 16:29:42
Quote
I'd try to count the men inside the trigger
And once one of them dies the mission will also end ;)

See attached missionette. mcnorth was on the right tracks, dunno why it wouldn't work..
First, run away so long that the hint saying 'mission failed' appears.
Then restart, shoot the poor defenseless unarmed OPFOR guy and try the same..

BLUFOR trigger:

OPFOR trigger

Init.sqs/sqf

But if this for a MP mission then I'm not sure this will work :dunno:
And also, nothing keeps the AI from running away from the area and failing the mission...
Title: Re: Trigger question
Post by: Cheetah on 10 Apr 2007, 16:43:31
I'm not sure if TCM has multiple squads in the area he wants to keep there, probably only the player's squad though?
Title: Re: Trigger question
Post by: Trash Can Man on 10 Apr 2007, 23:08:30
when I tested your missionette, it worked the first time. After that.....it just wouldn't work at all. Grouping the trigger only worked if the leader let the perimeter. I tried sending a single blufor player out of the area and the was no response from the trigger.  :no: So, I'm at a lost at the moment. The Senario for my mission is I have a single group (9 men) trapped in the deserted village. Zombies are everywhere. I want to keep the men in the village til the zombies are defeated. I was wondering if I named each soldier if that might help.  ???


TCM
Title: Re: Trigger question
Post by: Chris Death on 10 Apr 2007, 23:13:22
Well, in OFP i've been using the following technique when trying to
achieve what you're after here;

A trigger detected by West
Another trigger detected by West (same location as the first one just a little
bit bigger)

Then you have two triggers which should return the same units inside
their triggerlist (in case all living West units are inside the inner trigger).

Now once the a unit is in the bigger trigger's list but not in the inner
trigger's list, it has left the area. ;)

~S~ CD
Title: Re: Trigger question
Post by: Trash Can Man on 11 Apr 2007, 00:13:31

A trigger detected by West
Another trigger detected by West (same location as the first one just a little
bit bigger)

Everytime I tried this, making the larger one end in failure, the mission ends right away.  ??? did you leave something out perhaps?  :dunno:
Title: Re: Trigger question
Post by: Chris Death on 11 Apr 2007, 01:14:46
To be honest i did just speak about the 'how to detect'
if a unit has left a trigger (and not been killed too).

None of the two triggers should have an ending in the type.

I will explain it a little bit further;

Create a trigger detected by West/once
name: triggerA
Condition: this
The size of the trigger should cover that area
you want the west units to stay inside.

Create a trigger detected by West/once
name: triggerB
Condition: this
Make it bigger than triggerA

Now let a script run which compares
the two trigger lists.
e.g:

#start
_countA = list triggerA
_countB = list triggerB
?(count _countB > count _countA): goto "end"
~5
goto "start"

#end
west_end = true
exit

Now have a type: end1 trigger with the condition: west_end

And the mission should end once the outer trigger
contains more units than the inner one.

You can do same without a script by changing the type: end1
trigger's condition to: (count list triggerB) > (count list triggerA)

~S~ CD
Title: Re: Trigger question
Post by: Trash Can Man on 11 Apr 2007, 06:27:51
Ahhhhhhhhhh  I understand wise one!! :weeping: I'll give it a shot... thanks.


TCM