Page 1 of 1

AI question 2

Posted: Wed Jan 21, 2004 2:33 pm
by digitac
Hi m8's

I've got this question

How can i spawn an allies airborn that if an allies is standing in front of him he will salute
and if an axis is coming close it will start shooting ?

Greetz DigitaC

Posted: Wed Jan 21, 2004 7:00 pm
by jv_map
I don't think there's a really easy way to do it.... you'll need to script all of the events yourself I think :(

Posted: Wed Jan 21, 2004 7:12 pm
by digitac
jv can u plstell me some how to's ?
and pls why did u blocked me on msn ?

Posted: Thu Jan 22, 2004 6:50 am
by jv_map
digitac wrote:and pls why did u blocked me on msn ?
I did? :? hmm what's your msn id?

Well anyway you need some code to check continuously if an Allied AI/player is near your saluting guy, then if so, turn to him and do the saluting animation... that is only if he's not yet attacking someone :). Ofcourse you'll need some code to prevent him from 'chain-saluting' :wink:

Posted: Mon Feb 02, 2004 4:37 am
by nuggets
while (1)
{
for (local.i=1;local.i<=$player.size;local.i++)
{
if !($player[local.i].saluted = 1)
{
if ($blokey can see $player[local.i] 360 256)
{
$blokey turnto $player[local.i]
wait .75
$blokey anim salute //you'll need to check the anim name
iprintln_noloc "saluting"
$player[local.i].saluted = 1
$blokey waittill animdone
}
}
}
wait 2
}