Industrial Zone Factory & Power Plant Improvement

Sirkuce

Chieftain
Joined
Dec 30, 2016
Messages
3
Dear all,

I am now reeding through your forum quite a long time and I am also very happy with all the information what I have found here. Thx a lot.
But now I have a very special questions which I didn't find an answer so far. I hope you can help me.

Because of the new patch I decided to do a small mod to improve the industrial zones again.

My plan:

Factory:
additional to the existing bonus
+1 production for mine
(within the plot of the city)
+1 production for quarry
(within the plot of the city)

Power plant
+ 5% production
+1 production for lumber mill
(within the plot of the city)

For the factory it works quite well and also for the +5% production for the power plant. I modified the code for Ruhr_Valley and adapted for the new buildings but I now have problems with the lumber mill bonus.

I did the same as for mine and quarry but it doesn't work:

code here:

Code:
<?xml version="1.0" encoding="utf-8"?>

<GameInfo>
        
    <Modifiers>
        
        <Row>
            <ModifierId>POWERPLANT_ADDPRODUCTIONYIELD</ModifierId>
            <ModifierType>MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_MODIFIER</ModifierType>
        </Row>
        <Row>
            <ModifierId>FACTORY_MINE_PRODUCTION</ModifierId>
            <ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
            <SubjectRequirementSetId>CITY_HAS_FACTORY_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>FACTORY_MINE_PRODUCTION_MODIFIER</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_MINE_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>FACTORY_QUARRY_PRODUCTION</ModifierId>
            <ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
            <SubjectRequirementSetId>CITY_HAS_FACTORY_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>FACTORY_QUARRY_PRODUCTION_MODIFIER</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_QUARRY_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        
        <!--Row>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION</ModifierId>
            <ModifierType>MODIFIER_ALL_CITIES_ATTACH_MODIFIER</ModifierType>
            <SubjectRequirementSetId>CITY_HAS_POWER_PLANT_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION_MODIFIER</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_LUMBER_MILL_REQUIREMENTS</SubjectRequirementSetId>
        </Row-->
        
        
    </Modifiers>
    <ModifierArguments>
        
        <Row>
            <ModifierId>POWERPLANT_ADDPRODUCTIONYIELD</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>POWERPLANT_ADDPRODUCTIONYIELD</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>   
            
        <Row>
            <ModifierId>FACTORY_QUARRY_PRODUCTION</ModifierId>
            <Name>ModifierId</Name>
            <Value>FACTORY_QUARRY_PRODUCTION_MODIFIER</Value>
        </Row>
        <Row>
            <ModifierId>FACTORY_QUARRY_PRODUCTION_MODIFIER</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>FACTORY_QUARRY_PRODUCTION_MODIFIER</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>FACTORY_MINE_PRODUCTION</ModifierId>
            <Name>ModifierId</Name>
            <Value>FACTORY_MINE_PRODUCTION_MODIFIER</Value>
        </Row>
        <Row>
            <ModifierId>FACTORY_MINE_PRODUCTION_MODIFIER</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>FACTORY_MINE_PRODUCTION_MODIFIER</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>   
        <!--Row>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION</ModifierId>
            <Name>ModifierId</Name>
            <Value>POWER_PLANT_LUMBER_MILL_PRODUCTION_MODIFIER</Value>
        </Row>
        <Row>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION_MODIFIER</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION_MODIFIER</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row-->   
        
        
    </ModifierArguments>
    
    <BuildingModifiers>
        
        
        <Row>
            <BuildingType>BUILDING_POWER_PLANT</BuildingType>
            <ModifierId>POWERPLANT_ADDPRODUCTIONYIELD</ModifierId>
        </Row>
        <Row>
            <BuildingType>BUILDING_FACTORY</BuildingType>
            <ModifierId>FACTORY_QUARRY_PRODUCTION</ModifierId>
        </Row>
        <Row>
            <BuildingType>BUILDING_FACTORY</BuildingType>
            <ModifierId>FACTORY_MINE_PRODUCTION</ModifierId>
        </Row>
        <!--Row>
            <BuildingType>BUILDING_POWER_PLANT</BuildingType>
            <ModifierId>POWER_PLANT_LUMBER_MILL_PRODUCTION</ModifierId>
        </Row-->
    
    </BuildingModifiers>
    
    <Requirements>
        
        
        <Row>
            <RequirementId>REQUIRES_CITY_HAS_FACTORY</RequirementId>
            <RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_CITY_HAS_POWER_PLANT</RequirementId>
            <RequirementType>REQUIREMENT_CITY_HAS_BUILDING</RequirementType>
        </Row>   
        
        
    </Requirements>
        
    
    
    
    <RequirementArguments>
        
        <Row>
            <RequirementId>REQUIRES_CITY_HAS_FACTORY</RequirementId>
            <Name>BuildingType</Name>
            <Value>BUILDING_FACTORY</Value>
        </Row>
        <Row>
            <RequirementId>REQUIRES_CITY_HAS_POWER_PLANT</RequirementId>
            <Name>BuildingType</Name>
            <Value>BUILDING_POWER_PLANT</Value>
        </Row>
        
    </RequirementArguments>
    <RequirementSets>
        
        
        <Row>
            <RequirementSetId>CITY_HAS_FACTORY_REQUIREMENTS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
        <Row>
            <RequirementSetId>CITY_HAS_POWER_PLANT_REQUIREMENTS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
        
    </RequirementSets>
    <RequirementSetRequirements>
        
        
        <Row>
            <RequirementSetId>CITY_HAS_FACTORY_REQUIREMENTS</RequirementSetId>
            <RequirementId>REQUIRES_CITY_HAS_FACTORY</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>CITY_HAS_POWER_PLANT_REQUIREMENTS</RequirementSetId>
            <RequirementId>REQUIRES_CITY_HAS_POWER_PLANT</RequirementId>
        </Row>
        
    </RequirementSetRequirements>
