lachumproyale
Chieftain
- Joined
- Apr 22, 2020
- Messages
- 35
I'm trying to do something like mentioned below for power plants, and I'm running into a few issues.
1) First and foremost is I have absolutely no clue where to put the <Building_ResourceCosts> row. It doesn't go in the schema sql but it's also nto working when I create a separate Building_ResourceCosts.xml either. Where should I be putting this?
2) I'm not sure how the power plants are labeled? I see most of the major buildings but I'm not seeing coal, oil, nuclear plants in he same obvious way I'm seeing other things
For reference I've barely done any of this on my own so far, the only thing I've done successfully is to alter a resource's carbon output, add/remove strategic resource requirements for units, and some basic global tweaks. Basically all I'm trying to do is re-balance some of the climate change stuff so that like, a battleship is burning like a fraction of what a power plant in a city is burning. (I tried just doing a decimal value for the units' resource requirements, but that didn't fly)
also if someone's come up with a fix for the issue mentioned at the bottom and anyone knows where that is I'd love to see that as well
1) First and foremost is I have absolutely no clue where to put the <Building_ResourceCosts> row. It doesn't go in the schema sql but it's also nto working when I create a separate Building_ResourceCosts.xml either. Where should I be putting this?
2) I'm not sure how the power plants are labeled? I see most of the major buildings but I'm not seeing coal, oil, nuclear plants in he same obvious way I'm seeing other things
For reference I've barely done any of this on my own so far, the only thing I've done successfully is to alter a resource's carbon output, add/remove strategic resource requirements for units, and some basic global tweaks. Basically all I'm trying to do is re-balance some of the climate change stuff so that like, a battleship is burning like a fraction of what a power plant in a city is burning. (I tried just doing a decimal value for the units' resource requirements, but that didn't fly)
also if someone's come up with a fix for the issue mentioned at the bottom and anyone knows where that is I'd love to see that as well
This might be getting outside my current understanding but I have been playing around with the (seemingly unused) table Building_ResourceCosts from GS.
Here's the table from the expansion 2 schema for reference (thanks for pointing this out @LeeS !!) :
Spoiler :
CREATE TABLE "Building_ResourceCosts" (
"BuildingType" TEXT NOT NULL,
"ResourceType" TEXT NOT NULL,
"StartProductionCost" INTEGER NOT NULL,
"PerTurnMaintenanceCost" INTEGER NOT NULL,
PRIMARY KEY(BuildingType, ResourceType),
FOREIGN KEY (BuildingType) REFERENCES Buildings(BuildingType) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (ResourceType) REFERENCES Resources(ResourceType) ON DELETE CASCADE ON UPDATE CASCADE);
Supposing I wanted a factory to cost iron, or something, I might try to add a new row like this:
Spoiler :
<Building_ResourceCosts>
<Row>
<BuildingType>BUILDING_FACTORY</BuildingType>
<ResourceType>RESOURCE_IRON</ResourceType>
<StartProductionCost>1</StartProductionCost>
<PerTurnMaintenanceCost>1</PerTurnMaintenanceCost>
</Row>
</Building_ResourceCosts>
I have found that this does seem to actually function in the game (yay!); you need the required amount of resource to begin construction, it is properly deducted; the maintenance is also properly deducted. However, it does not show up anywhere as being used; in the strategic resource bar, it correctly decrements your resource income (albeit doesn't display that any is being consumed even though it is,) and you'll get the warning if your try to make the building without the resource:
View attachment 538050
However, on the unit card, it doesn't show that "requires" line about needing resources like units do. Example from a knight:
Spoiler :
Is "hooking up" this table so it displays similar to how units work in the purview of the .dll and not something I can change? Or does this fall into UI territory? If it's inaccessible I'm happy to just throw the cost in the description and let it be.