Home   Help Search Login Register  

Author Topic: Hostage script.  (Read 1273 times)

0 Members and 1 Guest are viewing this topic.

Baphomet

  • Guest
Hostage script.
« on: 19 Feb 2003, 18:35:14 »
I was looking for a rescue script, only I can't find one. I've seen something similar in missions where if a unit is within a certain proximity of another, that unit joins the squad and the alignment is changed from neutral to the side of the rescuers (prompting the captors to shoot the escaping hostage). I'd really like to put something like this into my mission.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Hostage script.
« Reply #1 on: 19 Feb 2003, 21:34:57 »
You can make this happen with a simple trigger.

Create your rescue group
  -type 'rescuegrp=group this' in the group leaders init field

Create your hostage unit and name him as 'hostage'
  -type 'this setcaptive true' to his init field

Create a trigger on top of him with a 20x20 radius.
  -press F2 and group the trigger with the group who is trying to rescue him
  -type 'hostage setcaptive false; [hostage] join rescuegrp' in the triggers on    activation field

and voilá. you now have a trigger which will make a neutral hostage join your group and make getting shot at by the enemy  ;)
Not all is lost.

Baphomet

  • Guest
Re:Hostage script.
« Reply #2 on: 20 Feb 2003, 00:50:02 »
Well that's not too bad then heh. I guess this could've been placed in the generic editing section. Only I have a problem. I think I've done something wrong. Because the hostage immediately joins the group regardless of whether I'm near the trigger. I set the trigger to a radius, and is the f2 thing the blue line that connects to the person whom the trigger is to affect? If so then I did that. However he still doesn't stay put... and that's half my mission, fighting through a city to get this guy out and keep him from getting shot.


EDIT

Sorry I had messed up somehow and for some reason the trigger wasn't grouped properly. All's well now. Thanks again.  ;D
« Last Edit: 20 Feb 2003, 02:56:07 by Baphomet »