Page 6 of 8

Re: Rock5's travelTo userfunction

Posted: Mon Jul 06, 2015 12:28 pm
by rock5
Works fine for me. I posted an updated version recently. Have you updated?

Re: Rock5's travelTo userfunction

Posted: Mon Jul 06, 2015 5:09 pm
by beanybabe
I got latest now I will give it a spin.

Re: Rock5's travelTo userfunction

Posted: Mon Jul 06, 2015 7:09 pm
by beanybabe
Im thinking you need to add a line to travelto
so if it uses a portal
that it does update:player() before it returns to the running wp.

or something so it sets the current player wp to where it is. then exit the function.

Re: Rock5's travelTo userfunction

Posted: Mon Jul 06, 2015 7:34 pm
by beanybabe
beanybabe wrote:Im thinking you need to add a line to travelto
so if it uses a portal
that it does update:player() before it returns to the running wp.

or something so it sets the current player wp to where it is. then exit the function.

I looked at the code and the problem was in gotoPortal() I edited mine and added the line rock sugested to update player location. __WPL.setWaypointIndex(__WPL:getNearestWaypoint())
some of the other portal functions may need the same change.

Code: Select all

83	if closestObject then
84		print("Targeting portal "..closestObject.Id..", range "..distance(player.X,player.Z,closestObject.X,closestObject.Z))
		__WPL.setWaypointIndex(__WPL:getNearestWaypoint())     ---  add this line here.
		return movetoportal(closestObject)
	else
		print("Portal not found within range of "..tostring(_range))
		return false
	end

	

Re: Rock5's travelTo userfunction

Posted: Tue Jul 07, 2015 3:09 am
by rock5
It's probably not a good idea to change that in the userfunction. When using travelTo in a waypoint the next waypoint is where it will go. So you don't need to find the nearest waypoint and in fact doing so might cause unexpected results. You only need to set the nearest waypoint if you use travelTo in the onload. So I would just add that line in the onload after the travelTo.

Re: Rock5's travelTo userfunction

Posted: Tue Jul 07, 2015 8:48 am
by beanybabe
i changed it in mine now all the portals seem to work right, I think this has been what is causing people problem with portals.

Re: Rock5's travelTo userfunction

Posted: Tue Jul 07, 2015 9:08 am
by rock5
GoToPortal just goes to the portal, it doesn't check if it works, it doesn't wait for the loading screen and doesn't update the player. That is why I created GoThroughPortal. In most cases I would use that. It waits for the loading screen, waits 3 seconds then updates player. It also checks whether the teleport worked and returns true or false so you could, for instance, have it try again if it fails. GoThroughPortal is the complete package. You would use GoToPortal only if you wanted to use your own method to check if it worked so you would also have to include a waitForLoadingScreen and player:update.

Re: Rock5's travelTo userfunction

Posted: Sat Jul 11, 2015 12:21 pm
by Bill D Cat
Okay, I think I was a bit premature on saying the function works for new Dwarven characters. It doesn't. :cry:

The problem is this; while you can transport from Yrvandis Hollows to Varanas via Snoop by using the dialog options, you have not yet technically activated the Varanas portal. I think this is why the travelTo userfunction is not working for new Dwarves. It checks in memory (or however) to see what hubs are available and doesn't yet see Varanas. If you have picked your second class, it will transport to Reifort Camp, then use the Ailic's Aide to go to Obsidian. That's where it stops working because neither Varanas or Heffner Camp are available. If you haven't yet picked your second class then you have no additional transport options and it just ends without transporting.

I think there may need to be a check for getZoneId = 31 (Yrvandis Hollows) and player.Race = 2 (Dwarf) then assume the Varanas portal is available and transport via Snoop's dialog options.

Re: Rock5's travelTo userfunction

Posted: Sat Jul 11, 2015 1:31 pm
by rock5
The function has override assumed links. We can just add Yrvandis Hollows the the list of assumed links. In the hub list we can just add Yrvandis to the AutoLinkFrom

Code: Select all

	Varanas = {Offset=0x0, Bit=4, AutoLinkFrom={"VaranasBridge","Heffner","Yrvandis"}},
Try that.

Re: Rock5's travelTo userfunction

Posted: Sat Jul 11, 2015 6:34 pm
by beanybabe
I am having trouble with that portal into drill again. I just applied that new update.
enter drill then
If I just run this

loadPaths("any xml file.xml");


it works ok


but if I run this it will Not start the xml file

