OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Skaven on 04 Nov 2002, 15:55:31

Title: Hostages Situation
Post by: Skaven on 04 Nov 2002, 15:55:31
I need help with a mission I'm making that uses hostages  :P

The general idea, is having a team of enemy soldiers holding 4 hostages, but ofcourse not killing them, and than when a player shoots all the enemys in a certain zone, the hostages group with the player's team automatically, of course the team can never have more than 8 soldiers 8+4=12  ;D

If possible my idea was having for example, an enemy base with 30 or 40 enemy soldiers, and when all those soldiers die, the hostages turn to the player's group automaticaly, ofcourse on the way back and if attacked they should be normal targets as the rest of the team, that went to pick them up.

Any idea on how to achieve this easily?  ???
Title: Re:Hostages Situation
Post by: Bremmer on 04 Nov 2002, 18:10:47
Hello Skaven, long time no see  :)

Start off with your hostages captives by using:

hostage setcaptive true

You'll need a trigger that detects when the enemy are dead. In the on activation field put:

hostage setcaptive false; [hostage] join player

If you have four hostages you can avoid typing this four times by first defining the hostages in an array (in your init file, or any init line),

hostages = [hostage1,hostage2,hostage3,hostage4]

then using the following commands:

"_x setcaptive true" foreach hostages
"_x setcaptive false" foreach hostages
hostages join player

You can add an element of realism by allowing the captors to kill the hostages if they feel sufficiently threatened. I did this in a rescue mission by placing a couple of guards (in safe or aware behaviour) by the hostages and using a small script like this:

;call script using [guardname] exec "guard.sqs"
_guard = _this select 0
#wait
;wait for the guard to become nervous
@ behaviour _guard == "combat"
;delay
~20
;check if the guard is still jittery
? behaviour  _guard == "combat" : "_x setcaptive false" foreach hostages; exit
goto "wait"

Using a script like this makes hostage rescue much more difficult, and forces the player to plan the rescue rather than just barging in.

good luck  ;)



Title: Re:Hostages Situation
Post by: Skaven on 04 Nov 2002, 18:31:25
 ;D Indeed long time no see Bremmer  ;D
And as usual your explanations are more than enough, I got it all  ;D
Thanks as usual, you Rock  ;)