ai:patrol problem

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
tsensor
Sergeant
Posts: 52
Joined: Wed Feb 11, 2004 1:25 pm

ai:patrol problem

Post 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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
User avatar
williewisp
First Lieutenant
Posts: 208
Joined: Fri May 16, 2003 1:10 pm
Location: ireland

Post 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:
it's not a time for thinking its a time for drinking!
User avatar
williewisp
First Lieutenant
Posts: 208
Joined: Fri May 16, 2003 1:10 pm
Location: ireland

Post by williewisp »

it's not a time for thinking its a time for drinking!
tsensor
Sergeant
Posts: 52
Joined: Wed Feb 11, 2004 1:25 pm

bdbodger please look this

Post 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
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

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