Page 1 of 1

My ai keeps jumping from one exec to another. I think.......

Posted: Thu Jan 29, 2004 4:43 am
by small_sumo
My ai keeps jumping from one exec to another. He like runs then dives run then dive all the way to where he has to go. But sometimes he seams to just do the prone like he should. This is the code.

Your thoughts please.

:)

poor_buggers_7:

local.dude = spawn "human/sumo_allied_redarmy_infantry.tik" origin $whatever_7.origin targetname "mysoldier_7"

waitframe

local.dude.weapon = "none"
local.dude.enableEnemy = 0
local.dude exec global/crouchrunto.scr $fodder_node_3b
local.dude waittill movedone
local.dude exec global/pronewalkto.scr $fodder_node_3
while (IsAlive local.dude)
waitframe

goto poor_buggers_7

Posted: Thu Jan 29, 2004 2:36 pm
by vonderbakluft
It looks like that the movedone event is fired inmediately.

Did you already tried to given them some movedoneradius to see what happens then? e.g.

local.dude.movedoneradius = 16

btw if you cannot get it working you can try this kinda dirty workaround:

local.dude = spawn "human/sumo_allied_redarmy_infantry.tik" origin $whatever_7.origin targetname "mysoldier_7"

waitframe

local.dude.weapon = "none"
local.dude.enableEnemy = 0
local.dude exec global/crouchrunto.scr $fodder_node_3b
while !(vector_within local.dude $fodder_node_3b 16)
waitframe

local.dude exec global/pronewalkto.scr $fodder_node_3
while !(vector_within local.dude $fodder_node_3 16)
waitframe

and so on....

Von

Posted: Fri Jan 30, 2004 1:24 am
by small_sumo
Wow thanks man, looks good at a glance. Better go try it now.

:)

Posted: Fri Jan 30, 2004 7:15 am
by jv_map
That's not a dirty work-around von, it is usually required :wink:

This would be even better:

Code: Select all

while(isAlive local.dude && !(vector_within local.dude $fodder_node_3b 16))
{
  local.dude moveto anim/crouch_run.scr $fodder_node_3b
  local.dude waittill movedone
}
if !(isAlive local.dude)
  continue // use a while loop instead of goto

Posted: Fri Jan 30, 2004 9:02 am
by small_sumo
Wow I didnt know continue was a command. Yer that goto is very naughty.

:oops:

Thanks JV.