Jump to content
Lookii

Associate BuildingInfo.PathInfo with NetSegment

2 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hi, 

I'm in the process of programming my first mod which includes changing the net type of a segment. For this I need to find the segments a building like a Train Station uses for its Tracks. I've come so far that I check the Building.Info.m_paths - Array for the segments associated, however these are saved as BuildingInfo.PathInfo.

As far as I know to change a segment you need to change the NetSegment.m_infoIndex attribute. How can I get this attribute with only knowing the BuildingInfo.PathInfo?

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I think you are on the wrong track.
The BuildingInfo is not an actual building instance, but a template.

That template is used when placing a new building. It's relatively easy to modify paths of a building before placing it.

The placed building instance can be found in BuildingManager#m_buildings. Every Building instance contains an ushort field that represents a NetSegment id that is contained in the building.

This NetSegment has some kind of "m_next" field which points to another segment (linked list) and so on.

Changing the network type requires more than changing a single field. The clean way is to delete the segment, then place a new one.

Share this post


Link to post
Share on other sites

Sign In or register to comment...

To comment in reply, you must be a community member

Sign In  

Already have an account? Sign in here.

Sign In Now

Create an Account  

Sign up to join our friendly community. It's easy!  

Register a New Account


×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections