Home   Help Search Login Register  

Author Topic: Trigger question  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Trigger question
« 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

Offline BensTooCool

  • Members
  • *
Re: Trigger question
« Reply #1 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]

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Trigger question
« Reply #2 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.

Offline mcnorth

  • Members
  • *
Re: Trigger question
« Reply #3 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.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Trigger question
« Reply #4 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.... ???

Offline Cheetah

  • Former Staff
  • ****
Re: Trigger question
« Reply #5 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.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Trigger question
« Reply #6 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:
  • Grouped to the BLUFOR group (zoom in so that you can see it)
  • Any Group Member
  • Not Present
  • Condition: this && !somevariable

OPFOR trigger
  • OPFOR
  • Not Present
  • on Activ.: somevariable=true

Init.sqs/sqf
  • somevariable=false;

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...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Cheetah

  • Former Staff
  • ****
Re: Trigger question
« Reply #7 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?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Trigger question
« Reply #8 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

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re: Trigger question
« Reply #9 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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Trigger question
« Reply #10 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:

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re: Trigger question
« Reply #11 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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Trigger question
« Reply #12 on: 11 Apr 2007, 06:27:51 »
Ahhhhhhhhhh  I understand wise one!! :weeping: I'll give it a shot... thanks.


TCM