</GameInfo>


Now my questions:

Why is the code for lumber mills not the same as for mine and quarry?
Because my mode is based on Ruhr Valley is it possible that there is something "hard coded" behind XML modifiable code?
Because I am a complete noob in programming maybe someone can explain how the definition works

e.g.

<ModifierId>FACTORY_MINE_PRODUCTION</ModifierId>
<Name>ModifierId</Name>
<Value>FACTORY_MINE_PRODUCTION_MODIFIER</Value>

Which part of the code is free to define ... as I guess ModifierId can be defined as a ID or variable as a like but at value the code must follow certain rules. Could someone tell me which rules I have to follow and which arguments need to be defined under certain rules?
Mayb some small link or explanation how the definition is working?

I hope it isn't to stupid and complex to answer what I am asking for.

Thx for helping me out and your support!

Cheers
Martin
 
The value in the example above is another modifierId, it is basically applying that as well with a different requirementset.

Ultimately, requirement types, modifier types, and collections are defined. You can find those in the GameEffects.xml. From that you can make your own modifiers and requirementsets. Which is basically what you did. Note though some things do not work, either at all or as expected.
 
Hi Elucidus,

Thx for your imput, that is basically what I did. I did the same as with mine and quarry but with lumber mill it doesn't work. Could maybe someone look through the code and check if I did something wrong because I have no glue.

Thx for help
 
Everything looks good. I loaded it into Notepad++ everything looks alright. If it was in SQL I would have done a few tests.

I can tell you though that there are several things that you can put in the database, but do not work, I have been building a list, myself.

A fine example, you cannot add a prereqTech for an improvement, only a civic, even though there is a column in the database. Or how you cannot build an improvement on a mountain, even though you can generate resources, assign yields, and even build cities on them. Hopefully someone with a better eye than I have figures out what is wrong for you, I would rather that, than it just be broken.

good luck.
 
It looks like the problem is you haven't defined PLOT_HAS_LUMBER_MILL_REQUIREMENTS.

The game assets define PLOT_HAS_QUARRY_REQUIREMENTS in Beliefs.xml and PLOT_HAS_MINE_REQUIREMENTS in Buildings.xml. You should be able to use those as the basis for your own requirement set.
 
It looks like the problem is you haven't defined PLOT_HAS_LUMBER_MILL_REQUIREMENTS.

The game assets define PLOT_HAS_QUARRY_REQUIREMENTS in Beliefs.xml and PLOT_HAS_MINE_REQUIREMENTS in Buildings.xml. You should be able to use those as the basis for your own requirement set.

Exactly what this person said. Mine and Quarry both use requirement sets that come with the base game's code. Lumber Mill does not, but you can easily make it!
 
Back
Top Bottom