Page 1 of 1

Error when loading New waypoint or path

Posted: Mon Nov 28, 2011 7:40 am
by zarakie
Hi I'm Running some bot to farm Ks i had the way points divided by 3 files
Ks.xml
Ks-res--pancer.xml
then ks-pancer-to-ks.xml

now I start inside ks ofc and run the waypoint KS its wrote to leave party before first boss then load the other Path from Res Point to the seller . now when The bot start to load new path or waypoint .. strange things happens my Character keep dying at Res point Or start moving in random way . same things happen if load file from ks-pancer-to-ks to Ks file ... im sure each file alone work okay but togther they not..


I tried to run each path alone its works fine but the moment it load the other problems happens again ...

Re: Error when loading New waypoint or path

Posted: Mon Nov 28, 2011 7:57 am
by rock5
I noticed something similar when I used my elfdaily script recently. I didn't die but it moved strangely and did unsticks after reloading the waypoint file after changing character. I don't know what caused it but i fixed it by adding.

Code: Select all

			-- Re-initialize player
			player = CPlayer.new();
			settings.load();
			settings.loadProfile("userdefault"); -- Profile name
Just after it reloaded the file. Try it and see if it helps. Obviously you would load the correct profile or use player.Name as the profile name.

If this fixes it for you then I'll have to look further into what's happening.

Re: Error when loading New waypoint or path

Posted: Wed Nov 30, 2011 8:02 am
by ratzuk
Been having similar problems myself when changing characters. After cycling through 3 or 4 characters screen would start zooming in and out, bot would loose position and think it was stuck and log out so have been searching forum for a solution.

Adding Rock's code to the onLoad section of the waypoint file that was causing problems solved it. Thanks :)

Re: Error when loading New waypoint or path

Posted: Wed Nov 30, 2011 9:06 am
by rock5
Ok so I found the problem.

A change I made, not long ago, to make sure that pawns that become invalid are detected by checking for changed ids, is interfering with character changing. Because player IDs do change.

It's fixed in revision 677.

So you no longer need to reinitialize 'player'.