Anyone able to help me out, I want to make a totally new network item, new unattached road, a new waterpipe, a new airway line.
Please do not waste everyone's time with a blank answer of use createnodet.
I want a way to make a new NETAI, a new prefab, set the segmentid, how to make a start node and a end node.
once I have all of that I can handle all the rest of the coding
Here is the createnode procedure, but again I need code to make NetInfo netInfo
private void CreateNode(out ushort startNode, ref Randomizer rand, NetInfo netInfo, Vector2 oldPos, float elevation)
{
var pos = new Vector3(oldPos.x, 0, oldPos.y);
pos.y = Singleton<TerrainManager>.instance.SampleRawHeightSmoothWithWater(pos, false, 0f);
var nm = Singleton<NetManager>.instance;
nm.CreateNode(out startNode, ref rand, netInfo, pos,
Singleton<SimulationManager>.instance.m_currentBuildIndex);
Singleton<SimulationManager>.instance.m_currentBuildIndex += 1u;
}
Please do not waste everyone's time with a blank answer of use createnodet.
I want a way to make a new NETAI, a new prefab, set the segmentid, how to make a start node and a end node.
once I have all of that I can handle all the rest of the coding
Here is the createnode procedure, but again I need code to make NetInfo netInfo
private void CreateNode(out ushort startNode, ref Randomizer rand, NetInfo netInfo, Vector2 oldPos, float elevation)
{
var pos = new Vector3(oldPos.x, 0, oldPos.y);
pos.y = Singleton<TerrainManager>.instance.SampleRawHeightSmoothWithWater(pos, false, 0f);
var nm = Singleton<NetManager>.instance;
nm.CreateNode(out startNode, ref rand, netInfo, pos,
Singleton<SimulationManager>.instance.m_currentBuildIndex);
Singleton<SimulationManager>.instance.m_currentBuildIndex += 1u;
}