Page 2 of 3
Re: Creating Paths
Posted: Tue Mar 20, 2012 2:14 pm
by BillDoorNZ
lol...I'll see if I can find them - problem is, I prolly am not recording those as there is no name associated with them
but I'll put a list together slowly (I don't run a lot of instances atm)
Re: Creating Paths
Posted: Tue Mar 20, 2012 11:07 pm
by rock5
I been playing a bit with this function. You know it would be easy to make a function that finds the nearest object with no name and then target it. This could work with any portal, assuming they all don't have names.
Re: Creating Paths
Posted: Wed Mar 21, 2012 5:18 am
by BillDoorNZ
there were a few other objects (non-portal ones) that had no name either...will post a list next time i'm near dod
Re: Creating Paths
Posted: Wed Mar 21, 2012 7:33 am
by rock5
BillDoorNZ wrote:there were a few other objects (non-portal ones) that had no name either...will post a list next time i'm near dod
Yes, but if you go stand near the portal then target the nearest no name object, it will most likely be the portal.
Re: Creating Paths
Posted: Wed Mar 21, 2012 1:30 pm
by BillDoorNZ
lol...good point
Re: Creating Paths
Posted: Wed Mar 21, 2012 2:25 pm
by BillDoorNZ
Standing outside Dalanis sewer entrance (still in main city partm but right next to teleporter 112224). One interesting thing I did notice is that once I use the portal it appears in my list once I'm inside too and I can use it to teleport back out as well.
Code: Select all
Id Name Coords Attackable Distance
1001 Character Name (-2935, -99, 7228) FALSE 11
102815 Rat (-2917, -103, 7201) TRUE 35
112224 (-2986, -77, 7237) FALSE 49
102815 Rat (-2886, -89, 7244) TRUE 63
102815 Rat (-2859, -82, 7270) TRUE 100
114405 Resident (-3154, 79, 7260) FALSE 277
114400 Resident (-3163, 79, 7273) FALSE 286
114443 Slovenly Vagrant (-3179, 79, 7259) FALSE 296
103282 Lionheart Knight Patrol (-3051, 74, 7500) TRUE 344
114415 Little Girl (-3173, 59, 7441) FALSE 353
114952 Dalanis Usher (-3023, 74, 7523) FALSE 356
114794 Little Boy (-3185, 59, 7441) FALSE 361
102331 Rabbit (-3181, 59, 7446) TRUE 362
114415 Little Girl (-3179, 59, 7453) FALSE 365
114534 John Hoffman (-3275, 67, 7238) FALSE 370
102815 Rat (-2736, 55, 7487) TRUE 371
102815 Rat (-3258, 67, 7093) TRUE 377
103282 Lionheart Knight Patrol (-3052, 74, 7545) TRUE 382
113714 Battered Wooden Box (-3004, 53, 6872) FALSE 386
113714 Battered Wooden Box (-3078, 55, 6878) FALSE 400
114770 Funeral Parlor Assistant (-3328, 67, 7290) FALSE 423
103500 Cockroach (-2566, 62, 7354) TRUE 432
114794 Little Boy (-3176, 59, 7579) FALSE 453
110014 Elder (-3321, 74, 6922) FALSE 511
114407 Resident (-3328, 74, 6913) FALSE 521
114403 Resident (-3346, 74, 6914) FALSE 534
560009 Abyssal Mercury Ore (-2587, -14, 6789) FALSE 568
111378 (-8886, -443, 15571) FALSE 10252
111378 (-8970, -453, 15567) FALSE 10298
111378 (-9056, -451, 15558) FALSE 10341
111378 (-9148, -452, 15547) FALSE 10387
111378 (-9240, -447, 15539) FALSE 10436
Re: Creating Paths
Posted: Wed Mar 21, 2012 11:03 pm
by rock5
Yeah, I was testing at FA and the portal inside was the same id as the one outside.
I whipped up the function. Try this.
Just use
to go to the nearest portal within range of 150.
You can override the default 150 range by adding a range to the command.
Lastly, the function returns 'true' if it finds a portal and 'false' if it doesn't, so you can use it in an 'if' statement in more complex coding.
Re: Creating Paths
Posted: Thu Mar 22, 2012 2:40 pm
by BillDoorNZ
thx Rock, works a treat
Re: Creating Paths
Posted: Sat Mar 24, 2012 11:41 am
by Uniden65
thanks all this is great but it still does not help me get the codes for the portals...
my return script cant see outer teleport and i dont have the numbers.....
Re: Creating Paths
Posted: Sat Mar 24, 2012 1:25 pm
by rock5
CDWriter wrote:thanks all this is great but it still does not help me get the codes for the portals...
my return script cant see outer teleport and i dont have the numbers.....
Why do you need the codes/numbers for the portals? Doesn't the function work for you? If not, what happens?
Assuming all portals don't have names, then the function should work for every portal.
Re: Creating Paths
Posted: Sat Mar 24, 2012 11:40 pm
by Uniden65
No to sound retarded here but how do i use the function ?
so you can use it in an 'if' statement in more complex coding.
Re: Creating Paths
Posted: Sun Mar 25, 2012 3:47 am
by rock5
Simple usage:
Code: Select all
<!-- # 1 --><waypoint x="3367" z="148" y="54">
GoToPortal()
waitForLoadingScreen()
</waypoint>
Where the waypoint is somewhere near the portal (not
in the portal).
Used in an if statement:
Code: Select all
<!-- # 1 --><waypoint x="3367" z="148" y="54">
if not GoToPortal() then
error("Portal not found")
end
waitForLoadingScreen()
</waypoint>
Re: Creating Paths
Posted: Wed Apr 25, 2012 9:24 am
by imosxxx
im trying to use function GoToPortal() , but sometimes it just won't enter the portal and will stand outside all the time event if in MM window i can see that he has found the portal "Targeting object 112072" (KS)
What should i do? - how can i make this function to try to enter this portal again if first time is not successful?
Re: Creating Paths
Posted: Wed Apr 25, 2012 9:33 am
by rock5
First of all, the only time it has failed for me is when it targeted the wrong object. It works by targeting the nearest object with no name. Are you sure it was targeting the portal? An eay way to check is to see when it does work, does it still say "Targeting object 112072" or does it say a different Id?
Secondly you could just do "GoToPortal()" twice to have it try twice. Or maybe
Re: Creating Paths
Posted: Wed Apr 25, 2012 11:03 am
by imosxxx
I found out that if I am mounted on Storm Hippogriff i can't enter - if I unmount - i can enter all the time.
What is the code to unmount? i found this
or maybe there is some other code?
Re: Creating Paths
Posted: Wed Apr 25, 2012 11:51 am
by rock5
Try
Does it show the same Id for the portal while you are mounted to when you're not mounted? Maybe there is something about your mount that is getting detected as an object with no name. Maybe it's a line-of-site issue. Do you get a message in game saying you can't see the object?
It works fine for me when I'm mounted. Try changing the line in gotoportal that says
to
Might make it more reliable.
Re: Creating Paths
Posted: Wed Apr 25, 2012 12:31 pm
by imosxxx
Tried adding that code to gotoportal.lua but still while mounted it wont enter - used
before
and it works fine ... and portal has same ID 112072 when i enter dismounted. Maybe thats because Storm Hippogriff is kinda floating in air because when i use getpos.lua the coordinates kinda change a bit all the time back and forward heh
Re: Creating Paths
Posted: Wed Apr 25, 2012 2:43 pm
by BillDoorNZ
I imagine that the ROM Client auto dismounts you when you attack something that is attackable. Attacking the portal prolly doesn't trigger the auto dismount code. Thats my guess anyway.
Re: Creating Paths
Posted: Wed Apr 25, 2012 3:03 pm
by rock5
Yes but you shouldn't need to dismount to go through a portal.
I had an idea. We are talking about ks, right? Isn't the portal half submerged? So if you are mounted that means you have a mount that flies above water. Maybe you're too high to go through the ks portal when mounted.
Although, I don't remember having to dismount my flying mount to go into ks when I used to do it. But it was awhile ago so I could be wrong.
Re: Creating Paths
Posted: Wed Apr 25, 2012 3:13 pm
by imosxxx
If I am using waypont thats go in to the portal I don't need to dismount ... or if i fly manually ... so high isn't the problem. When i use that code
my character stops at last waypoint - targets portal - flies a bit closer and thats all - it just wont go near enough to teleport. But I am happy with combination of
that works fine