Page 1 of 2

How to mark a waypoint to not be skipped

Posted: Wed Aug 17, 2011 3:54 pm
by Mushroomstamp
Is there some way to mark specific waypoints so that they aren't skipped if overrun?

Re: How to mark a waypoint to not be skipped

Posted: Thu Aug 18, 2011 12:25 am
by rock5
Why?

Re: How to mark a waypoint to not be skipped

Posted: Mon Aug 22, 2011 11:29 am
by Mushroomstamp
Because if it skips a waypoint, it skips all the code that's supposed to be executed at that waypoint. Could miss a repair or pot restock, waypoint direction change, quest turn-in, etc.

Re: How to mark a waypoint to not be skipped

Posted: Mon Aug 22, 2011 8:41 pm
by rock5
If a waypoint is skipped it still executes any code from it.

Re: How to mark a waypoint to not be skipped

Posted: Mon Aug 22, 2011 11:13 pm
by lisa
Pretty sure the code isn't done if the waypoint is skipped.

Been playing with a new WP today and it skipped the waypoint with the quest check function, so it didnt check the quest status at all and tried to run to the next coords which is in an entirely diff map lol

Re: How to mark a waypoint to not be skipped

Posted: Mon Aug 22, 2011 11:24 pm
by lisa
I might do some work on this next week as an option. I find myself doing a WP with coords close together because of the place I'm in and being small corridors and such. It tries to skip waypoints occasionally after a fight and it never works out well.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 12:11 am
by rock5
lisa wrote:Pretty sure the code isn't done if the waypoint is skipped.
There is definately code for it. This is the part that deals with skipped waypoints.

Code: Select all

					-- if next waypoint is 'in front' of current waypoint
					if( math.deg(angleDif) > settings.profile.options.WAYPOINT_PASS_DEGR ) then	-- default 90
						if (settings.profile.options.DEBUG_WAYPOINT) then
							cprintf(cli.yellow, "[DEBUG] We overrun waypoint #%d, skip it and move on to #%d\n",currentWp.wpnum, nextWp.wpnum);
						end
						cprintf(cli.green, "We overrun waypoint #%d, skip it and move on to #%d\n",currentWp.wpnum, nextWp.wpnum);
						WPLorRPL:advance();	-- set next waypoint

						-- execute the action from the skiped wp
						if( currentWp.Action and type(currentWp.Action) == "string" ) then
							local actionchunk = loadstring(currentWp.Action);
							assert( actionchunk,  sprintf(language[150], WPLorRPL.CurrentWaypoint) );
							actionchunk();
						end

					end
Did you get the "We overrun waypoint" message?

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 1:54 am
by Mushroomstamp
lisa wrote:It tries to skip waypoints occasionally after a fight and it never works out well.
Exactly... I currently use two of the same waypoint when I find one that gets skipped frequently.
rock5 wrote:Did you get the "We overrun waypoint" message?
Yes, it prints the message but does not execute the code.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 3:17 am
by lisa
prob just as easy to have a profile option and use it on the code that does the skip.
if profile option doesn't exist(false) then do as usual and skip.

That way if the profile option does exist then it won't skip.
Can easily set the "profile" option in the WP.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 4:26 am
by rock5
I managed to do a test. I put a print statement saying "wp2 code executed" in waypoint 2. Here is the output

Code: Select all

Fight finished. Killed 2 Domesticated Boshi. (fight #2 / runtime 0 minutes)
Clearing target.
We overrun waypoint #2, skip it and move on to #3
wp2 code executed
Moving to waypoint #3, (-14550, 34368)
See, it does work.

There must be some other reason why you're not seeing it work. Does the code require you to be at the waypoint for it to work? Like talking to an NPC?

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 4:29 am
by lisa
nah I just do a check for quest complete and out of combat, I guess if it checks while it was still in combat, which I didn't think it would.

Code: Select all

function quest()
		local queststate = getQuestStatus("The Garrison's Request")
        	if queststate == "complete" and (not player.Battling) then
		RoMScript('CastSpellByName("Heffner Camp Transport Spell")')
		waitForLoadingScreen();
		player:target_NPC("Snoop the Stubborn");
		sendMacro("ChoiceOption(2);");
		yrest(1000)
		sendMacro('StaticPopup_OnClick(StaticPopup1, 1);')
		waitForLoadingScreen();
		__WPL:setWaypointIndex(__WPL:findWaypointTag("varanas"));
		end
end

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 5:37 am
by rock5
I didn't think it would either but either 'queststate == "complete"' or '(not player.Battling)' must be false because if it entered the if statement and didn't teleport then it would have got stuck in the waitForLoadingScreen function.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 8:57 am
by lisa
quest was deff complete each time I saw it skip waypoints, so it must be the in combat. Can't use the teleport skill while in combat which is of course why I have the check.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 9:00 am
by Dsanchez
I've been playing around with waypoints a little bit and have had this problem also where it would skip a waypoint and not execute the code on the previous waypoint.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 9:29 am
by rock5
Dsanchez wrote:I've been playing around with waypoints a little bit and have had this problem also where it would skip a waypoint and not execute the code on the previous waypoint.
Skipped waypoint code does execute. Maybe it just seemed to not run like it did for Lisa. What was the code? Maybe we can figure out why didn't work.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 9:43 am
by lisa
I still like the idea of having a "profile" type option to set it to always go in order, obviously default would be to skip but you could set the option in WP onload or even a waypoint# and then set it back later to skip even in the same WP file.

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 9:56 am
by rock5
lisa wrote:I still like the idea of having a "profile" type option to set it to always go in order, obviously default would be to skip but you could set the option in WP onload or even a waypoint# and then set it back later to skip even in the same WP file.
So what you are saying is you want an option so it doesn't skip the waypoints, so it always goes to the waypoints even if it has to go backwards?

I guess the purpose of that would be if you have code at the waypoint that requires you to be at the waypoint?

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 10:14 am
by lisa
And when you are going through tight corridors with lots of turns and obsticles lol

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 10:30 am
by Mushroomstamp
Saw this in the posted code;

Code: Select all

settings.profile.options.WAYPOINT_PASS_DEGR ) then   -- default 90
Couldn't we do something like;

Code: Select all

<option name="WAYPOINT_PASS_DEGR"	value="180" />
in a profile to double the distance required for it to skip a WP?

Re: How to mark a waypoint to not be skipped

Posted: Tue Aug 23, 2011 10:36 am
by rock5
Mushroomstamp wrote:Saw this in the posted code;

Code: Select all

settings.profile.options.WAYPOINT_PASS_DEGR ) then -- default 90
Couldn't we do something like;

Code: Select all

<option name="WAYPOINT_PASS_DEGR" value="180" />
in a profile to double the distance required for it to skip a WP?
I noticed the same thing but I think that value is an angle. I think the value you could use is

Code: Select all

settings.profile.options.WAYPOINT_PASS
It defaults to 100 and only skips the waypoint if the distance to the waypoint is less than this value. So setting it to 0 would stop it skipping I think.