From ea62bc0f6e00e21c49a688ee949f0e3aaf494fd3 Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Tue, 5 Apr 2016 00:02:56 +0300 Subject: [PATCH] Fixed: General parametrization management Fixed: Order of origin angle rotation Enabled: XQM Helix loops --- lua/autorun/trackassembly_init.lua | 132 ++++++++---------- lua/trackassembly/trackasmlib.lua | 26 ++-- .../gmod_tool/stools/trackassembly.lua | 1 + 3 files changed, 75 insertions(+), 84 deletions(-) diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index e078809f..b97ad167 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -24,7 +24,7 @@ local asmlib = trackasmlib ------ CONFIGURE ASMLIB ------ asmlib.InitAssembly("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","5.227") +asmlib.SetOpVar("TOOL_VERSION","5.228") asmlib.SetLogControl(0,"") asmlib.SetIndexes("V",1,2,3) asmlib.SetIndexes("A",1,2,3) @@ -33,7 +33,7 @@ asmlib.SetOpVar("MAX_MASS",50000) asmlib.SetOpVar("MAX_LINEAR",1000) asmlib.SetOpVar("MAX_ROTATION",360) asmlib.SetOpVar("LOG_ONLY",nil) -asmlib.SetOpVar("LOG_SKIP",{"Qsort","ModelToName","GetEntitySpawn: Not hitting active point","CacheQueryPiece: Record not located", "GetEntitySpawn: Trace model missing"}) +--asmlib.SetOpVar("LOG_SKIP",{"Qsort","ModelToName","GetEntitySpawn: Not hitting active point","CacheQueryPiece: Record not located", "GetEntitySpawn: Trace model missing"}) ------ CONFIGURE REPLICATED CVARS ----- Server tells the client what value to use asmlib.MakeCoVar("maxactrad", "150", {1,500} ,bitBor(FCVAR_ARCHIVE, FCVAR_ARCHIVE_XBOX, FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_PRINTABLEONLY), "Maximum active radius to search for a point ID") @@ -501,22 +501,22 @@ else asmlib.InsertRecord({"models/props_phx/trains/monorail_curve.mdl", "#", "Turn 90", 2, "", "-605.42602539063,-1.3489999771118,13.798999786377", "0,90,0"}) asmlib.DefaultType("PHX Metal") asmlib.SettingsModelToName("SET",nil,{"track_","straight_"},nil) - asmlib.InsertRecord({"models/props_phx/trains/track_32.mdl" , "#", "#", 1, "-0.327,-61.529,8.714", " 15.760,0,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_32.mdl" , "#", "#", 2, "-0.327, 61.529,8.714", "-16.245,0,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_64.mdl" , "#", "#", 1, "", " 32.005,0,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_64.mdl" , "#", "#", 2, "", "-32.005,0,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_128.mdl", "#", "#", 1, "", " 63.760,0,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_128.mdl", "#", "#", 2, "", "-64.245,0,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_256.mdl", "#", "#", 1, "", " 127.76,0,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_256.mdl", "#", "#", 2, "", "-128.25,0,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_512.mdl", "#", "#", 1, "", " 255.760,0,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_512.mdl", "#", "#", 2, "", "-256.247,0,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_1024.mdl", "#", "#", 1, "", " 511.760,0.002,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_1024.mdl", "#", "#", 2, "", "-512.245,0.002,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_2048.mdl", "#", "#", 1, "", " 1023.760, 0.001,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_2048.mdl", "#", "#", 2, "", "-1024.247,-0.109,9.215", "0,180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/track_4096.mdl", "#", "#", 1, "", " 2047.760,0.004,9.215", ""}) - asmlib.InsertRecord({"models/props_phx/trains/track_4096.mdl", "#", "#", 2, "", "-2048.243,-0.22483,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_32.mdl" , "#", "#", 1, "-0.327,-61.529,8.714", " 15.760, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_32.mdl" , "#", "#", 2, "-0.327, 61.529,8.714", "-16.245,-0.025,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_64.mdl" , "#", "#", 1, "", " 32.005, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_64.mdl" , "#", "#", 2, "", "-32.005,-0.025,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_128.mdl", "#", "#", 1, "", " 63.760, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_128.mdl", "#", "#", 2, "", "-64.245,-0.025,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_256.mdl", "#", "#", 1, "", " 127.76, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_256.mdl", "#", "#", 2, "", "-128.25,-0.025,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_512.mdl", "#", "#", 1, "", " 255.760, 0.015,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_512.mdl", "#", "#", 2, "", "-256.247,-0.025,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_1024.mdl", "#", "#", 1, "", " 511.760, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_1024.mdl", "#", "#", 2, "", "-512.245,-0.085,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_2048.mdl", "#", "#", 1, "", " 1023.760, 0.030,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_2048.mdl", "#", "#", 2, "", "-1024.247,-0.150,9.215", "0,180,0"}) + asmlib.InsertRecord({"models/props_phx/trains/track_4096.mdl", "#", "#", 1, "", " 2047.760, 0.025,9.215", ""}) + asmlib.InsertRecord({"models/props_phx/trains/track_4096.mdl", "#", "#", 2, "", "-2048.243,-0.250,9.215", "0,180,0"}) asmlib.DefaultType("PHX Regular") asmlib.SettingsModelToName("SET",{1,6}) asmlib.InsertRecord({"models/props_phx/trains/tracks/track_1x.mdl", "#", "#", 1, "", "79.93, 0, 12.544", ""}) @@ -774,16 +774,17 @@ else asmlib.InsertRecord({"models/xqm/coastertrack/special_sturn_left_3.mdl", "#", "#", 2, "", "-225.2, -36.559, 4.886", "0,-180,0"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_sturn_left_4.mdl", "#", "#", 1, "", "299.8, 36.623, 4.886", ""}) asmlib.InsertRecord({"models/xqm/coastertrack/special_sturn_left_4.mdl", "#", "#", 2, "", "-299.8, -36.6, 4.886", "0,-180,0"}) - asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_3.mdl", "#", "#", 1, "", "-285.755, -96.647, 32.538", "0,-90,-90"}) - asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_3.mdl", "#", "#", 2, "#", "281.393, -79.204, -55.216", "22.5,-90,90"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_2.mdl", "#", "#", 1, "", "189.277, 59.435, 41.118", "0,90,-90"}) - asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_2.mdl", "#", "#", 2, "#", "-192.302, 46.789, -17.492", "22.5,90,90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_2.mdl", "#", "#", 2, "", "-192.302, 46.789, -17.492", "@22.5,90,90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_3.mdl", "#", "#", 1, "", "-285.755, -96.647, 32.538", "0,-90,-90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_3.mdl", "#", "#", 2, "", "281.393, -79.204, -55.216", "@22.5,-90,90"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_4.mdl", "#", "#", 1, "", "322.424, -72.015, 15.907", "0,-90,90"}) - asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_4.mdl", "#", "#", 2, "#", "-419.735, -44.894, 132.706", "-22.5,-90,-90"}) - -- asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_2.mdl", "#", "#", 1, "#", "-207.841, 30.414, 100.219", "-22.5,-90,-90"}) - -- asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_2.mdl", "#", "#", 2, "#", "-207.993, 7.31, -17.474", "22.5,90,90"}) - -- asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_3.mdl", "#", "#", 1, "#", "281.359, -6.612, 120.391", "@-22.5,@90,@-90"}) - -- asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_3.mdl", "#", "#", 2, "#", "281.371, 28.004, -55.354", "@22.5,@-90,@90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_4.mdl", "#", "#", 2, "", "-419.735, -44.894, 132.706", "@-22.5,-90,-90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_2.mdl", "#", "#", 1, "", "-207.841, 30.414, 100.219", "@-22.5,-90,-90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_2.mdl", "#", "#", 2, "", "-207.993, 7.31, -17.474", "@22.5,90,90"}) + + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_3.mdl", "#", "#", 1, "", "281.359, -6.612, 120.391", "@-22.5,90,-90"}) + asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_3.mdl", "#", "#", 2, "", "281.371, 28.004, -55.354", "@22.5,-90,90"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_4.mdl", "#", "#", 1, "", "322.609, 52.146, 251.028", "0,90,-90"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_helix_middle_full_4.mdl", "#", "#", 2, "", "322.431, 5.79, 15.895", "0,-90,90"}) asmlib.InsertRecord({"models/xqm/coastertrack/special_half_corkscrew_right_1.mdl", "#", "#", 1, "", "150.199, 0.013, 4.886", ""}) @@ -1254,14 +1255,14 @@ else asmlib.InsertRecord({"models/buildingspack/roadsdwhighway/1_1roadsdwhwy_ramp_stop.mdl", "#", "#", 3, "", "0,671.995,2.501", ""}) asmlib.InsertRecord({"models/buildingspack/roadsdwhighway/1_1roadsdwhwy_ramp_stop.mdl", "#", "#", 4, "", "-4160,0,15.202", "0,-180,0"}) asmlib.DefaultType("Portal Tubes") - asmlib.InsertRecord({"models/props_bts/clear_tube_straight.mdl", "#", "#", 1, "", "0, -0.04, 63.895", "-90,-180,180"}) - asmlib.InsertRecord({"models/props_bts/clear_tube_straight.mdl", "#", "#", 2, "", "0, -0.04, -63.9", "90,0,180"}) - asmlib.InsertRecord({"models/props_bts/clear_tube_90deg.mdl", "#", "#", 1, "", "64.041,0.049,0.131", ""}) - asmlib.InsertRecord({"models/props_bts/clear_tube_90deg.mdl", "#", "#", 2, "", "0.002,0.04,-63.904", "@90,0,180"}) - -- asmlib.InsertRecord({"models/props_bts/clear_tube_broken.mdl", "#", "#", 1, "", "0,-0.041,63.916", "-90,-180,180"}) - -- asmlib.InsertRecord({"models/props_bts/clear_tube_broken.mdl", "#", "#", 2, "", "0,-0.041,-64.084", "90,0,180"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_straight.mdl", "#", "#", 1, "", "0.009,0 , 63.896", "@-90, 0,180"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_straight.mdl", "#", "#", 2, "", "0.008,0.004,-63.897", "@ 90,180,180"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_90deg.mdl" , "#", "#", 1, "", "64.041,0.049, 0.131", ""}) + asmlib.InsertRecord({"models/props_bts/clear_tube_90deg.mdl" , "#", "#", 2, "", " 0.002,0.040,-63.904", "@90,0,180"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_broken.mdl", "#", "#", 1, "", "0.009,0 , 63.896", "@-90, 0,180"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_broken.mdl", "#", "#", 2, "", "0.008,0.004,-63.897", "@ 90,180,180"}) asmlib.InsertRecord({"models/props_bts/clear_tube_tjoint.mdl", "#", "#", 1, "", "-0.014,0.13,96.075", "@-90,0,180"}) - asmlib.InsertRecord({"models/props_bts/clear_tube_tjoint.mdl", "#", "#", 2, "", "0,-95.9,0.054", "0,-90,90"}) + asmlib.InsertRecord({"models/props_bts/clear_tube_tjoint.mdl", "#", "#", 2, "", "-0.004,-95.763,0.016", "0,-90,-90"}) asmlib.InsertRecord({"models/props_bts/clear_tube_tjoint.mdl", "#", "#", 3, "", "0,96,0.083", "0,90,90"}) asmlib.DefaultType("Mr.Train's M-Gauge") asmlib.SettingsModelToName("SET",nil,{"m_gauge","straight"},nil) @@ -1673,46 +1674,31 @@ else asmlib.InsertRecord({"models/ron/2ft/xjunctions/x_junction_unswitched.mdl", "#", "#", 4, "", "-704,-62,6.016", "0,-180,0"}) asmlib.DefaultType("PHX Tubes 1x1") ---- Works --- - asmlib.InsertRecord({"models/hunter/tubes/tubebend1x1x90.mdl", "#", "#", 1, "", "0,0,0", "90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tubebend1x1x90.mdl", "#", "#", 2, "", "0,23.725,23.725", "0,90,90"}) - -------------- - - - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x1.mdl", "#", "#", 1, "", "0,0,47.450", "-90,0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x1.mdl", "#", "#", 2, "", "" , "90,0,0"}) - - - - - - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x2.mdl", "#", "#", 1, "", "0,0,94.900", "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x2.mdl", "#", "#", 2, "", "" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x3.mdl", "#", "#", 1, "", "0,0,142.35", "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x3.mdl", "#", "#", 2, "", "" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x4.mdl", "#", "#", 1, "", "0,0,189.80", "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x4.mdl", "#", "#", 2, "", "" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x8.mdl", "#", "#", 1, "", "0,0,379.60", "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube1x1x8.mdl", "#", "#", 2, "", "" , " 90,-180,180"}) - - - - - - asmlib.DefaultType("PHX Tubes 2x2") - ---- Works --- - -------------- - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x05.mdl" , "#", "#", 1, "", "0,0, 11.8625", "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x05.mdl" , "#", "#", 2, "", "0,0,-11.8625", " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x1.mdl" , "#", "#", 1, "", "0,0, 23.726" , "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x1.mdl" , "#", "#", 2, "", "0,0,-23.726" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x2.mdl" , "#", "#", 1, "", "0,0, 47.45" , "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x2.mdl" , "#", "#", 2, "", "0,0,-47.45" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x4.mdl" , "#", "#", 1, "", "0,0, 94.9" , "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x4.mdl" , "#", "#", 2, "", "0,0,-94.9" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x8.mdl" , "#", "#", 1, "", "0,0, 189.8" , "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube2x2x8.mdl" , "#", "#", 2, "", "0,0,-189.8" , " 90,-180,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube4x4x1to2x2.mdl", "#", "#", 1, "", "" , "-90, 0,180"}) - asmlib.InsertRecord({"models/hunter/tubes/tube4x4x1to2x2.mdl", "#", "#", 2, "", "0,0,-47.45" , " 90,-180,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tubebend1x1x90.mdl", "#", "#", 1, "", "0,0,0", "@90,-180,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tubebend1x1x90.mdl", "#", "#", 2, "", "0,23.725,23.725", " 0, 90, 90"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x1.mdl", "#", "#", 1, "", "0,0,47.450", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x1.mdl", "#", "#", 2, "", "" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x2.mdl", "#", "#", 1, "", "0,0,94.900", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x2.mdl", "#", "#", 2, "", "" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x3.mdl", "#", "#", 1, "", "0,0,142.35", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x3.mdl", "#", "#", 2, "", "" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x4.mdl", "#", "#", 1, "", "0,0,189.80", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x4.mdl", "#", "#", 2, "", "" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x8.mdl", "#", "#", 1, "", "0,0,379.60", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube1x1x8.mdl", "#", "#", 2, "", "" , "@ 90,0, 0 "}) + asmlib.DefaultType("PHX Tubes 2x2") + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x05.mdl" , "#", "#", 1, "", "0,0, 11.8625", "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x05.mdl" , "#", "#", 2, "", "0,0,-11.8625", "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x1.mdl" , "#", "#", 1, "", "0,0, 23.726" , "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x1.mdl" , "#", "#", 2, "", "0,0,-23.726" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x2.mdl" , "#", "#", 1, "", "0,0, 47.45" , "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x2.mdl" , "#", "#", 2, "", "0,0,-47.45" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x4.mdl" , "#", "#", 1, "", "0,0, 94.9" , "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x4.mdl" , "#", "#", 2, "", "0,0,-94.9" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x8.mdl" , "#", "#", 1, "", "0,0, 189.8" , "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube2x2x8.mdl" , "#", "#", 2, "", "0,0,-189.8" , "@ 90,0, 0 "}) + asmlib.InsertRecord({"models/hunter/tubes/tube4x4x1to2x2.mdl", "#", "#", 1, "", "" , "@-90,0,180"}) + asmlib.InsertRecord({"models/hunter/tubes/tube4x4x1to2x2.mdl", "#", "#", 2, "", "0,0,-47.45" , "@ 90,0, 0 "}) end if(file.Exists(gsFullDSV.."PHYSPROPERTIES.txt", "DATA")) then diff --git a/lua/trackassembly/trackasmlib.lua b/lua/trackassembly/trackasmlib.lua index f4253f3e..0c7788a2 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -1153,7 +1153,7 @@ local function TransferPOA(stOffset,sMode) if (sMode == "V") then stOffset[cvX] = arPOA[1]; stOffset[cvY] = arPOA[2]; stOffset[cvZ] = arPOA[3] elseif(sMode == "A") then stOffset[caP] = arPOA[1]; stOffset[caY] = arPOA[2]; stOffset[caR] = arPOA[3] else return StatusLog(nil,"TransferPOA: Missed mode "..sMode) end - stOffset[csA] = arPOA[4]; stOffset[csB] = arPOA[5]; stOffset[csC] = arPOA[6]; stOffset[csD] = arPOA[7] + stOffset[csA] = arPOA[4]; stOffset[csB] = arPOA[5]; stOffset[csC] = arPOA[6] return arPOA end @@ -1231,15 +1231,19 @@ local function RegisterPOA(stPiece, ivID, sP, sO, sA) tOffs[iID].A = {} tOffs = tOffs[iID] end - if((sO ~= "") and (sO ~= "NULL")) then DecodePOA(sO) else ReloadPOA() end + local symDis = GetOpVar("OPSYM_DISABLE") + ---------------- Origin ---------------- + if((sO ~= "NULL") and not IsEmptyString(sO)) then DecodePOA(sO) else ReloadPOA() end if(not IsExistent(TransferPOA(tOffs.O,"V"))) then return StatusLog(nil,"RegisterPOA: Cannot transfer origin") end - if((sP ~= "") and (sP ~= "NULL")) then DecodePOA(sP) end + ---------------- Point ---------------- + if(stringSub(sP,1,1) == symDis) then + sP = stringSub(sP,2,-1); tOffs.P[csD] = true else tOffs.P[csD] = false end + if((sP ~= "NULL") and not IsEmptyString(sP)) then DecodePOA(sP) end if(not IsExistent(TransferPOA(tOffs.P,"V"))) then - return StatusLog(nil,"RegisterPOA: Cannot transfer point") - end -- In the POA array still persists the decoded Origin - if(stringSub(sP,1,1) == GetOpVar("OPSYM_DISABLE")) then tOffs.P[csD] = true else tOffs.P[csD] = false end - if((sA ~= "") and (sA ~= "NULL")) then DecodePOA(sA) else ReloadPOA() end + return StatusLog(nil,"RegisterPOA: Cannot transfer point") end + ---------------- Angle ---------------- + if((sA ~= "NULL") and not IsEmptyString(sA)) then DecodePOA(sA) else ReloadPOA() end if(not IsExistent(TransferPOA(tOffs.A,"A"))) then return StatusLog(nil,"RegisterPOA: Cannot transfer angle") end return tOffs @@ -2730,10 +2734,10 @@ function GetNormalSpawn(ucsPos,ucsAng,shdModel,ivhdPointID,ucsPosX,ucsPosY,ucsPo stSpawn.SPos:Add((stPOA.O[csB] * stSpawn.HPos[cvY] + (tonumber(ucsPosY) or 0)) * stSpawn.R) stSpawn.SPos:Add((stPOA.O[csC] * stSpawn.HPos[cvZ] + (tonumber(ucsPosZ) or 0)) * stSpawn.U) -- Spawn Angle - stSpawn.SAng:Set(stSpawn.OAng) - stSpawn.SAng:RotateAroundAxis(stSpawn.SAng:Up() ,-stSpawn.HAng[caY] * stPOA.A[csB]) - stSpawn.SAng:RotateAroundAxis(stSpawn.SAng:Right() ,-stSpawn.HAng[caP] * stPOA.A[csA]) - stSpawn.SAng:RotateAroundAxis(stSpawn.SAng:Forward(),-stSpawn.HAng[caR] * stPOA.A[csC]) + stSpawn.SAng:Set(stSpawn.OAng); NegAngle(stSpawn.HAng) + stSpawn.SAng:RotateAroundAxis(stSpawn.U,stSpawn.HAng[caY] * stPOA.A[csB]) + stSpawn.SAng:RotateAroundAxis(stSpawn.R,stSpawn.HAng[caP] * stPOA.A[csA]) + stSpawn.SAng:RotateAroundAxis(stSpawn.F,stSpawn.HAng[caR] * stPOA.A[csC]) -- Store the active point position of holder stSpawn.HPnt:Rotate(stSpawn.SAng) stSpawn.HPnt:Add(stSpawn.SPos) diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index effc75a0..ce9d42f1 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -620,6 +620,7 @@ function TOOL:RightClick(stTrace) local hdRec = asmlib.CacheQueryPiece(model) if(not hdRec) then return asmlib.StatusLog(false,"TOOL:RightClick(): Model <"..model.."> not a piece") end + asmlib.Print(hdRec,"hdRec") local pointid, pnextid = self:GetPointID() local pointbu = pointid asmlib.LoadKeyPly(ply)