Page 1 of 1

yGather Conversion Script [Progress]

Posted: Sat Jun 05, 2010 11:27 am
by wil32
I found a way to parse the ygather informations into MicroMacro readable vars.

TO-DO:
I need to find which zone ID = which map -> [1], [2], etc
2nd ID = which region -> [1001],[2001],[3003],[1004], etc


Done:
Auto-Convertion of [3003] = {
[1] = {
[1] = 430.56,
[2] = 275.04,
[3] = 1275517596,
[4] = 1275520896,
[5] = 3,

INTO

<!-- # 1 --><waypoint x="27504" z="43056">player:harvest();</waypoint>

Re: yGather Conversion Script [Progress]

Posted: Sat Jun 05, 2010 12:21 pm
by rock5
Maybe GetZoneID() or GetCurrentWorldMapID().

Re: yGather Conversion Script [Progress]

Posted: Sat Jun 05, 2010 7:52 pm
by wil32
could you be more specific

Re: yGather Conversion Script [Progress]

Posted: Sun Jun 06, 2010 7:04 am
by rock5
wil32 wrote:could you be more specific
I'm not exactly sure what values you need for ygather. Why don't you try the commands and see if they give you the values you expect. You were talking about maps so I suspect GetCurrentWorldMapID() should give you the value you want as it returns the id of the zone displayed when looking at the map.

For more info:
GetZoneID()
http://www.theromwiki.com/API:GetZoneID
GetCurrentWorldMapID()
http://www.theromwiki.com/API:GetCurrentWorldMapID

Re: yGather Conversion Script [Progress]

Posted: Wed Jun 09, 2010 3:27 pm
by KillerTHC
Can you possibly share the code to manipulate the coordinates? I have found a method to walk around in RoM that avoids obstacles, the only problem is that it uses the map coordinates and not the world coordinates that RoMBot uses.

Re: yGather Conversion Script [Progress]

Posted: Wed Jun 09, 2010 8:33 pm
by wil32
The way i did it for the first elf map was to take 12 coordonate with the createpath.lua

Code: Select all

X                         X                         X                      X



X                         X                         X                      X



X                         X                         X                      X



X                         X                         X                      X
For each DOT, you check the output coordinate from ROM Map + the one the WP file you created.

After some excel work i got a very nice equation to make it work on that island.

then i moved all that thing onto my Linux box since parse data is a lot easier then i start having fun playing with the numbers and datas

the excel thing took sometime to figure out put the 2nd part was ez has a pie

This way i took 12 coordinate taking 25+ would have given a better result


What im afraid: if my equation were not acurrate enough, well 2-3 maps further u would get no near from the resources to harvest

P.S. the coordonate i took from ROM Map, were align x,y and didnt have decimals

Re: yGather Conversion Script [Progress]

Posted: Thu Jun 10, 2010 3:06 am
by rock5
Wil32, you shouldn't really need more than 2 points in opposite corners to do the calculations and for better in-game coordinates accuracy you can use GetPlayerWorldMapPos(). It gives a value with 14 decimal places accuracy.

Re: yGather Conversion Script [Progress]

Posted: Thu Jun 10, 2010 6:26 am
by wil32
that i wasnt aware..

Re: yGather Conversion Script [Progress]

Posted: Thu Jun 10, 2010 4:29 pm
by wil32
we could patch ygather to get WORLD coordinate instead of MAP coordinate?

Re: yGather Conversion Script [Progress]

Posted: Thu Jun 10, 2010 5:12 pm
by rock5
wil32 wrote:we could patch ygather to get WORLD coordinate instead of MAP coordinate?
The addon uses the map coordinates to plot resourses on the minimap and large map. You wouldn't be able to to get the addon to use rombot style world coordinates to do that.

The most you could do is do the conversions in ygather and maybe save them as well to savevariables. But that would be overly complicated to do and would add to the overhead for ygather and probably cause it to use more memory.

Better off just creating an lua converter. That way you could even output a correctly formatted waypoint file as well.