MagnumMacKivler / trakpak3

56" Gauge Track resources for Garry's Mod
13 stars 7 forks source link

Automatically generated VON file failed to compile for 2240 radius #1

Closed SirMetaladon closed 4 years ago

SirMetaladon commented 4 years ago

VON quickloader spit out an invalid template, which JH says has too large a radius.

//ARC, DIR 2 to 4, RADIUS 2240, HEIGHT 0
~'ntypes":{}'size":n9;'n":{}'s":{~'StartDir":n2;'EndDir":n4;'Index":n1;'Type":'arc"'Radius":n2240;'Segments":n5;'StartPos":{n0;0}'Height":n0;'EndPos":{n-544;704}}'stypes":{~'StartDir":'n"'EndDir":'n"'Index":'n"'Type":'s"'Radius":'n"'Segments":'n"'StartPos":'xv2"'Height":'n"'EndPos":'xv2"}
%END%

Upon further investigation it seems the majority my quickloader 2240 radius file suffers from this issue. No idea why, just almost every entry from 43 to ~60 and ~70 to 84 return a "too large radius" error. I compiled all the other radii, and they worked fine. arcs_r2240.txt

Here's the settings I used in the quickloader to generate this file:

    ArcRadii = array(2048,3072,4096,6144,8192)
    ArcStartDirs =  array(1,1,2,2,4,4)
    ArcEndDirs =    array(2,4,1,4,1,2)
    MakeArcs = 1
    MakeWyes = 0

All else is default.

Hopefully I'm not sticking my foot in my mouth and reporting already-known or worse yet already fixed bugs...

MagnumMacKivler commented 4 years ago

Attempted fix with update to Quickplanner that checks the validity of N-track arcs, switches, and wyes before attempting to make the Principal Radius one.

Unrelated to the bug: Also with the ArcDirs you don't need 1 to 2 AND 2 to 1... it will make inverted and mirrored curves automatically. So really it should look like this:

ArcStartDirs = array(1,1,2)
ArcEndDirs =   array(2,4,4)

Note that does not apply to turnout switches because the start direction is important for the straight piece.