Table of Contents
Building Asset Processor
You can register a BUILDING_ASSET_PROCESSOR on any FBX to partially automatize the configuration of your building or monument building part nodes.
Register the asset processor on a FBX like that:
- monument.lua
-- Apply building asset processor mod:registerAssetProcessor("models/MithrilFactory.fbx", { DataType = "BUILDING_ASSET_PROCESSOR" })
Automatic part detection
The processor will automatically add the COMP_BUILDING_PART component to each node containing the word Part
in their name.
Automatic construction step link
The processor will automatically assign ConstructionVisual
to the building part if it exists another node, with the same name, same parent names, in a root node called ConstructionSteps
.
For instance, the part AA/BB/ChimneyPart
will search for a node called ConstructionSteps/AA/BB/ChimneyPart
to use as a ConstructionVisual
.
Automatic attach node detection and configuration
The processor will automatically add the COMP_BUILDING_ATTACH_NODE component to each node containing the word Attach
in their name.
Moreover, certain keyword in the name will give additional instruction:
major
in the name will give the node attach typeMAJOR
minor
in the name will give the node attach typeMINOR
top
in the name will give the node attach typeINNER_TOP
bottom
in the name will give the node attach typeINNER_BOTTOM
door
in the name will give the node attach typeDOOR
bridgeend
in the name will give the node attach typeBRIDGE_END
left
in the name will give the node attach typeLEFT
right
in the name will give the node attach typeRIGHT
Automatic path detection
Paths are building part entrances and exits. They are a list of nodes forming a path to enter the building.
Nodes with names starting with PATH_
will be interpreted as path for the parent part. PATH nodes must be direct children of their parent part.
Buildings can have many paths, each path is identified by a letter. For instance, each node starting with PATH_A_
will be part of Path A.
a number is then used to define the path sequence:
PATH_A_1
PATH_A_2
PATH_A_5
PATH_A_6
It's fine if there is holes in the number sequence, but you can't use the same number twice for the same path.
Nodes can also be used in more than one path:
PATH_AB_1
PATH_AB_2
PATH_A_3
PATH_B_3
In that case, path A and B are sharing the two first nodes.
Sharing nodes is specially important when agents can enter by a door and leave by another one. To do so, both door needs to end with a shared node:
PATH_A_1
PATH_A_2
PATH_A_3
PATH_B_1
PATH_B_2
PATH_AB_4
Since both path ends with node PATH_AB_4
, an agent could leave the building from path A or B as long as he entered the part with any of those path.
Note: automatic path setup doesn't allow to set a path's type. For this, paths need to setup manually in the building part (COMP_BUILDING_PART.PathList
)