AI question 2

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

AI question 2

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :(
Image
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post by digitac »

jv can u plstell me some how to's ?
and pls why did u blocked me on msn ?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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:
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
}
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply