Page 1 of 1
Selecting path when starting the 1-10Pioneers route
Posted: Mon Mar 28, 2011 10:07 am
by CrazyGuy
Had a quick question, sometimes ive got to stop the bot for one reason or another when im running the 1-10Pioneers route. I wanted to put in a chunk of code at the beginning that would select the correct path for me without having to run all the way back to pioneers but its not working, can anyone offer some guidance? I am putting it in l1t_start.xml after the <waypoints> but before the first waypoint.
<onLoad>
if( player.Level == 2 || player.Level == 3 ) then
loadPaths("1-10Pioneers/l3t_3-4_bear");
end
if( player.Level == 4 || player.Level == 5 ) then
loadPaths("1-10Pioneers/l4t_5-7_beetle");
end
if( player.Level == 6 || player.Level == 7 || player.Level == 8 ) then
loadPaths("1-10Pioneers/l7t_7-9_boar");
end
if( player.Level > 8 ) then
loadPaths("1-10Pioneers/l9t_9-10_bugs");
end
</onLoad>
Re: Selecting path when starting the 1-10Pioneers route
Posted: Mon Mar 28, 2011 11:00 am
by lisa
Very easy solution to this is to make 1 long WP that goes from one end to the other. In this case the human start point to around where the boars are at the top of the map.
Just follow the road is easiest way and place your waypoints locations at gaps between fences. At these spots have your code check your character lvl and if it's the level you want send it out to another WP to kill stuff.
I had a topic about this a while back, not sure if I could find it again lol
Edit: found it
http://www.solarstrike.net/phpBB3/viewt ... =21&t=2117
Re: Selecting path when starting the 1-10Pioneers route
Posted: Mon Mar 28, 2011 11:07 am
by CrazyGuy
Thanks

Ill just make one long wp, but i was curious why what i had created didnt work. Is there anything you can see right off the back that would cause it not to?
Re: Selecting path when starting the 1-10Pioneers route
Posted: Mon Mar 28, 2011 12:21 pm
by lisa
Well I have never used || in any of the stuff I've done so might be that.
Code: Select all
( player.Level == 6 || player.Level == 7 || player.Level == 8 )
I'd probably do it like this myself
Code: Select all
(player.Level >= 6 and 8 >= player.Level)
having said that you do realise if your bot is in a lower area and and a high lvl then it will try to walk straight to the nearest WP in the higher lvl WP. That is why you have a nice long WP to link them all together =)
I don't remember if I posted my 1-10/10 WP files or not, I might have a look and see and if I didn't I'll tidy them up a bit and post them.
Basically I set it up so the bot can disconnect or die at any stage from 1-10/10 and when loaded up again or resurrected it would just continue on to where it should be with no user input or working out where you are.
It was a challenge I was given ages ago, took me a while to get it going smoothly too lol
Re: Selecting path when starting the 1-10Pioneers route
Posted: Mon Mar 28, 2011 12:58 pm
by Administrator
As already stated, || is not valid in Lua. Use 'or' instead.