So think this is a nifty little thing to add to the GUI but I've found that for whatever reason it can be off-set a bit from the grid shown on the map. I've tested it on 2500, 3500, and 4000 sized procedural maps and have found the same to be the case on all of them.
Not always accurate
It's a known issue, it may not be accurate depending on the map size and I'm sure all plugins that use the grid system have this problem. This will require better calculations to be accurate for all map sizes.
The issue should be resolved in version 1.0.4. I've tested across multiple map sizes and all of them were working correctly. Please let me know if you find any maps that don't work.
i run a 5500 size map and this is a code snippet from RaidableBases, i hope i can post it here!
its very accurate for me
its very accurate for me
public static string PositionToGrid(Vector3 position) // Credits: yetzt
{
var r = new Vector2(World.Size / 2 + position.x, World.Size / 2 + position.z);
var x = Mathf.Floor(r.x / 146.3f) % 26;
var z = Mathf.Floor(World.Size / 146.3f) - Mathf.Floor(r.y / 146.3f);
return $"{(char)('A' + x)}{z}";
} dIMjIM
i run a 5500 size map and this is a code snippet from RaidableBases, i hope i can post it here!
its very accurate for mepublic static string PositionToGrid(Vector3 position) // Credits: yetzt { var r = new Vector2(World.Size / 2 + position.x, World.Size / 2 + position.z); var x = Mathf.Floor(r.x / 146.3f) % 26; var z = Mathf.Floor(World.Size / 146.3f) - Mathf.Floor(r.y / 146.3f); return $"{(char)('A' + x)}{z}"; }
The issue with the code posted above is it doesn't account for all the possible Letter Cords since in the grid after Z it goes to AA as the one next to it. Besides that part my new code is pretty similar to the above.
Thanks for the replies! Glad to know it's getting fixed. You umod guys are awesome!
Edit : Will test it later today
no matter where you go its always off by 1 grid
TwoShoes
no matter where you go its always off by 1 grid
Can you share your map size and seed?
Confirmed this is still an issue. Tested on several map seeds. The one I'm using currently is https://rustmaps.com/map/3500_1503553667
Hmm ok that didn't post lets try again... Map seed 1558800482 Map size 3500
Yeah, I have spent the past couple of hours on this. There appears to be a client bug with certain map sizes. I've almost worked out all the maps it breaks on and will have a fix for it soon. 3500 is one of the maps. If you want to see what the client bug looks like I've made a video here: https://streamable.com/csbxlh. This bug doesn't occur on the 3500 map but I think it's related to the overall issue.
no worries bro shiot happens :)
Question is.... how the hell do you fix that? lol
The update is on hold currently with the fix. It seems FP will be making the grid lookup code avaliable on the server. Once this is on staging I will update this plugin to use that code which should solve all the issues.
The official FP code is now available and has been incorporated into the plugin. This should resolve all grid issues.
- 1
- 2