Skip to content

Commit

Permalink
Updated library control statements (#59)
Browse files Browse the repository at this point in the history
Fixed table definition runtime error for `ExportSyncDB`
Fixed: Actually use the super-elevation return value to notify the client
Fixed: Angle grid/snap triggering log messages
Fixed: Apply super-elevation when spawn flat is not checked
Fixed: Automatically populate POA row value on registration
Fixed: Categories not being exported due to one-liners
Fixed: Close generated files on sort fail
Fixed: Context menu `box` copy returning the incorrect row due to different cords
Fixed: Context menu icons not being displayed correctly
Fixed: Create table STMT building improper error logs
Fixed: Creating table index error report order
Fixed: Curve node remove on the client checks its status
Fixed: Curve node remove reverts the value of the last node
Fixed: DB export flag not being reset on menu error
Fixed: DSV auto-run loading due to `FORM_PREFIXDSV` being changed
Fixed: DSV manager buttons get squished when many DSV are present
Fixed: DSV manager properly showing generic database
Fixed: DSV registration existence check crash when source not provided
Fixed: Data selection sequential errors due to comparing different data type
Fixed: Direct value injection in `tA = {}`
Fixed: Equalize export column order for SQL/LUA mode
Fixed: Executing action OPEN_EXTERNDB status being unchecked
Fixed: Exit properly on SQL build deny
Fixed: Export BD convar is not reset when exporting inventory
Fixed: Export auto-run failing due to the new control statement
Fixed: Export track type as DSV in SQL mode
Fixed: Export type auto-run not finding a data checks
Fixed: Exporting DSV in Lua mode create unnecessary table
Fixed: Exporting DSV in SQL mode triggers data matching error
Fixed: Exporting DSV process triggering error due to query store missing
Fixed: Exporting content for sync inventory missing new added models due to the store cache
Fixed: Exporting content to autorun file trigger order error in SQL mode
Fixed: External DB manager closing its panel when no line is selected on entry
Fixed: External DB manager creating new DSV when edit is triggered
Fixed: Failed routine `ExportTypeDSV` cannot index files P/A
Fixed: File fore-close for `ExportDSV` on some fail cases
Fixed: Frequent pices panel sorting crashing in LUA mode
Fixed: Frequent pieces panel not working
Fixed: Frequent pieces retiring more that N when more than N are valid
Fixed: Frequent pieces return the table when at least one is present
Fixed: Frequent pieces updated with records without post-work
Fixed: General sorting when values are missing. Nil is less than everything
Fixed: Incorrect indexing for DSV synchronization raises errors in track pack scripts
Fixed: Inventory export runtime errors with library self-reference
Fixed: Log settings return proper value
Fixed: Logic and runtime errors of `ExportTypeDSV`
Fixed: Lower the network latency when sending normal vectors
Fixed: Lua mode exports being more accurate
Fixed: Luapad call crashing when editing DSV contents
Fixed: Luapad prefix is not displayed on the opened tab
Fixed: Matching forcing errors in  LUA mode
Fixed: Node name is always overridden by category
Fixed: Node settings not being copied in some cases
Fixed: Panel content not sorted correctly due to missing local reference
Fixed: Panel runtime errors
Fixed: Phys properties generating sequential errors
Fixed: Phys property size being bound to sequential records
Fixed: Physical properties exported as DSV PKs are not ordered
Fixed: Physical properties table exports PK without quotes
Fixed: Population additions on autorun checking for no data found
Fixed: Prefix/parameters being consistent across all APIs
Fixed: Primary table validation proper build error report
Fixed: Provide the context menu tables option if such are available at all
Fixed: Reduce the network overhead for `CREATE_CURVE_NODE`
Fixed: Reduce the select columns count for additions
Fixed: Registering a DSV does not show source script in the logs
Fixed: Routine `ExportTypeRun` failed to export contents in lua mode
Fixed: Routine pieces search by type icon missing
Fixed: Runtime error due to missed bracket in `CacheQueryAdditions`
Fixed: Runtime error file exists missing the second argument
Fixed: Runtime error in `ImportDSV` relative to `DATA`
Fixed: Runtime errors in `ExportSyncDB` and `ExportTypeDSV` for SQL mode
Fixed: Runtime errors in `ExportTypeDSV` for DB mode
Fixed: Runtime errors in `ProcessDSV` using old folder path
Fixed: Runtime missing bracket in `ApplySuperElevation`
Fixed: Some runtime errors
Fixed: Some runtime errors
Fixed: Some runtime errors
Fixed: Some spaced in the header logs
Fixed: Some table routines runtime errors `ExportContentsRun`
Fixed: Some typos reading auto-run export comments
Fixed: Super-elevation auto update not working on node update
Fixed: Tool panel runtime errors `asmlib.*`
Fixed: Tool tree panel sorts non-categorized items with priority
Fixed: Translation not showing database mode
Fixed: Tree export context menu calling wrong routine
Fixed: Unneeded square root calculation in `GetNearest`
Fixed: Use different placeholders for tool panel item rooting. Utilize `pNode`
Fixed: Utilizing `tpText:Scan` using wrong field
Fixed: When less values are provided in the DSV do not trigger length error on import
Fixed: Where clause failing with parameter missing
Fixed: Wire-mod extension tester
Fixed: Wrong storage of grater-equals
Fixed: `ExportSyncDB` accessing global `WorkshopID`
Fixed: `ExportSyncDB` addressing the wrong log pattern
Fixed: `XQM Ball Rails` category triggering a silent error due to mismatch
Fixed: `isstring` global being defined two times
Added: 100% grade as OP variable `FULL_SLOPEDG` tan(45)
Added: All tree panels now open the context tree menu when eligible to do so
Added: Attachment extraction via unique entity index and log per type
Added: Automatic Z offset update when selecting curve node via active point
Added: Automatic folder creation when requesting a path
Added: Automatic generator for misaligned pipes new E2 style
Added: Automatic super-elevation for curved tracks
Added: Better logic control flow for `Categorize`
Added: Cache PIECES method `ExportTypeDSV` for LUA mode
Added: Category for `Scene Builder`
Added: Category sort/export into separate functions
Added: Centralized function to copy from list view
Added: Check of the modified normal exists
Added: Context menu with selection options for the track selection tree
Added: Custom columns ID option to `GetColumnList`
Added: Custom columns ID option to `GetConcat`
Added: Customizable table row concatenation
Added: DSV manger list view content move option and translations
Added: DSV synchronizer not handling existent open fail
Added: Dedicated prefix for generic ( whole DB containers )
Added: Description for `GetCurveTransform`
Added: Description for super-elevation
Added: Export DSV header configurations
Added: Export tracks inventory on shift + click
Added: Force EXP destination for Export/Import DSV
Added: Freshly exported content database from the gmod client
Added: Function to export list-view rows
Added: General structure for tool panel with category
Added: Generic DB file existence checker for the exports
Added: Handle actions status properly for `pcall`
Added: Import DSV utilizes file header
Added: Import/Export category being forced from/to the EXP folder
Added: Internal queries are defined in the table definition
Added: LUA mode routine for `ExportTypeRun` populating pieces table
Added: Load the node into tool offsets
Added: Menu options size instead of a while + increment
Added: Mode tree context menu translation and icons
Added: More checks when importing a DSV file
Added: More export options for DSV format and script format
Added: More fail-safe handling for size/used cache parameter
Added: More items in scene builder
Added: More logging skip triggers
Added: Move validation to the hook info tracker
Added: Pieces record trigger to default POA values to NULL
Added: Query store and format as table method
Added: Return empty sort set when providing empty table. Skip processing
Added: Routine pieces can also export content
Added: Routine pieces context menu
Added: Scene builder addon content
Added: Sequential checks for all tables in SQL/LUA mode
Added: Some `Scene builder` but not being validated yet
Added: Some micro-optimizations
Added: Some missing translations
Added: Sorting when exporting data in Lua mode
Added: Store index count in the SQL command table
Added: Synchronization commit from the master branch
Added: TODO list for `CurveUpdate`
Added: Test if the file is present before opening
Added: The rest of the items for `Scene Builder`
Added: Timer definition as table support
Added: Timer setup support for multiple types
Added: Tooltips for category/model nodes label/icon/expander/validation
Added: Translation for the routine pieces context menu
Added: Translations for Bulgarian and Russian
Added: UTF-8 BOM to the Chinese translations
Added: Upload/Download node offsets and marker in `DrawHUD`
Added: Upload/Download node offsets in `CurveUpdate`
Added: Usage of `PATTEM_EXDSVHED` in the rest of the places
Added: User preferences for amount of super-elevation
Added: Varargs to custom sorting
Added: `Export type` option when right-click on a tree type
Changed: Export tree context menu icon
Changed: Only one database per table to trigger generic population
Changed: Open DSV manager will be triggered by export DB button
Changed: Panels context menu localization and icon hashes
Changed: Reduce wrap arguments count
Changed: Some logs when Lua table routine handler fails
Changed: Utilize global file value
Improved: Log formatting for less concatenations (PATTEM_EXDSVHED)
Improved: Make sure to catch bad table column configuration on create
Improved: Reduce memory for indices (1) is the same as (1,2) unique
Improved: Store only query panel row index instead of duplicating model/name
Moved: Tree dedicated context menu to its function
Optimized: Category sorting for nil/string
Optimized: Frequent pieces. Do not loop if no need to
Optimized: Read phys-properties column name in a local variable
Optimized: `ChecheQueryPanel` and its data structure
Optimized: `SettingsLog` bail early when conditions are not met
Optimized: `asmlib.GetWrap` being 50% faster. Removed loop
Remove: table definition local variable `PHYSPROPERTIES` not used
Removed: Category hash table and current category reference
Removed: Export database as a file will not be present on the server
Removed: Export inventory form panel tree buildup
Removed: Frequent pieces count parameter is not needed anymore
Removed: Function `GetWrap` not needed anymore
Removed: Library pointer usage inside itself
Removed: Localized reference for root pointer. Use hash instead
Removed: Nasty button FS handler from DSV configuration
Removed: Needless table/columns indexing in `AddLineListView`
Removed: Numbers from comments
Removed: One-liner export error trigger in `ExportCategory`
Removed: Reading default class and creating POA for every addition
Removed: Reverse-hash indexing for tree nodes
Removed: Some data exports that are old and nor relevant anymore
Removed: Some unused variables from `AttachAdditions`
Removed: Translation `pn_externdb_lb` not needed anymore
Removed: Usage of `OPSYM_ENTPOSANG` register/locate is unneeded
Removed: Use the text fields metadata instead of `excgRow`
Removed: `GetDirectory` using revers indexing. Utilize reference hash-jumps instead
Removed: `MISS_NOTR` as translations work differently now
Removed: `PushSortValues` integrated in `GetFrequentModels`
Removed: `TYPEMT_VECTOR` and `TYPEMT_ANGLE` that are not used
Removed: `iInd` from `GetFrequentPieces` as it is not used
Rename: FORM_PREFIXDSV > FORM_PREFIXFDB
Rename: `ExportAR` to `ExportContentsRun`
Rename: `ext_dsv` localization to `extdsv`
Renamed the auto-run related functions to the new convention
Renamed: Bodygroup apply to actual apply
Renamed: Generic prefix local variable
Renamed: PrioritySort > Arrange
Renamed: Some local variables
Renamed: `CacheQueryInventory` to `CacheQueryTree` using inventory cached version
Renamed: `CacheQueryPanel` to `CacheQueryInventory`
Renamed: `Element` to `Content`
Renamed: `SetSomethingNode` to `SetNodeSomething`
Reverted: Expand panel location
Updated: Russian translation by phrase hash
Updated: DSV button mangers to prefix context menu
Updated: Import/Export category
Updated: Add translation to be removed after a sync
Updated: Additions data insertion trigger in LUA mode
Updated: Auto-run export function headers
Updated: Better sorting algorithm
Updated: Category export header general format
Updated: Category header internal pattern
Updated: Category sorting and population
Updated: Chose the unique index for all tables
Updated: Code rearrangement and var localization
Updated: DSV databases can show the internal error when present ( coding style )
Updated: DSV manager now uses hash notation as well
Updated: Database synchronization script
Updated: English translations for the prefix context menu
Updated: Export auto-run configuration
Updated: Export synchronization file independent from DEV mode
Updated: Export type to DSV format in LUA mode
Updated: Exported content include purpose in the file name
Updated: French translations
Updated: Frequent pieces is searched by internal column ID (1,2,3,4)
Updated: Frequent pieces now use indices for (model,type,name,act)
Updated: Frequently used data contains also request count
Updated: General path format during export only used in `GetLibraryPath`
Updated: General usage of one error function preserving the stack
Updated: Generic database prefix from library name
Updated: Import category clamps the marker. Zero is invalid
Updated: Library control statements
Updated: Link to the silk icons to the proper Gmod link page
Updated: Log proper data when navigation is missing
Updated: Matching database mode check move up
Updated: Matching exit early when number is invalid
Updated: Micro-optimization when calling `GetColumnName`
Updated: Not exists in some cases by default
Updated: Pieces DSV export multi-liner
Updated: Pipe E2 Export generator
Updated: Query parameters at the top
Updated: Query store selection operator
Updated: Quit executing the script if module load fails
Updated: Rearrange auto-run export file
Updated: Routine pieces search and list vie use the same column names
Updated: Routine pieces translation in one place
Updated: SQL build statement library
Updated: Some typos and grammar updates for Shinji and autorun
Updated: Sorting function `VCOMPARE_SDAT`
Updated: Statement key `CacheQueryPiece` used only in SQL mode
Updated: Switched to number to hash notation in the frequent pieces panel
Updated: Trace root information being handled better
Updated: Type as DSV table cloture concatenation in SQL mode
Updated: Use library path instead of `FORM_PREFIXDSV`
Updated: Use trace fraction when calling `GetCurveTransform`
Updated: Utilize `debugGetinfo(1).name` instead of function name hard coding
Updated: `ExportContentsRun` routine request being run trough protected call
Updated: `ExportSyncDB` with better handling
Updated: `ExportTypeRun` now uses proper indexed ordering
Updated: `RegisterPOA` storing the input data in row mode. Decoded when locating
Updated: `SetDirectory` to match the new tree creation routine
Updated: convert log formatting to local for `ExportTypeDSV`
Utilize: for-integer loop with Table.Size in some places
Utilize: integer-for loop
Utilize: Addition.Size
Utilize: `tableInsert` in `ProcessDSV`
  • Loading branch information
dvdvideo1234 authored Dec 27, 2024
1 parent ac751fc commit 9360519
Show file tree
Hide file tree
Showing 30 changed files with 8,547 additions and 8,132 deletions.
136 changes: 136 additions & 0 deletions data/expression2/TA_Pipe_Generator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
@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

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

# 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()
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")
holoCreate(4), holoColor(4,vec(0,255,255)), holoScale(4,0.1*vec(1,1,1)) holoModel(4,"cone")
holoCreate(5), holoColor(5,vec(0,255,0)), holoScale(5,0.1*vec(1,1,1)) holoModel(5,"cube")
holoCreate(6), holoColor(6,vec(255,0,255)), holoScale(6,0.1*vec(1,1,1)) holoModel(6,"cube")

TU = Scanner:setFTrace(C + SizeCenter:x() * U, U, ScanR):useArray():putArray(Scanner)
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)
}

