Page 1 of 1

Will loadpaths return to waypoint file that called?

Posted: Mon Jul 26, 2010 11:46 am
by ou81too
In the following scenario

Code: Select all

waypoint 1
waypoint 2
	if need repair
		loadpaths("repair")
	endif
waypoint 3
waypoint 4
waypoint 5
if the script enters the loadpaths("repair") in waypoint 2, does the script continue with waypoint 3 after finishing with "repair.xml"? Or do I need to add a loadpaths() in my "repair.xml" to have it return to the original waypoint file?

I'm trying to have a generic "repair.xml" that multiple waypoint files could use if I didn't have to add a loadpaths() back to the calling waypoint file.

Re: Will loadpaths return to waypoint file that called?

Posted: Mon Jul 26, 2010 12:23 pm
by rock5
ou81too wrote:In the following scenario

Code: Select all

waypoint 1
waypoint 2
	if need repair
		loadpaths("repair")
	endif
waypoint 3
waypoint 4
waypoint 5
if the script enters the loadpaths("repair") in waypoint 2, does the script continue with waypoint 3 after finishing with "repair.xml"? Or do I need to add a loadpaths() in my "repair.xml" to have it return to the original waypoint file?

I'm trying to have a generic "repair.xml" that multiple waypoint files could use if I didn't have to add a loadpaths() back to the calling waypoint file.
No, you have to put a returning loadpaths() in the "repair.xml" script. I'm not sure how you could use a generic "repair.xml". It wouldn't be that useful in most cases anyway as repair scripts usually need to travel from the farming area to the repair npc and back and that will be different for each waypoint file.

To reduce the number of waypoint files, what I like to do is combine the repair script with the main waypoint file. These are the steps I take.

1. Start at the location you want to check if you need repairs.
2. Create your farming waypoints as normal (eg. killing mobs or harvesting) until you return to where you started. For this example lets assume you create points 1-10.
3. Take note of the waypoint number ie. 10 and continue to the repair npc. Target the npc then return to the starting point. Lets assume you created another 6 points from 11-16 where point 13 is where you targeted the npc.
4. Save the file then edit it something like this.

Code: Select all

<waypoint 1>
<waypoint 2>
....
<waypoint 9>
<waypoint 10>if (you don't need repair) then goto waypoint 1
<waypoint 11>
<waypoint 12>
<waypoint 13>player:merchant(npc)
<waypoint 14>
<waypoint 15>
<waypoint 16>
Of course this is not an actual waypoint file but what it does is keep looping from 1-10 until it needs repair. Then it travels to the repair npc, returns to the starting point and continues to point 1.

I find this a simple way of doing it. Hope that helps