Home   Help Search Login Register  

Author Topic: hostage problem  (Read 893 times)

0 Members and 1 Guest are viewing this topic.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
hostage problem
« on: 01 Mar 2005, 08:46:42 »
I'm working on a hostage rescue mission. The way I have it setup at the moment is that if any of the prisoners gets killed, the mission will end in failure. this is nice and all but my problem is even after I secure the prisoners, the mission still ends in failure. What I would like to know is how would a trigger know if the prisoner is secure and to let the mission continue. I hope this makes sense...it does in my twisted mind! ;) thanks guys!

Regards,
Trash Can Man

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:hostage problem
« Reply #1 on: 01 Mar 2005, 08:53:41 »
If I understand you correctly you could use a global variable eg:
captivesSafe = false

and then set it to true when they are safe and don't let the mission and in failure if it is true.  In otherwords the trigger that activates the failed end of mission should have the condition:

this and (whatever else you want ) and not captivesSafe
« Last Edit: 01 Mar 2005, 08:54:20 by THobson »

Offline Roni

  • Members
  • *
  • Play the Game !
Re:hostage problem
« Reply #2 on: 01 Mar 2005, 22:00:20 »
Hi TCM

II'm no trigger expert but try this -

Place a Trigger covering the hostages with the following features -

Type = End #1
Activation = "West Present" (or whatever side are the rescuers)
Condition = (!alive hostage1) || (!alive hostage2) . . .


What this should do is check to end the game as soon as the rescuers burst int to the area with the hostages.  If any one of them is dead then the mission will (should !) end.

Is that what you were looking for ?



roni

bored_onion

  • Guest
Re:hostage problem
« Reply #3 on: 01 Mar 2005, 22:22:07 »
it might be easier to help if we knew exactly what the mission deems necessary for the hostages to be "safe". Is it that they are simply alive (as demonstrated above) or something else such as their movement to a safehouse or the killing of their guards? The best solution can be found with the precise details but it will inevitably involve the use of a global variable (as the guys above have shown).

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:hostage problem
« Reply #4 on: 01 Mar 2005, 22:54:08 »
ok...let me give you an overview of what my mission is like. It's a night time covert ops mission where 12 hostages are being held in 4 different towns on the island. There will be 6 black ops but not as a group. what happened when my friend and I ran my beta version, he inadvertly killed all the hostages (allied officers). So, what i am looking for is a way to end the mission if any 1 of the hostages get killed; but I want to mission to continue if they are still alive when we reach the extraction point. I hope this helps...


Thanks everyone!


Regards,
Trash Can Man

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:hostage problem
« Reply #5 on: 01 Mar 2005, 23:09:24 »
Try this:

In init.sqs put

Code: [Select]
hostageKilled = false
{_x AddEventHandler [{killed}, {hostageKilled = true}]} forEach [hostage1, hostage2....]


(where hostage1 etc are the names you have given to the hostages in the editor)

Have a trigger that causes the mission to end in failure and has the condition field:

hostageKilled


« Last Edit: 01 Mar 2005, 23:10:07 by THobson »

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:hostage problem
« Reply #6 on: 01 Mar 2005, 23:11:44 »
Ok....ill give that a try...thanks a bunch guys I appreciate your help as always!


Trash Can Man

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:hostage problem
« Reply #7 on: 02 Mar 2005, 23:57:27 »
Try this:

In init.sqs put

Code: [Select]
hostageKilled = false
{_x AddEventHandler [{killed}, {hostageKilled = true}]} forEach [hostage1, hostage2....]


(where hostage1 etc are the names you have given to the hostages in the editor)

Have a trigger that causes the mission to end in failure and has the condition field:

hostageKilled






This is axactly what i was looking for!!! Thanks again Hobson....your the man!!



Regards,
Trash Can Man

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:hostage problem
« Reply #8 on: 03 Mar 2005, 11:44:02 »
You are very welcome