bouncing between waypoints

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
masstic1es
Posts: 19
Joined: Thu Feb 13, 2014 11:11 pm

bouncing between waypoints

#1 Post by masstic1es » Thu Feb 13, 2014 11:22 pm

I'm going to preface all of this with "I'm new" and not just to this, but to coding in general.

So I've been messing around building my own dailies script that collects quests, turns them in, and gets the items if its low or out. This was done through reading through the forums and dissecting other peoples waypoint files to help build my own understanding. So now some questions.

is it possible to use loadpaths() to load not only a new file, but a specific waypoint tag in the file? or better yet, can I make one section of waypoints loop until conditions are met? I had tried to get that to work (the loop) but the start and end were too close? so when it loaded the tag it would go from 1 to like 2 and back to 1, instead of 1 to 20 and back to 1 (as an example, and the loop() was set on the last waypoint)

maybe I'm just missing something obvious =/, any helps would be awesome. Or heck, even just a nudge in the right direction!

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: bouncing between waypoints

#2 Post by ZZZZZ » Thu Feb 13, 2014 11:43 pm

I believe you can use

Code: Select all

	<!-- #  6 --><waypoint x="xxx" z="zzz" y="yyy">
loadPaths("waypoint")
__WPL:setWaypointIndex(__WPL:findWaypointTag("tag"))
</waypoint>
I think it finish's executing what is in that waypoint before turning full control over to the newly loaded waypoint.....not 100% sure though.

If you're trying to go back and forward between 2 waypoints you can use either

Code: Select all

<!-- #  1 --><waypoint x="xxx" z="zzz" y="yyy" tag='tag'>
-- do stuff
</waypoint>
<!-- #  2 --><waypoint x="xxx" z="zzz" y="yyy">
__WPL:setWaypointIndex(__WPL:findWaypointTag("tag"))
</waypoint>
to move to a different part in your waypoint (eg, finished dailies and want to leave, so go to tag 'Done' and return to varanas etc.
or

Code: Select all

<!-- #  1 --><waypoint x="xxx" z="zzz" y="yyy" tag='tag'>
__WPL:setDirection(WPT_FORWARD);
</waypoint>
<!-- #  2 --><waypoint x="xxx" z="zzz" y="yyy">
if queststatus ~= "complete" then
__WPL:setDirection(WPT_BACKWARD);
end
</waypoint>

masstic1es
Posts: 19
Joined: Thu Feb 13, 2014 11:11 pm

Re: bouncing between waypoints

#3 Post by masstic1es » Fri Feb 14, 2014 1:00 am

Thanks for the reply :)

The first one had an error when I tried to run it, the other 2 didn't quite work how I wanted. I ended up creating an entirely separate file for all return paths, since it should start at the closest and follow it till I tell it otherwise.

still curious if there is a way to start at a specific tag when you loadPaths() though :P

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: bouncing between waypoints

#4 Post by lisa » Fri Feb 14, 2014 1:15 am

that is where you use the onload on the Wp being loaded.

example

Code: Select all

<onload>

if player.Level > 29 and 51 > player.Level then
__WPL:setWaypointIndex( __WPL:getNearestWaypoint(player.X, player.Z, player.Y ) );
else 
player:sleep()
end
</onload>
or something as simple as

Code: Select all

<onload>
__WPL:setWaypointIndex(1);
</onload>
an example of how a simple onload would look in a WP is like this

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>

changeOptionFriendMob("mob", "Agile Shadow Mink", "Add")

</onload>
	<!-- #  1 --><waypoint x="3404" z="12131" y="203">	</waypoint>
	<!-- #  2 --><waypoint x="3438" z="11606" y="205">	</waypoint>
	<!-- #  3 --><waypoint x="3499" z="11235" y="202">	</waypoint>
	<!-- #  4 --><waypoint x="3545" z="10872" y="203">	</waypoint>
	<!-- #  5 --><waypoint x="3504" z="10486" y="203">	</waypoint>
	<!-- #  6 --><waypoint x="3975" z="10575" y="203">	</waypoint>
	<!-- #  7 --><waypoint x="4301" z="10704" y="208">	</waypoint>
</waypoints>
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

masstic1es
Posts: 19
Joined: Thu Feb 13, 2014 11:11 pm

Re: bouncing between waypoints

#5 Post by masstic1es » Fri Feb 14, 2014 3:04 am

Thank you very much Lisa, that was more inline with what i was looking for. Soooo much to learn! :shock:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest