Changes

Jump to navigation Jump to search
Prefabs: Nodes
{{TutorialNavigation|previous=Prefab Properties|next=Connecting your first Prefab}}

<big>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.
<br>

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.</big>

<br>
<br>
{{Note|You can '''never''' connect a red node to a prefab red node - it ''won't'' work!}}
<br>
<br>

[[File:Prefab green node.png|1024px|frame|left|Green Prefab Node]]
[[File:Prefab red node.png|1024px|frame|right|Red Prefab Node]]

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

{| class="wikitable" width="100%"

|- style="vertical-align: top"
| width="10px" | '''1'''
| width="25%" | [[File:Prefab full.jpg|upright|768px]]
| <big>Prefab with an Origin of 0
<br>
(Top Side)</big>

|- style="vertical-align: top"
| width="10px" | '''2'''
| width="25%" | [[File:Prefab origin1.jpg|upright|768px]]
| <big>Prefab with an Origin of 1
<br>
(Right Side)</big>

|- style="vertical-align: top"
| width="10px" | '''3'''
| width="25%" | [[File:Prefab origin2.jpg|upright|768px]]
| <big>Prefab with an Origin of 2
<br>
(Left Side)</big>

|}
<br>
<br>
<big>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.</big>
<br>
<br>
<big>Here are a few examples of good and bad connections:</big>

{| class="wikitable" width="100%"

|- style="vertical-align: top"
| width="10px" | '''1'''
| width="25%" | [[File:Prefab bad connection.jpg|upright|768px]]
| <big>Prefab cannot connect to road due to 2 red nodes</big>
<br>
{{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}}

|- style="vertical-align: top"
| width="10px" | '''2'''
| width="25%" | [[File:Prefab good connection.jpg|upright|768px]]
| <big>Prefab will connect to road due to 1 green and 1 red node</big>

|- style="vertical-align: top"
| width="10px" | '''3'''
| width="25%" | [[File:Prefab good connection2.jpg|upright|768px]]
| <big>Prefab will connect to road due to 2 green nodes</big>

|}
<br>
<br>
<big>You will notice a few older prefabs, such as <code>/prefab/light_factory/light_factory.ppd</code> have multiple nodes, however, trying to connect a road to these produces a strange result:</big>
<br>
<br>
[[File:Funny prefab connection.jpg|768px|frameless|center]]
<br>
<br>

<big>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</big>
<br>
<br>
{{TutorialNavigation|previous=Prefab Properties|next=Connecting your first Prefab}}
123
edits

Navigation menu