Skip to content
Deyan Dobromirov edited this page Nov 4, 2022 · 27 revisions

Description

The Track assembly tool Expression 2 API is used for a wrapper of the library functions, which handle the track piece snapping, so you can call them inside an E2 and thus create your own automatically generated layouts. This also can be used when you need to implement track switchers, where you just snap desired track piece to the track end you wish to use. You can then apply your desired properties, like disable physgun no-collide and weld to make sure the piece is not going anywhere and it is not generating server collisions.

Data types

This list is derived from the Wiremod types wiki located here.

API functions list

For every table, there is a wrapper function that reads the desired data you want:

                            Class methods                                Out   Description 
image:trackasmlibApplyPhysicalAnchor(image,image,image,image,image) image Anchors the track entity to a base entity with weld 0/1 and no-collide 0/1 no-collide-world 0/1 and force limit.
image:trackasmlibApplyPhysicalSettings(image,image,image,image) image Modifies track entity physical settings with physics gun enabled 0/1, freeze 0/1, gravity toggle 0/1 and surface material behavior
image:trackasmlibAttachAdditions(image) image Attaches the track entity additions when available
image:trackasmlibAttachBodyGroups(image) image Attaches track piece body-groups by providing selection code
image:trackasmlibGenActivePointDSV(image,image,image,image,image) image Exports the track entity as external database record
image:trackasmlibGenActivePointINS(image,image,image,image,image) image Exports the track entity as internal database record
image:trackasmlibGetAdditionsCount(image) image Returns record additions count by entity
image:trackasmlibGetAdditionsLine(image) image Returns record additions line by entity
image:trackasmlibGetBodyGroups(image) image Returns the track bodygroup selection list
image:trackasmlibGetName(image) image Returns record name by entity
image:trackasmlibGetOffset(image,image) image Returns record snap offsets by entity
image:trackasmlibGetPointsCount(image) image Returns record points count by entity
image:trackasmlibGetSkin(image) image Returns the track skin selection list
image:trackasmlibGetType(image) image Returns record track type by entity
image:trackasmlibHasAdditions(image) image Returns 1 when the record has additions and 0 otherwise by entity
image:trackasmlibIsPiece(image) image Returns 1 when the record is actual track and 0 otherwise by entity
image:trackasmlibMakePiece(image,image) image Duplicates the given track using the new position and angle
image:trackasmlibMakePiece(image,image,image) image Creates new track piece with position angle, mass by entity
image:trackasmlibMakePiece(image,image,image,image) image Creates new track piece with position angle, mass and skin code by entity
image:trackasmlibMakePiece(image,image,image,image,image,image,image,image) image Creates new track piece with position angle, mass, skin code, color and alpha as numbers by entity
image:trackasmlibMakePiece(image,image,image,image,image) image Creates new track piece with position angle, mass, skin code and color as vector alpha is 255 by entity
image:trackasmlibMakePiece(image,image,image,image,image,image) image Creates new track piece with position angle, mass, skin code and color as vector alpha as number by entity
image:trackasmlibSnapEntity(image,image,image,image,image,image,image,image) image Returns track entity snap position and angle array by holder model, point ID, active radius, flatten, ignore type, position offset and angle offset
                          General functions                             Out   Description 
trackasmlibGetAdditionsCount(image) image Returns record additions count by model
trackasmlibGetAdditionsLine(image,image) image Returns record additions line by model
trackasmlibGetName(image) image Returns record name by model
trackasmlibGetOffset(image,image,image) image Returns record snap offsets by model
trackasmlibGetPointsCount(image) image Returns record points count by model
trackasmlibGetProperty(image) image Returns an array with all surface property types
trackasmlibGetProperty(image) image Returns the surface properties available for a given type
trackasmlibGetPropertyCount(image) image Returns how many property types are available
trackasmlibGetType(image) image Returns record track type by model
trackasmlibHasAdditions(image) image Returns 1 when the record has additions and 0 otherwise by model
trackasmlibIsPiece(image) image Returns 1 when the record is actual track and 0 otherwise by model
trackasmlibMakePiece(image,image,image,image) image Creates new track piece with position angle, mass by model
trackasmlibMakePiece(image,image,image,image,image) image Creates new track piece with position angle, mass and skin code by model
trackasmlibMakePiece(image,image,image,image,image,image,image,image,image) image Creates new track piece with position angle, mass, skin code and color and alpha as numbers by model
trackasmlibMakePiece(image,image,image,image,image,image) image Creates new track piece with position angle, mass, skin code and color as vector alpha is 255 by model
trackasmlibMakePiece(image,image,image,image,image,image,image) image Creates new track piece with position angle, mass, skin code and color as vector alpha by as number model
trackasmlibSnapNormal(image,image,image,image,image,image) image Returns track surface snap position and angle array by position, angle, model, point ID, position offset and angle offset