Code: Select all

			if getZoneId() == 401 and getCurrency("honor") == 0 then	
					GotoGuild("Drill Ground");  
					player:target_Object("Drill Ground"); 
					sendMacro("ChoiceOption(1);");
					waitForLoadingScreen();
					 loadPaths("any xml file.xml");
				end	

Re: Rock5's travelTo userfunction

Posted: Sun Jul 12, 2015 3:16 am
by rock5
If you are not in zone 401 it will skip that code. Make sure it's the right zone.

Re: Rock5's travelTo userfunction

Posted: Sun Jul 12, 2015 6:58 am
by beanybabe
its strange some times it works but usually the second time and after it fails.
I wrote the code a few ways to start the called wp outside the instance then have it enter.

i wrote it for the main to enter then call the wp

no matter how I did it it would not start the wp running.

but if i enter or start outside depending on the revision both work ok
they only fail if i call them from another program and try to enter drill ground

I have seen other people posting on something like this in other zones with portals
it worked a bit when i patched the function to use portals but that did not help today.

also if you enter and call a wp it always seems to want to jump past the first and go to one further in this only happens the few times it actually starts and may be a clue as to were to look for the problem.


i ripped all the code apart and made it all into one large wp I removes all the checks for honor and now I have it working it will log 1 char to the next and mail stuff when its done. Its good enough for now but Id like to get it to check gold and honor some day.

Re: Rock5's travelTo userfunction

Posted: Mon Jul 13, 2015 2:23 am
by rock5
Try adding print messages to figure out where it is failing and what is happening.

Is it possible that waypoint 1 and 2 are very close to one another?

Re: Rock5's travelTo userfunction

Posted: Wed Jul 15, 2015 1:18 am
by beanybabe
on Second thought this is to much to code...
Found something you might add to world traveler.

If character had never been to stronghold, it will not show up on Varanas portal.
second class is needed to get the reiford portal.

If you add a check for stronghold on Varanas portal then if it had not been there have it
port to Reiford
then Stronghold
then have it click snoop at stronghold and
continue with what it was doing.

---------------------------------
I notice it will detect if you start by npc to dogs
but not at mail boxes in many areas

Re: Rock5's travelTo userfunction

Posted: Wed Jul 15, 2015 2:12 pm
by rock5
Firstly worldtraveler is a different userfunction than mine. Don't get them mixed up. Secondly I believe travelTo will use recall to Reifort or Heffner when necessary. So it should already do what you describe.

Re: Rock5's travelTo userfunction

Posted: Thu Jul 16, 2015 6:31 pm
by beanybabe
oh worldtraveler and travelto and castle all get me messed up some times but i'm starting to get used to them.
Just adding extra seconds here and there helped at portals. I wish I was good at arrays so I could make the store buy stuff for honor more friendly. For now just edit it and change the items each time. Looking at the code for travelto I need something like the way it works for the inventory items and costs. Hopefully ill be done messing with this part soon and start on some other thing.

Re: Rock5's travelTo userfunction

Posted: Sat Jul 18, 2015 11:10 pm
by Bill D Cat
Based on the 3.20 release, I've added a few more connections in Varanas and Obsidian Stronghold. Added the auto-connect between Yrvandis and Varanas.
  • VaranasAuction to/from VaranasCentral
    VaranasBank to/from VaranasCentral
    ElvenAirship to/from VaranasClassHall
    ObsidianAuction to/from ObsidianBank
    ObsidianAuction to/from GlorySquare
    ObsidianBank to/from GlorySquare

Re: Rock5's travelTo userfunction

Posted: Sun Jul 19, 2015 11:05 am
by rock5
The problem with adding Yrvandis as an autolink to Varanas is that it's not available until you finish Taffrock, right? I guess it can't hurt as you wouldn't use it unless you had done it. And you don't have much other choice. Well, if you had your second class you could recall out so that might no longer work. Hm... Is there anything we could test to know if we finished Taffrock? Possible a particular quest needs to be completed? If we could test for that we could add/remove Yrvandis from the autolinks as needed.

Re: Rock5's travelTo userfunction

Posted: Sun Jul 19, 2015 11:46 am
by Bill D Cat
The most likely quest to check is 425189 -- Silvershadow Invitation. That's the one that activates the options in Snoop's dialog.

Re: Rock5's travelTo userfunction

Posted: Sun Jul 19, 2015 1:17 pm
by beanybabe
When I do dwarfs area had sent 20 xp orbs or so and get the char to 20/20 the trainer npc's then give me the portal there. May still need to click snoop in that zone after training.