Can I script spawners or ai to follow a tank and keep inside a certain random range? My tank will follow a path and I want the ai to follow, maybe even crouch now and again so they look better.
Thanks
Get ai to follow a tank
Moderator: Moderators
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
There is a command tether that is suppose to tether an ai's leash to an entity . I think I tried it once don't know if I got it to work or not . You might try glueing or binding or attaching a script origin to the tank and have the ai run to it like this .
$myorigin glue $tank
// or
$myorigin bind $tank
// or
$tank attachturretslot 0 $myorigin // I think you can have two things attached at once
while ( isalive $myai )
{
while( vector_length ( $myai.origin - $myorigin.origin ) < 128)
{
if ( vector_length ( $myai.origin - $myorigin.origin ) < 512 )
$myai exec global/crouchrunto.scr $myorigin
else
$myai exec global/runto.scr $myorigin
$myai waittill movedone
}
$myai exec global/stand.scr
waitframe
}
$myorigin glue $tank
// or
$myorigin bind $tank
// or
$tank attachturretslot 0 $myorigin // I think you can have two things attached at once
while ( isalive $myai )
{
while( vector_length ( $myai.origin - $myorigin.origin ) < 128)
{
if ( vector_length ( $myai.origin - $myorigin.origin ) < 512 )
$myai exec global/crouchrunto.scr $myorigin
else
$myai exec global/runto.scr $myorigin
$myai waittill movedone
}
$myai exec global/stand.scr
waitframe
}
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
