1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Help please - i broke my own mod and i can't figure it out

Discussion in 'Civ5 - Creation & Customization' started by mattpilot, Dec 31, 2011.

  1. mattpilot

    mattpilot Warlord

    Joined:
    Jan 29, 2004
    Messages:
    184
    I've been playing with my simple mod and it worked quite well, until i added a few changes about promotions.

    Here's the complete mod xml:

    Spoiler :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
    	<Defines>
    		<Update>
    			<Set Value="15"/>
    			<Where Name="MAX_HIT_POINTS"/>
    		</Update>
    		<Update>
    			<Set Value="50"/>
    			<Where Name="MAX_CITY_HIT_POINTS"/>
    		</Update>
    		<Update>
    			<Set Value="2"/>
    			<Where Name="CITY_HIT_POINTS_HEALED_PER_TURN"/>
    		</Update>
    		<Update>
    			<Where Name="UNIT_MAINTENANCE_GAME_MULTIPLIER" />
    			<Set Value="5" />
    		</Update>
    		<Update>
    			<Where Name="UNIT_MAINTENANCE_GAME_EXPONENT_DIVISOR" />
    			<Set Value="10" />
    		</Update>
    		<Update>
    			<Where Name="RIVER_ATTACK_MODIFIER" />
    			<Set Value="-70" />
    		</Update>
    	</Defines>
    	<Units>
    		<Update>
    			<Where Class="UNITCLASS_MECH"/>
    			<Set Combat="100"/>
    		</Update>
    	</Units>
    	<Unit_ResourceQuantityRequirements>
    		<Row>
    			<UnitType>UNIT_MECHANIZED_INFANTRY</UnitType>
    			<ResourceType>RESOURCE_IRON</ResourceType>
    		</Row>
    	</Unit_ResourceQuantityRequirements>
    
    	<UnitPromotions>
    		<Update>
    			<Set TechPrereq="TECH_FUTURE_TECH" />
    			<Where PromotionType="PROMOTION_INSTA_HEAL"/>
    		</Update>
    
    		<Update>
    			<Set OpenAttack="5" />
    			<Set OpenDefense="5" />
    			<Where Type="PROMOTION_SHOCK_1" />
    		</Update>
    		<Update>
    			<Set OpenAttack="10" />
    			<Set OpenDefense="10" />
    			<Where Type="PROMOTION_SHOCK_2" />
    		</Update>
    		<Update>
    			<Set OpenAttack="10" />
    			<Set OpenDefense="10" />
    			<Where Type="PROMOTION_SHOCK_3" />
    		</Update>
    		<Update>
    			<Set RoughAttack="5" />
    			<Set RoughDefense="5" />
    			<Where Type="PROMOTION_DRILL_1" />
    		</Update>
    		<Update>
    			<Set RoughAttack="10" />
    			<Set RoughDefense="10" />
    			<Where Type="PROMOTION_DRILL_2" />
    		</Update>
    		<Update>
    			<Set RoughAttack="10" />
    			<Set RoughDefense="10" />
    			<Where Type="PROMOTION_DRILL_3" />
    		</Update>
    	</UnitPromotions>
    
    
    </GameData>



    Been working with kael's mod guide, and as far as i can tell, it all seems fine. I alos hav ethe "onupdate -load file" thing set so its not that. But when i start a new game with this mod, none of the changes have any effect. Before i added the part about promotions, the changes worked fine.

    ANy ideas?
     
  2. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    What do the log files say? If you make an XML error, the logfiles WILL say exactly what you did wrong, as long as you remember to turn on logging in your config.ini.
     
  3. mattpilot

    mattpilot Warlord

    Joined:
    Jan 29, 2004
    Messages:
    184
    hmm... what log file am i supposed to look at? The logs folder has quite a few logs but i can't make any sense of it... nothing that jumps out and says 'hey, u screwed up'.


    I did some manual debugging, slowly removing stuff until it worked.

    This portion works fine:

    Spoiler :
    Code:
    <GameData>
    	<Defines>
    		<Update>
    			<Set Value="15"/>
    			<Where Name="MAX_HIT_POINTS"/>
    		</Update>
    		<Update>
    			<Set Value="50"/>
    			<Where Name="MAX_CITY_HIT_POINTS"/>
    		</Update>
    		<Update>
    			<Set Value="2"/>
    			<Where Name="CITY_HIT_POINTS_HEALED_PER_TURN"/>
    		</Update>
    		<Update>
    			<Where Name="UNIT_MAINTENANCE_GAME_MULTIPLIER" />
    			<Set Value="5" />
    		</Update>
    		<Update>
    			<Where Name="UNIT_MAINTENANCE_GAME_EXPONENT_DIVISOR" />
    			<Set Value="10" />
    		</Update>
    		<Update>
    			<Where Name="RIVER_ATTACK_MODIFIER" />
    			<Set Value="-70" />
    		</Update>
    		<Update>
    			<Where Name="AMPHIB_ATTACK_MODIFIER" />
    			<Set Value="-70" />
    		</Update>
    	</Defines>
    	<Units>
    		<Update>
    			<Where Class="UNITCLASS_MECH"/>
    			<Set Combat="100"/>
    		</Update>
    	</Units>
    	<Unit_ResourceQuantityRequirements>
    		<Row>
    			<UnitType>UNIT_MECHANIZED_INFANTRY</UnitType>
    			<ResourceType>RESOURCE_IRON</ResourceType>
    		</Row>
    	</Unit_ResourceQuantityRequirements>
    	<UnitPromotions_UnitCombats>
    		<Delete PromotionType="PROMOTION_INSTA_HEAL"/>
    	</UnitPromotions_UnitCombats>





    As soon as i add this, however, NOTHING works anymore :/

    Spoiler :
    Code:
    	<UnitPromotions>
    		- <Update>
    			<Where Type="PROMOTION_SHOCK_1" />
    			<Set OpenAttack="5" />
    			<Set OpenDefense="5" />
    		</Update>
    		- <Update>
    			<Where Type="PROMOTION_SHOCK_2" />
    			<Set OpenAttack="10" />
    			<Set OpenDefense="10" />
    		</Update>
    		- <Update>
    			<Where Type="PROMOTION_SHOCK_3" />
    			<Set OpenAttack="10" />
    			<Set OpenDefense="10" />
    		</Update>
    		- <Update>
    			<Where Type="PROMOTION_DRILL_1" />
    			<Set RoughAttack="5" />
    			<Set RoughDefense="5" />
    		</Update>
    		- <Update>
    			<Where Type="PROMOTION_DRILL_2" />
    			<Set RoughAttack="10" />
    			<Set RoughDefense="10" />
    		</Update>
    		- <Update>
    			<Where Type="PROMOTION_DRILL_3" />
    			<Set RoughAttack="10" />
    			<Set RoughDefense="10" />
    		</Update>
    		</UnitPromotions>
    	</GameData>




    Surely the code looks fine?? What could possible be wrong with it :/
     
  4. Putmalk

    Putmalk Deity

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    Try merging those set tags.

    Instead of:

    Code:
    <Set RoughAttack="10"/>
    <Set RoughDefense="10"/>
    
    Try

    Code:
    <Set>
     <RoughAttack>10</RoughAttack>
     <RoughDefense>10</RoughDefense>
    </Set>
    
     
  5. mattpilot

    mattpilot Warlord

    Joined:
    Jan 29, 2004
    Messages:
    184
    Thanks Putmalk!

    That seemed to do the trick and all runs smooth now. Didn't know those were supposed to be like that :goodjob:
     
  6. Putmalk

    Putmalk Deity

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    You're welcome, glad it's working now. :)
     
  7. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    You can also do it as
    Code:
    <Set RoughAttack="10" RoughDefense="10"/>
    
    if you want.

    Database.log and xml.log. You also generally want to pay attention to Lua.log, at least if you don't also use FireTuner.

    If you don't have logging turned on, do that first. Go into your user directory (in Win7, it's My Documents/My Games/Sid Meier's Civilization V/) and open the config.ini file. Towards the bottom will be a "LoggingEnabled = 0" line; change it to a 1. There are a dozen or so other logging flags, change whatever else you want to a 1. I'd suggest turning FireTuner on as well; at the top of that config file is a line "EnableTuner"; change that to a 1 as well.
     

Share This Page