Page 1 of 1

ai:patrol problem

Posted: Sun Feb 22, 2004 4:14 pm
by tsensor
i noticed that command 'wait xx' necessary

it is similar 'move' and 'wait'
....
i need same command as 'waitmove'
(wait until command end)




this is a part of my scr:

//-----
// testway
//----
testway:
$badguy runto $test1
iprintln "1"
wait 10
$badguy runto $test2
iprintln "2"
wait 10

goto testway

end


example, if suppose badguy consume 4second when move from $test1(info_pathnode's targetname) to $test2, and i type 'wait 2' in my scr,
then badguy return when he moved half distance of path.




sorry that my strange english

thanks

Posted: Mon Feb 23, 2004 9:19 am
by bdbodger
Try waitmove after the runto line

$badguy runto $test1
$badguy waitmove

That should make the script wait for him to get to $test1

Posted: Mon Feb 23, 2004 9:39 am
by williewisp
testway:
$badguy runto $test1
iprintln "1"
wait 10
$badguy runto $test2
iprintln "2"
wait 10

goto testway


there is another prob wit this code if the badguy is dead the code will still loop.

do a search

i posted a script of a level it shud have wat you looking for i think the post was called "tidy up" jv 8-) had a gud reply to that part of the script.

:wink:

Posted: Mon Feb 23, 2004 9:49 am
by williewisp

bdbodger please look this

Posted: Mon Feb 23, 2004 11:38 am
by tsensor
//----
// badguy2move
//----
badguy2move:
$badguy2 runto $ppath1
$badguy2 waitmove

$badguy2 runto $ppath2
$badguy2 waitmove

end





above scr successful
thankyou for teaching me

but i want infinitely move
so i added follow line:

goto badguy2move

when i make server my map,game freeze while loading

i want recycle

Posted: Mon Feb 23, 2004 11:44 am
by crunch
goto badguy2move creates an infinite loop in your script, and that is why the server crashed.

I don't know for sure the correct way to do it, but I think it's:
badguy2move:

while (isAlive $badguy2)
{
$badguy2 runto $ppath1
$badguy2 waitmove

$badguy2 runto $ppath2
$badguy2 waitmove
}
end


That should keep him patrolling as long as he is not dead.