function drawFTrace(T:ftrace, N:number)
{
P = T:getPosWorld()
D = T:getDirWorld()
A = D:toAngle()
A = A:rotateAroundAxis(A:right(), -90)
holoPos(N, P)
holoAng(N, A)
}

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())
{
VU = (TU:getFractionLen() - TD:getFractionLen())
VR = (TR:getFractionLen() - TL:getFractionLen())
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)
}

C = C + F * Delta
TU:rayMove(F + DL, Delta)
TD:rayMove(F + DL, Delta)
TR:rayMove(F + DL, Delta)
TL:rayMove(F + DL, Delta)
}
else
{
# print("Iteration:", Iter)
if(Iter <= 0)
{
Scanner = noentity()
}
C = C - F * Delta
TU:rayMove(F, -Delta)
TD:rayMove(F, -Delta)
TR:rayMove(F, -Delta)
TL:rayMove(F, -Delta)
Delta = Delta / 2
Iter = Iter - 1
}
}
else
{
if(Pipe != noentity())
{
Mo = Pipe:model()
Or = Pipe:toLocal(MP)
OrX = toString(round(Or:x(), Raun))
OrY = toString(round(Or:y(), Raun))
OrZ = toString(round(Or:z(), Raun))
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+"})")
Pipe = noentity()
}
}
}
4 changes: 2 additions & 2 deletions data/expression2/TA_Wire_Test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ if(first() || dupefinished())
}else{ error("Additions line fail "+M) }

P1 = trackasmlibGetProperty()
if(P1[3,string] == "Metal")
if(P1[3,string] == "Liquid")
{
P2 = trackasmlibGetProperty(P1[3,string])
if(P2[5, string] == "crowbar")
if(P2[1, string] == "slime")
{
print("Property type OK <"+P2[5, string]+">")
}else{ error("Property type fail <"+P2[5, string]+">")}
Expand Down
8 changes: 0 additions & 8 deletions data/trackassembly/exp/cl_TRACKASSEMBLY_ADDITIONS.txt

This file was deleted.

91 changes: 0 additions & 91 deletions data/trackassembly/exp/cl_TRACKASSEMBLY_PHYSPROPERTIES.txt

This file was deleted.

Loading

0 comments on commit 9360519

Please sign in to comment.