Re: [MOD 0.17] VehicleSnap

Given the above, it would be amazing if you re-posted that picture, but with show-tile-grid on !

I edited the previous post, it includes grid now. I need it myself too to find out actual angles, unless there is a list for those numbers somewhere?

I also did a test of the angle table with Unity editor and it worked very easily, and was actually quite cool to see.

Code:

int nearestI = -1; float nearest = 999f; for (int i = 0; i < lockaxis.Length; i++) { float d = Mathf.Abs(AngleDist(value, lockaxis[i])); if (d < nearest) { nearestI = i; nearest = d; } }

Looking to put out a new mod version of it, but there are some nuances to this. For example i don't want or need to table all the angles, only the 8 uncommon ones. I can then compare the best lockaxis-table value to the mathematically best axis and choose nearest, but that should only be used if player's mod settings are exactly 16 or 32 angles i think. Those between and before are divided differently altogether.

Current table i've gotten is roughly

Code:

-- 0.07386350632 measured from train wagon orientation, still off very tiny bitlocal rail_est = 0.07405 -- Best estimate so far 0.07405local lockAxis = { rail_est, 0.25-rail_est, 0.25+rail_est, 0.5-rail_est, 0.5+rail_est, 0.75-rail_est, 0.75+rail_est, 1.0-rail_est }

As it seems 1:2 is triangular ratio for the odd rail pieces, but math fails on this one ever-so-slightly and i had to go with trial and error repeatedly.
Statistics: Posted by Zaflis — Wed Nov 26, 2025 5:36 pm