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

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

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

Post 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
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
vonderbakluft
Corporal
Posts: 46
Joined: Fri Aug 01, 2003 11:15 am
Location: NL
Contact:

Post 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
Real mappers map in wordpad ;-)
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Wow thanks man, looks good at a glance. Better go try it now.

:)
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Wow I didnt know continue was a command. Yer that goto is very naughty.

:oops:

Thanks JV.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Post Reply