[GS] Buildings resource to build

Riker13

King
Joined
Nov 9, 2001
Messages
859
Location
UK
Hi All,
I am trying to have ALL buildings and wonders in the game have two resources to build like Stone and Lumber (Using Anders AOK_Lumber mod) I have my own buildings working but I cant seem to get the games buildings/wonders to work.

I have tried using:
<Building_ResourceCosts>
<Row BuildingType="BUILDING_HANGER" ResourceType="RESOURCE_LUMBER" StartProductionCost="10" PerTurnMaintenanceCost="0"/>
<Row BuildingType="BUILDING_HANGER" ResourceType="RESOURCE_STONE" StartProductionCost="30" PerTurnMaintenanceCost="0"/>
</Building_ResourceCosts>
Which works in my mod for my buildings but not for the rest, should I be using Update or replace or something?
I have seen this work in SQL but would like it in XML.

Regards
Riker13:crazyeye:
 
Hi Lees,
database.log said:
[1359300.969] [Gameplay] ERROR: UNIQUE constraint failed: Building_ResourceCosts.BuildingType, Building_ResourceCosts.ResourceType
[1359300.969] [Gameplay]: While executing - 'insert into Building_ResourceCosts('BuildingType', 'ResourceType', 'StartProductionCost', 'PerTurnMaintenanceCost') values (?, ?, ?, ?);'
[1359300.969] [Gameplay]: In XMLSerializer while inserting row into table insert into Building_ResourceCosts('BuildingType', 'ResourceType', 'StartProductionCost', 'PerTurnMaintenanceCost') with values (BUILDING_HANGER, RESOURCE_STONE, 30, 0, ).
[1359300.969] [Gameplay]: In XMLSerializer while updating table Building_ResourceCosts from file Buildings_Update.xml.
[1359300.969] [Gameplay] ERROR: UNIQUE constraint failed: Building_ResourceCosts.BuildingType, Building_ResourceCosts.ResourceType

[1359301.488] [Gameplay] ERROR: Invalid Reference on Building_ResourceCosts.BuildingType - "BUILDING_HANGER" does not exist in Buildings
[1359301.488] [Gameplay] ERROR: Invalid Reference on Building_ResourceCosts.BuildingType - "BUILDING_HANGER" does not exist in Buildings
[1359301.488] [Gameplay] ERROR: Invalid Reference on Building_ResourceCosts.BuildingType - "BUILDING_HANGER" does not exist in Buildings

Load Order is 150.

Update, ok its working but for some reason does not like BUILDING_HANGER or
BUILDING_BOLSHOI_THEATER?
 
Last edited:
BUILDING_BOLSHOI_THEATRE

BUILDING_HANGAR


Fix the typos first and then see if that cures the Unique Constraint error as well. Because a reference to a "nil" building will probably have odd results in child tables that are required to reference back to valid data in the Primary table (in terms of the errors you might get other than the Invalid Reference error which is quite correct for your situation of mis-spelled Building Type names.).
 
Last edited:
Oh what an idiot! Thanks LeeS yep I'm sure that's it will check it in the morning.
i wish I could spell ;)
 
Which works in my mod for my buildings but not for the rest, should I be using Update or replace or something?
Do you have the Ui updated so when you look at a building in the production queue or civilopedia, it will show the resource costs automatically? (Like how for a unit, it might say "requires 1 oil to build, consumes 1 oil per turn" or whatever)
I have a similar mod that adds resource costs to buildings, but the UI has been giving me trouble. Just curious if you've already tackled the issue.
 
Sostratus, yes it does show resources needed, well on the civilopedia it shows one of the resources when there should be two but it adds it up e.g. Should be say 10 lumber and 30 stone it shows 40 stone? but on production queue it shows both as they should be and is true I do need 10 lumber and 30 stone to build.

Does yours do that?

As far as my units go they seem to be showing resources needed and maintenance ok.
 
Last edited:
Does yours do that?
It's possible the lumber mod is doing it.
I just see something like this:
Spoiler Steelworks uses 2 iron via Building_ResourceCosts :

upload_2019-11-10_0-43-2.png

upload_2019-11-10_0-43-53.png



Whereas a unit will show:
Spoiler A knight :

upload_2019-11-10_0-45-32.png


And when you hover over stuff in game, etc, it will be similar. A unit shows its resource use but buildings do not. If you haven't changed the UI at all to handle it then I assume the lumber mod is doing it, since (especially if he's added resources like stone and lumber) that would be very important for players to see!
 
Oh no mine does show more than than on the buildings and yes I expect it comes from one of the resources mods i downloaded, when I get to my computer i will post which ones I use maybe that will give you clues.
give me a couple of hours.
 
Ok.
AOK_LUMBER by Anders
Strategic Industry - Gathering Storm by Uncivilizedguy
Resourceful 2 (Gathering Storm compatible) by Amatheria and P0kiehl
Truly Abundant Resources by P0kiehl

Hopefully one of those hold the key :)
Let me know if you figure it out.
 
Back
Top Bottom