Tutorials/Map Editor/Prefabs/Prefab Nodes

From SCS Modding Wiki
< Tutorials‎ | Map Editor‎ | Prefabs
Revision as of 12:24, 17 April 2024 by TeamDeer (talk | contribs) (Prefabs: Nodes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You should be familiar with the settings and dialog options on Prefabs by now. Before we can connect and setup our first prefab we must dive into the types of connections that prefabs can make and some weird quirks with connecting them.

Much like road nodes, prefabs have 2 main node types. A red node (seen as a square in the map editor), known as the origin, and a green node. A prefab will only have one origin (red) node, however, they can have multiple green nodes. Each node on a prefab is a potential point to connect another object, such as a road or prefab. The amount of nodes will vary depending on the prefab. Nodes are defined on the model itself and setup in a modeling program.



Note: You can never connect a red node to a prefab red node - it won't work!



Green Prefab Node
Red Prefab Node



Let's take a look at a few example of different origins on a prefab using this prefab /prefab2/cross_temp/ger/ger_r1_x_r1_t_narrow_tmpl.ppd

1 Prefab full.jpg Prefab with an Origin of 0


(Top Side)

2 Prefab origin1.jpg Prefab with an Origin of 1


(Right Side)

3 Prefab origin2.jpg Prefab with an Origin of 2


(Left Side)



Notice how the red node moved to different sides of the prefab? This is the effect of changing the origin. You may have to change the origin in order to correctly connect items to the prefab.

Here are a few examples of good and bad connections:

1 Prefab bad connection.jpg Prefab cannot connect to road due to 2 red nodes


Note: If you try to connect these 2 and Snap to Nodes is on, it will look like it connected, but it did not and the navigation will not work

2 Prefab good connection.jpg Prefab will connect to road due to 1 green and 1 red node
3 Prefab good connection2.jpg Prefab will connect to road due to 2 green nodes



You will notice a few older prefabs, such as /prefab/light_factory/light_factory.ppd have multiple nodes, however, trying to connect a road to these produces a strange result:

Funny prefab connection.jpg



For these prefabs you simply drag a road/prefab piece to touch the prefabs geometry where you'd expect the entrance to be and the navigation will still work. This is caused by how this particular prefab was setup in Blender