Hey guys tried a search and didnt find much,
Could anyone tell me how i would have say 4 hostages behind enemy lines and the allies must rescue them and take them back to a truck where the mission will end as the hostages will be safe?
Cheers in advance
Wilson
Hostage Rescue
Moderator: Moderators
hmmm you could try sort of binding the hostage AI to the player, with a triggger where u press use to bind (i.e. follow). I suppose the trigger could do both the objective and the bind trigger - just a suggestion i dunno if it will work.
"We must become the change we want to see in the world" (Mahatma Gandhi)
I did something like that in my map The_rescue . There is a link to it here at .map you can do a search for it . Here is the part that makes the guy follow
I just hacked apart of the global/friendly.scr as I remember
Code: Select all
ai_follow local.guy:
self.distance = 64
self.waittime=1
self.friendrange = 128
local.dmteam = local.guy.dmteam
while (( isalive local.guy )&&(local.guy.hasguy==1)&&( local.guy.dmteam == local.dmteam))
{
self waitthread follow_player local.guy
}
self thread deactivate_prisoner local.guy
end
////////////////////////////////////////////////////////////
follow_player local.followed:
self.destination = local.followed
local.movethread = -1
self.movedoneradius = self.distance
if (vector_length (self.destination.origin - self.origin) > self.distance + self.friendrange)
{
self runto self.destination.origin
local.stand = 0
self waittill movedone
if !(self.destination)
self.destination = null
if (vector_length (self.destination.origin - self.origin) < self.distance + self.friendrange)
{
self exec global/stand.scr
}
}
else
{
if (local.stand == 0)
{
self exec global/stand.scr
local.stand = 1
}
wait 1
}
if (vector_length (self.destination.origin - self.origin) > self.distance + self.friendrange)
{
self runto self.destination.origin
local.stand = 0
thread movedone
local.movethread = parm.previousthread
}
if ((local.movethread != -1) && (local.movethread != NIL))
local.movethread delete
local.dest = self.destination.origin
local.runnertime = level.time + 2
while (((self.movedone == 0) && (vector_length (local.dest - self.origin) > (self.distance + self.friendrange))) && (local.runnertime > level.time))
{
if (self.waittime == -1)
waitframe
else
wait self.waittime
}
end