[0.11.1] Building Overrides apply data to location incorrectly

Discuss modding questions and implementation details.
Post Reply
User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

[0.11.1] Building Overrides apply data to location incorrectly

Post by XJDHDR »

I'm in the process of converting my bugfix mod from using Map Block and Location overrides to using Building overrides. I have encountered a problem though.

For some context, there is a Fighters Guild in one block used in some desert settlements where it's BuildingDataList incorrectly labels the building as a Temple. This causes the game to identify the building as a Temple of the Fighter Trainer faction. In this example, I have visited the city of Ramoaweyn in the Alik'r Desert.

Image
Image


My solution was to fix this in both a Block override and location overrides for every settlement that used this block. This corrected the issue.

Image
Image
Image


Now, I'm trying to create a Building override that does the same thing. I dumped a Building Override for the FG then loaded it into my game and did not load the Block or Location overrides I already had.
The first problem I ran into was that the FactionId in the Building override I dumped didn't carry over from the Block. I had to manually change the 0 in that file to 41.
The second problem I'm having is that with the Building Override, even though the game still correctly identifies the FG as a guild it now seems to have changed the name of the city's Temple to Stendarr to "Fighter Trainers". The people inside even behave like Fighters Guild members.

Image
Image
Image
Image
Image


I have attached the Building override I currently have:
FIGHBL00.RMB-677-building0.zip
(1.28 KiB) Downloaded 90 times

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [0.11.1] Building Overrides apply data to location incorrectly

Post by Hazelnut »

What's happening is that you're taking a temple out of the location, which will be messing up the building list matching. You will need to alter the building lists for all locations where this block is used if you have a building override use its own faction id. (since that doesn't get used in the matching)

Either change the location data to be correct and don't set a faction id in the building override or take the entry out of the location list altogether. Since it sounds like you already modified the location it's probably best to simply change faction id to 0. Then it should work. I think. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: [0.11.1] Building Overrides apply data to location incorrectly

Post by XJDHDR »

I tried removing the FactionID from my Building override and loaded my location file. It looks like this fixes the problem. The buildings seem to be acting the same way as when I had the Block override.

For interest sake, how would I "take the entry out of the location list altogether"?

That said, this doesn't seem to be optimal. I was under the impression that Building overrides replaced the need to create a Location override for each place using the block. I would also think that the building that is being overridden would be decided by it's index in the Block and Location data rather than trying to figure out which building looks like the one that most closely matches the override's data, as you seem to be describing it.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [0.11.1] Building Overrides apply data to location incorrectly

Post by Hazelnut »

Building overrides do replace the need for location data changes if you follow the instructions I gave, but if you wanted to do things differently I was explaining how you could make it consistent. It's based off how DFU matches location building data to block data, and gives control over whether the building override defines it's own data or is a candidate for matching location data.

I've done my best to explain this when I updated the documentation thread, but it's not easy to explain. This is not a situation I explicitly designed, it's just how it works given the original DF data and the DFU matching code.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: [0.11.1] Building Overrides apply data to location incorrectly

Post by XJDHDR »

The other instructions you gave was to "take the entry out of the location list altogether". How do I do that?
That still sounds like modifying the location data though, unless this location list is somewhere else.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [0.11.1] Building Overrides apply data to location incorrectly

Post by Hazelnut »

yes I mean the location building data that gets matched, and you would need to do it for all locations using the block so not a great idea but it's possible so i wanted you to be aware of the option.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply