Home   Help Search Login Register  

Author Topic: Hostage Running Away  (Read 1087 times)

0 Members and 1 Guest are viewing this topic.

Offline terran4999

  • Members
  • *
Hostage Running Away
« on: 27 Dec 2008, 05:54:21 »
Hey

I am trying to make a hostage rescue mission but my hostages keep running away after i save the game and then load it. I tried "this disableAI "ANIM"" and "this setcaptive true" but they both loss affect after i load the saved game.
« Last Edit: 27 Dec 2008, 06:23:57 by terran4999 »

Offline ModestNovice

  • Members
  • *
Re: Hostage Running Away
« Reply #1 on: 27 Dec 2008, 07:50:24 »
put this in the initialization of the hostage. Also, name the hostage myhostage.
Code: [Select]
m = [myhostage] execVM "hostageStay.sqf"
hostageStay.sqf
Code: [Select]
_unit = _this select 0;
_oldPos = getPos _unit;

while {alive _unit} do
{
_newPos = getPos _unit;

if (_newPos distance _oldPos >= 3) then
{
_unit setPos [getPos _oldPos select 0, getPos _oldPos select 1, getPos _oldPos select 2];
};
Sleep 1;
};
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley