Jump to content
Sign in to follow this  
Junker

Random route script

Recommended Posts

when i put this command in a trigger it works great:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">bmp commandmove getmarkerpos "wp1"

But when i use it in a script the stoopid AI sit there and do anything but act Stoopid.   Why rock.gif

script code:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tank = _this select 0

_way1 = _this select 1

_way2 = _this select 2

_pos = getmarkerpos "_way1"

_pos2 = getmarkerpos "_way2"

~2

_i = random 2

? _i <= 1 : goto "dir1"

goto "dir2"

#dir1

_tank commandmove getmarkerpos "_pos"

~10

? speed _tank < 30 : goto "dir1"

exit

#dir2

_tank commandmove getmarkerpos "_pos2"

~10

? speed _tank < 30 : goto "dir2"

exit

BTW im on version 1.92  ;)

Share this post


Link to post
Share on other sites

_pos and _pos2 aren't markers, they're arrays, so getmarkerpos won't work.

ie

_tank commandmove getmarkerpos "_pos"

_tank commandmove getmarkerpos "_pos2"

aren't valid commands.

Suggest you change to

_tank commandmove getpos _pos

_tank commandmove getpos _pos2

(no quotes)

Chrs

jl

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×