mirror of
https://github.com/dvdvideo1234/TrackAssemblyTool.git
synced 2025-03-04 03:13:32 -05:00
Added: Contents from addon "Modular Dungeons"
Fixed: E2 Pipe attachment interpolation angle being misaligned
This commit is contained in:
parent
e329f3912e
commit
77909cba18
@ -1,41 +1,56 @@
|
||||
@name TA Pipe Generator
|
||||
@model models/props_lab/huladoll.mdl
|
||||
@persist [Scanner Pipe]:entity [F U R,C MP]:vector [TU TD TL TR]:ftrace
|
||||
@persist [Delta Iter Raun]:number [ScanCenter SizeCenter]:vector2 MA:angle
|
||||
@outputs
|
||||
@persist [Delta Iter Raun]:number [ScanCenter SizeCenter]:vector2 MA:angle OverZ:string
|
||||
@outputs
|
||||
|
||||
function rotNearest45DEG(E:entity)
|
||||
{
|
||||
if(E == noentity()) { return }
|
||||
Ang = E:angles()
|
||||
# angle = (math.Round(angle/45))*45
|
||||
Ang = Ang:setPitch(45 * round(Ang:pitch() / 45))
|
||||
Ang = Ang:setYaw(45 * round(Ang:yaw() / 45))
|
||||
Ang = Ang:setRoll(45 * round(Ang:roll() / 45))
|
||||
E:setAngles(Ang)
|
||||
}
|
||||
|
||||
if(first() || dupefinished())
|
||||
{
|
||||
# Scan size. Most rails are more wider than higher
|
||||
# For PHX two bean rails W > H
|
||||
ScanR = 500 # Scan radius must be bigger then pipe radius
|
||||
|
||||
|
||||
# Amount of iterations to lower delta
|
||||
Iter = 10
|
||||
|
||||
|
||||
# Rouding
|
||||
Raun = 4
|
||||
|
||||
Raun = 2
|
||||
|
||||
# Override origin
|
||||
OverZ = ""
|
||||
|
||||
# Align center to prop center
|
||||
ScanCenter = vec2(0, 3)
|
||||
SizeCenter = vec2(3, 3)
|
||||
|
||||
|
||||
# How fast it will scan the piece edge
|
||||
Delta = 1
|
||||
|
||||
|
||||
# Local oriantation vectors
|
||||
F = vec(1,0,0)
|
||||
U = vec(0,0,1)
|
||||
|
||||
|
||||
# Automatic stuff
|
||||
Scanner = entity()
|
||||
rotNearest45DEG(Scanner)
|
||||
Pipe = noentity()
|
||||
U = U:normalized()
|
||||
R = F:cross(U)
|
||||
MP = Scanner:pos()
|
||||
MA = Scanner:angles()
|
||||
C = U * ScanCenter:y() + R * ScanCenter:x()
|
||||
|
||||
|
||||
holoCreate(1), holoColor(1,vec(255,0,0)), holoScale(1,0.1*vec(1,1,1)) holoModel(1,"cone")
|
||||
holoCreate(2), holoColor(2,vec(0,0,255)), holoScale(2,0.1*vec(1,1,1)) holoModel(2,"cone")
|
||||
holoCreate(3), holoColor(3,vec(255,255,0)), holoScale(3,0.1*vec(1,1,1)) holoModel(3,"cone")
|
||||
@ -47,6 +62,13 @@ if(first() || dupefinished())
|
||||
TD = Scanner:setFTrace(C - SizeCenter:x() * U, U, -ScanR):useArray():putArray(Scanner)
|
||||
TR = Scanner:setFTrace(C + SizeCenter:y() * R, R, ScanR):useArray():putArray(Scanner)
|
||||
TL = Scanner:setFTrace(C - SizeCenter:y() * R, R, -ScanR):useArray():putArray(Scanner)
|
||||
|
||||
holoPos(1, MP)
|
||||
holoPos(2, MP)
|
||||
holoPos(3, MP)
|
||||
holoPos(4, MP)
|
||||
holoPos(5, MP)
|
||||
holoPos(6, MP)
|
||||
}
|
||||
|
||||
function drawFTrace(T:ftrace, N:number)
|
||||
@ -61,33 +83,32 @@ function drawFTrace(T:ftrace, N:number)
|
||||
|
||||
event tick()
|
||||
{
|
||||
holoPos(5, Scanner:toWorld(C))
|
||||
drawFTrace(TU:smpLocal(), 1)
|
||||
drawFTrace(TD:smpLocal(), 2)
|
||||
drawFTrace(TR:smpLocal(), 3)
|
||||
drawFTrace(TL:smpLocal(), 4)
|
||||
|
||||
|
||||
if(Scanner != noentity())
|
||||
{
|
||||
if(TU:isHit() && TD:isHit() && TR:isHit() && TL:isHit())
|
||||
{
|
||||
holoPos(5, Scanner:toWorld(C))
|
||||
|
||||
VU = (TU:getFractionLen() - TD:getFractionLen())
|
||||
VR = (TR:getFractionLen() - TL:getFractionLen())
|
||||
DL = U * VU + R * VR
|
||||
|
||||
DL = U * VU + R * VR
|
||||
|
||||
MP = (TU:getPosWorld() + TD:getPosWorld() +
|
||||
TR:getPosWorld() + TL:getPosWorld()) / 4
|
||||
|
||||
#print("Move:", DL)
|
||||
|
||||
|
||||
holoPos(6, MP)
|
||||
|
||||
|
||||
if(Pipe == noentity())
|
||||
{
|
||||
Pipe = TU:getEntity()
|
||||
print("Pipe:", Pipe)
|
||||
}
|
||||
|
||||
rotNearest45DEG(Pipe)
|
||||
}
|
||||
|
||||
C = C + F * Delta
|
||||
TU:rayMove(F + DL, Delta)
|
||||
TD:rayMove(F + DL, Delta)
|
||||
@ -95,10 +116,9 @@ event tick()
|
||||
TL:rayMove(F + DL, Delta)
|
||||
}
|
||||
else
|
||||
{
|
||||
# print("Iteration:", Iter)
|
||||
{
|
||||
if(Iter <= 0)
|
||||
{
|
||||
{
|
||||
Scanner = noentity()
|
||||
}
|
||||
C = C - F * Delta
|
||||
@ -119,17 +139,20 @@ event tick()
|
||||
OrX = toString(round(Or:x(), Raun))
|
||||
OrY = toString(round(Or:y(), Raun))
|
||||
OrZ = toString(round(Or:z(), Raun))
|
||||
if(OverZ != ""){ OrZ = OverZ }
|
||||
|
||||
OrS = OrX+","+OrY+","+OrZ
|
||||
An = Pipe:toLocal(MA)
|
||||
AnP = toString(round(An:pitch(), Raun))
|
||||
AnY = toString(round(An:yaw(), Raun))
|
||||
AnR = toString(round(An:roll(), Raun))
|
||||
AnS = AnP+","+AnY+","+AnR
|
||||
|
||||
|
||||
if(OrS == "0,0,0") { OrS = "" }
|
||||
if(AnS == "0,0,0") { AnS = "" } else { AnS = ", \""+AnS+"\"" }
|
||||
|
||||
|
||||
print("PIECES:Record({\""+Mo+"\", \"#\", \"#\", 0, \"\", \""+OrS+"\""+AnS+"})")
|
||||
print("Done ["+(Iter+1)+"] cycles: ",Pipe)
|
||||
Pipe = noentity()
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ set emd_chew_dbase=%emd_chew_gmod%\garrysmod\data\trackassembly\exp\trackasmlib_
|
||||
set emd_chew_skip=%emd_chew_repo%\data\trackassembly\tools\peaces_manager\models_ignored.txt
|
||||
|
||||
:: How many addons are to be processed
|
||||
set emd_chew_addfrm=31
|
||||
set emd_chew_addcnt=31
|
||||
set emd_chew_addfrm=32
|
||||
set emd_chew_addcnt=32
|
||||
|
||||
:: GMA addons to be processed
|
||||
set emd_chew_addlst[1]=740453553
|
||||
@ -65,6 +65,7 @@ set emd_chew_addlst[28]=3071058065
|
||||
set emd_chew_addlst[29]=3297918081
|
||||
set emd_chew_addlst[30]=3314861708
|
||||
set emd_chew_addlst[31]=2233731395
|
||||
set emd_chew_addlst[32]=3302818415
|
||||
|
||||
:: Folder list for extraction and the directories they will be extracted
|
||||
set emd_chew_adddir[1]=AlexCookie's 2ft track pack
|
||||
@ -98,6 +99,7 @@ set emd_chew_adddir[28]=RockMan's Fortification
|
||||
set emd_chew_adddir[29]=SligWolf's Suspension Train
|
||||
set emd_chew_adddir[30]=Modular City Street
|
||||
set emd_chew_adddir[31]=Scene Builder
|
||||
set emd_chew_adddir[32]=Modular Dungeons
|
||||
|
||||
:: Show the current folder
|
||||
echo Running in: %emd_chew_pathb%
|
||||
@ -125,7 +127,7 @@ IF EXIST "%emd_chew_pathb%%emd_parm_manag%.txt" (
|
||||
echo Chewing the paths uses base path relative to the executable.
|
||||
call %emd_chew_pathb%peaces_manager.exe %emd_chew_pathb% %emd_chew_dbase% %emd_chew_skip% %emd_clog_lfile%
|
||||
:: Terminate the flow as everyting is considered being extracted
|
||||
echo Terminate the flow as everyting is considered being extracted.
|
||||
echo Exit with success as everyting is considered extracted.
|
||||
timeout 300
|
||||
exit 0
|
||||
) ELSE (
|
||||
|
@ -5665,3 +5665,6 @@ models/props_canal/canal_bridge_railing_lamps.mdl
|
||||
# Modular City Street
|
||||
models/propper/dingles_modular_streets/street_propper_reference_texture_block.mdl
|
||||
models/propper/dingles_modular_streets/street_propper_reference_texture_block2.mdl
|
||||
|
||||
# Modular Dungeons
|
||||
models/coldsaturnight/dungeons/dungeontest.mdl
|
||||
|
@ -87,7 +87,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present
|
||||
------------ CONFIGURE ASMLIB ------------
|
||||
|
||||
asmlib.InitBase("track","assembly")
|
||||
asmlib.SetOpVar("TOOL_VERSION","9.769")
|
||||
asmlib.SetOpVar("TOOL_VERSION","9.770")
|
||||
|
||||
------------ CONFIGURE GLOBAL INIT OPVARS ------------
|
||||
|
||||
@ -558,6 +558,7 @@ if(CLIENT) then
|
||||
asmlib.WorkshopID("SligWolf's Suspension Train" , "3297918081")
|
||||
asmlib.WorkshopID("Modular City Street" , "3314861708")
|
||||
asmlib.WorkshopID("Scene Builder" , "2233731395")
|
||||
asmlib.WorkshopID("Modular Dungeons" , "3302818415")
|
||||
|
||||
asmlib.SetAction("CLEAR_GHOSTS" , function() asmlib.ClearGhosts() end)
|
||||
asmlib.SetAction("CTXMENU_OPEN" , function() asmlib.IsFlag("tg_context_menu", true ) end)
|
||||
@ -4907,6 +4908,39 @@ else
|
||||
PIECES:Record({"models/scene_building/small_rooms/4door.mdl", "#", "#", 4, "", "0,-123,0", "0,-90,0"})
|
||||
PIECES:Record({"models/scene_building/small_rooms/stairs_straight.mdl", "#", "#", 1, "", "0,163,64", "0,90,0"})
|
||||
PIECES:Record({"models/scene_building/small_rooms/stairs_straight.mdl", "#", "#", 2, "", "0,-163,-64", "0,-90,0"})
|
||||
asmlib.Categorize("Modular Dungeons",[[function(m)
|
||||
local g = m:gsub("models/coldsaturnight/dungeons/","")
|
||||
local r, n = g:gsub("%.mdl",""):lower(), nil
|
||||
if(r:find("^combine")) then
|
||||
n = r:gsub("^combine", ""); r = "combine"
|
||||
else r, n = nil, nil end; return r, n end]])
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinearmory.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridor.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridor.mdl", "#", "#", 2, "", "-256,0,80", "0,180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorend.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorcross.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorcross.mdl", "#", "#", 2, "", "0,256,80", "0,90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorcross.mdl", "#", "#", 3, "", "-256,0,80", "0,-180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorcross.mdl", "#", "#", 4, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridort.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridort.mdl", "#", "#", 2, "", "-256,0,80", "0,-180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridort.mdl", "#", "#", 3, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorturn.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinecorridorturn.mdl", "#", "#", 2, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineentry.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineentry.mdl", "#", "#", 2, "", "0,256,80", "0,90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineentry.mdl", "#", "#", 3, "", "-256,0,80", "0,180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineentry.mdl", "#", "#", 4, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineladder.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineladder.mdl", "#", "#", 2, "", "-256,0,336", "0,180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineroom.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineroom.mdl", "#", "#", 2, "", "-256,0,80", "0,180,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineroom.mdl", "#", "#", 3, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineroomend.mdl", "#", "#", 1, "", "0,-256,80", "0,90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineroomend.mdl", "#", "#", 2, "", "0,-256,80", "0,-90,0"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineshaft.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combineshaftend.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
PIECES:Record({"models/coldsaturnight/dungeons/combinestart.mdl", "#", "#", 1, "", "256,0,80"})
|
||||
if(gsMoDB == "SQL") then sqlCommit() end
|
||||
end
|
||||
|
||||
|
@ -397,6 +397,7 @@ anymore to maintain cetain track packs leading in **NO SUPPORT**, which is also
|
||||
* [SligWolf's Suspension train](https://steamcommunity.com/sharedfiles/filedetails/?id=3297918081) [**(AUTHOR)**][ref-maintained]
|
||||
* [Modular City Street](https://steamcommunity.com/sharedfiles/filedetails/?id=3314861708)
|
||||
* [Scene Builder](https://steamcommunity.com/sharedfiles/filedetails/?id=2233731395)
|
||||
* [Modular Dungeons](https://steamcommunity.com/sharedfiles/filedetails/?id=3302818415&searchtext=dungeon)
|
||||
|
||||
#### Where are the trains/vehicles[,][ref-easter] are there any of these?
|
||||
Dude seriously, make them yourself, what's the point of playing Gmod then ... xD
|
||||
|
Loading…
Reference in New Issue
Block a user