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

[MODCOMP] New Profession: Inventor w/ TechTree

Discussion in 'Civ4Col - Mods and Files' started by Kailric, Mar 23, 2010.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Show me your code for your new trait you added to the Civ4TraitInfos.
     
  2. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Of course !

    Code:
    
    	      <TraitInfo>
                            <Type>TRAIT_FISHING</Type>
    			<Description>TXT_KEY_TRAIT_FISHING</Description>
    			<ShortDescription>TXT_KEY_TRAIT_FISHING</ShortDescription>
    			<iLevelExperienceModifier>0</iLevelExperienceModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iNativeAngerModifier>0</iNativeAngerModifier>
    			<iLearnTimeModifier>0</iLearnTimeModifier>
    			<iNativeCombatModifier>0</iNativeCombatModifier>
    			<iMissionaryModifier>0</iMissionaryModifier>
    			<iRebelCombatModifier>0</iRebelCombatModifier>
    			<iTaxRateThresholdModifier>0</iTaxRateThresholdModifier>
    			<iMercantileFactor>0</iMercantileFactor>
    			<iTreasureModifier>0</iTreasureModifier>
    			<iChiefGoldModifier>0</iChiefGoldModifier>
    			<iNativeAttitudeChange>0</iNativeAttitudeChange>
    			<iCityDefense>0</iCityDefense>
    			<iLandPriceDiscount>0</iLandPriceDiscount>
    			<iRecruitPriceDiscount>0</iRecruitPriceDiscount>
    			<iEuropeTravelTimeModifier>0</iEuropeTravelTimeModifier>
    			<iImmigrationThresholdModifier>0</iImmigrationThresholdModifier>
    			<CityExtraYields/>
    			<ExtraYieldThresholds/>
    			<ProfessionEquipmentModifiers/>
    			<FreePromotions/>
    			<FreePromotionUnitCombats/>
    			<YieldModifiers/>
    			<TaxYieldModifiers/>
    			<BuildingYieldChanges>
    				<BuildingYieldChange>
    					<BuildingClassType>BUILDINGCLASS_DOCK</BuildingClassType>
    					<BuildingYields>
    						<YieldChange>
    							<YieldType>YIELD_FOOD</YieldType>
    							<iYieldChange>1</iYieldChange>
    						</YieldChange>
    					</BuildingYields>
    				</BuildingYieldChange>
    				<BuildingYieldChange>
    					<BuildingClassType>BUILDINGCLASS_DRYDOCK</BuildingClassType>
    					<BuildingYields>
    						<YieldChange>
    							<YieldType>YIELD_FOOD</YieldType>
    							<iYieldChange>1</iYieldChange>
    						</YieldChange>
    					</BuildingYields>
    				</BuildingYieldChange>
    				<BuildingYieldChange>
    					<BuildingClassType>BUILDINGCLASS_SHIPYARD</BuildingClassType>
    					<BuildingYields>
    						<YieldChange>
    							<YieldType>YIELD_FOOD</YieldType>
    							<iYieldChange>1</iYieldChange>
    						</YieldChange>
    					</BuildingYields>
    				</BuildingYieldChange>
    			</BuildingYieldChanges>
    			<UnitMoveChanges/>
    			<ProfessionMoveChanges/>
    			<BuildingProductionModifiers/>
    			<BuildingRequiredYieldModifiers/>
    			<UnitStrengthModifiers/>
    			<FreeBuildingClasses/>
    			<GoodyFactors/>
    		</TraitInfo>
     
  3. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Well I just added this trait to the Mod and it loaded just fine. Are you working with the "Core" mod? I added a tech that allows a trait to the core mod and that worked as well. Have you tried adding an existing trait like TRAIT_JOHN_HAVARD. Are you sure you are editing the correct XML files and not ones in another folder. Also, I heared that you need to make sure that the XML isn't being cached as it may not load your changes. This option is in the CivilizationIV.ini file I believe.
     
  4. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Well TRAIT_JOHN_HAVARD works properly...

    But when I copy TRAIT_JOHN_HAVARD and rename it TRAIT_FISHING it doesn't work!

    I must have an old version of the Core Mod ( May 2010) ... I'll download the last version
     
  5. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    I was indeed playing with the wrong version....

    I had no techs, in version 1.0 ! Sorry about that. I'll try with the newest version (it's 1.1d, isn't it? )
     
  6. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    The versions are...

    Inventor Mod 1.1c which has a patch 1.1d.

    Then the Core Mod 1.0 which has no techs and is only for modders so they can add their own techs. It has no patches.
     
  7. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Well, I'm working with the Core 1.0... I wanted indeed to add my own techs.

    I've tried again, and I haven't found any tech that allows a trait. I've searched <AllowsTrait> with Notepad++ and there are no results.

    Am I missing something?
    But, strangely TRAIT_JOHN_HAVARD does work...

    Maybe I can send you my mod, if you want to check (or rather if you have time to check)...
     
  8. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    All I can think of is that its not loading your changes. Have you tried other tech attributes like "Allows Unit"? If you can't figure it out then yeah, send me your mod.
     
  9. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Well yes! Many tech attributes word properly. "Allow unit", "Allow profession" and "Allow promotion" work perfectly... Many other attributes work quite well (iGoldBonus; iFreeTechs, iCheaperPopulationGrowth etc...)

    However some don't exactly do what they are supposed to do. "Allow bonus", "iCenterPlotFoodBonus" (and maybe "YieldModifiers" but I think that I shouldn't be trying it with YIELD_FOOD...In that case it is my fault) don't give me any error code. The game texts appear as normal. But I don't get the food bonus, neither concerning the center plot nor the food bonus.

    And last but not least, I get an error when I try "AllowTrait"...

    Here are the files of the Mod http://www.megaupload.com/?d=KXMD2Y4R

    This one actually works (that is, I can launch the mod but I don't get the food bonuses)... But when I try to allow a trait it doesn't launch the mod (I have attached a CIV4CivicInfos.xml which was supposed to work).

    Thank you for taking some time for me ! It's very kind of you.
     

    Attached Files:

  10. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Things get even stranger. I'm trying to add Portugal to the modcomp. I've already tried before. Usually it's quite simple to add a new civ (I mean if you already have the graphical files !).

    But here everything works perfectly until I add a new trait for Portugal leaders...

    The problem definitively comes from the TraitInfos file...
     
  11. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I'll check this out as soon as I can. It maybe this weekend before I can though.
     
  12. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Well I noticed one thing right off, you have some of the xml lines out of place in your Civ4CivicInfos.xml

    Code:
     </RequiredYields>
    <AllowsYields/>
    <iCostToResearch>30</iCostToResearch>
      <AllowsBuildingTypes/>
    should be

    Code:
     </RequiredYields>
     <iCostToResearch>30</iCostToResearch>
          <AllowsYields/>
       <AllowsBuildingTypes/>
     
  13. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    I see. Thank you.

    I'll change those lines...
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    The best thing to do is to download a xml editor. Mircosofts Visual Studio 2008 is what I use and it helps you find errors such as this. There may have been more errors but I noticed these ones right away.
     
  15. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Thank you... You're quite helpful. But there are a few things I do not understand...

    First of all, the <iCostToResearch> is missing in the biginning of the CivicOption.xml file. So I simply didn't know where to put it.
    Spoiler :
    <CivicInfo>
    <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType>
    <Type>NATIVE_TECH</Type>
    <Description>TXT_KEY_TECHNO_NATIVE</Description>
    <Civilopedia>TXT_KEY_NEED_DESCRIPTION</Civilopedia>
    <Strategy>TXT_KEY_NEED_DESCRIPTION</Strategy>
    <Button>Art/Buttons/Tech_Categorys/NativeCat.dds</Button>
    <iAIWeight>0</iAIWeight>
    <iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    <iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    <iFreeExperience>0</iFreeExperience>
    <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
    <iImprovementUpgradeRateModifier>0</iImprovementUpgradeRateModifier>
    <iMilitaryProductionModifier>0</iMilitaryProductionModifier>
    <iExpInBorderModifier>0</iExpInBorderModifier>
    <iNativeAttitudeChange>0</iNativeAttitudeChange>
    <iNativeCombatModifier>0</iNativeCombatModifier>
    <iFatherPointModifier>0</iFatherPointModifier>
    <bDominateNativeBorders>0</bDominateNativeBorders>
    <bRevolutionEuropeTrade>0</bRevolutionEuropeTrade>
    <YieldModifiers/>
    <CapitalYieldModifiers/>
    <Hurrys/>
    <SpecialBuildingNotRequireds/>
    <ImprovementYieldChanges/>
    <FreeUnitClasses/>
    <!--Prevents the Free Units from being automaticly added as population-->
    <bFreeUnitsAreNonePopulation>0</bFreeUnitsAreNonePopulation>
    <!--Prevents units from being created in all the cities-->
    <bFreeUnitsNotAllCities>0</bFreeUnitsNotAllCities>
    <ProfessionCombatChanges/>
    <ImmigrationConversion>NONE</ImmigrationConversion>
    <!--A Category must be listed here for the Tech to be used in game-->
    <InventionCategory/>
    <!--X and Y location of the tech on the tech grid-->
    <iX_Location>0</iX_Location>
    <iY_Location>0</iY_Location>
    <!--These 3 are the pre required techs. On the tech tree grid if all three are used RequiredInvention will be set as "Also Requires"-->
    <!--and arrows will point at RequiredInvention2 and RequiredInventionOr. If RequiredInvention2 is not used arrows will point at RequiredInvention and RequiredInventionOr.-->
    <!--If the Or tech is not used then RequiredInvention2 wil be set as the "Also Requires" if it is used.-->
    <RequiredInvention/>
    <RequiredInvention2/>
    <RequiredInventionOr/>
    <!--This unit must be assisting on the project in the City-->
    <RequiredUnitType/>
    <!--These are the required Yields that get consumed. If no Yield is used here do not put YIELD_IDEAS, leave as <RequiredYields/>-->
    <RequiredYields/>
    <!--Allows the Production of this Yield. If a yield is listed here it will not be able to be harvested, bought, or sold. Nor will buildings associated with this yield be usable-->
    <AllowsYields/>
    <!--The next four are self explained. Put 1 to allow or -1 to disallow-->
    <AllowsBuildingTypes/>
    <AllowsUnitClasses/>
    <AllowsPromotions/>
    <AllowsProfessions/>
    <!--Place a Trait here to have it Processed along with this Tech. See CIV4TraitInfos for examples-->
    <AllowsTrait/>
    <!--This is "Improvements". Place Improvements here to allow or disallow-->
    <AllowsBuildTypes/>
    <!--Checks the below terrains for the Improvements above. Not fully tested yet-->
    <AllowsBuildTypesTerrain/>
    <!--These next two are used to convert units after this tech is research-->
    <ConvertsUnitsFrom/>
    <ConvertsUnitsTo/>
    <!--This will be the new Default population unit for when a City does its Growth or you clear specialty and such-->
    <NewDefaultUnitClass/>
    <!--If this tech is researched the DisallowsTech will be none researchable-->
    <DisallowsTech/>
    <!--Modifies the cost to move along routes. Example: put 1 to increase movement along roads by 1-->
    <RouteMovementMod/>
    <!--This tech will allow you to have a Constitution before you start your revolution-->
    <bStartConstitution>0</bStartConstitution>
    <!--Allows map trading-->
    <bAllowsMapTrade>0</bAllowsMapTrade>
    <!--Arrows will not point to this Tech, currently not used in the code-->
    <bNoArrowinTechScreen>0</bNoArrowinTechScreen>
    <!--This tech will be none tradeable-->
    <bisNoneTradeable>0</bisNoneTradeable>
    <!--Increases heal rate in enemy territory by this amount-->
    <iIncreasedEnemyHealRate>0</iIncreasedEnemyHealRate>
    <!--The number of free Immigrants when this tech is researched-->
    <iFreeHurriedImmigrants>0</iFreeHurriedImmigrants>
    <!--Decreases the standard 200 threshold for food to do population growth-->
    <iCheaperPopulationGrowth>0</iCheaperPopulationGrowth>
    <!--Increases the Center plot food bonus-->
    <iCenterPlotFoodBonus>0</iCenterPlotFoodBonus>
    <!--Changes the rate you gain Prolific inventor experience-->
    <iProlificInventorRateChange>0</iProlificInventorRateChange>
    <!--First to discover earns this gold-->
    <iGoldBonusForFirstToResearch>0</iGoldBonusForFirstToResearch>
    <!--Gold bonus for discovering, don't need to be first-->
    <iGoldBonus>0</iGoldBonus>
    <!--The number of Free techs. If you have a free tech the next project you have selected to research on your next turn will be auto completed-->
    <iFreeTechs>0</iFreeTechs>
    <!--This modifies the percent that the king charges you to transport Treasure units-->
    <iKingTreasureTransportMod>0</iKingTreasureTransportMod>
    <!--If a Yield is listed here it will be used to determine Industrial Victory. The code is only set up to use one Yield atm.-->
    <IndustrializationVictory/>
    </CivicInfo>


    I understand that xml schema validation would be useful. But where do I get a CivicOptionSchema.xml file ?

    Actually, I don't understand how you found the error. Moreover, I don't understand why the game launched itself without any error message.

    Finally I've changed those lines, but I don't see any difference.
     
  16. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Are you still here?

    You were right since the beginning: the game didn't load my new traits! I am quite a fool... My "trait problem" is entirely my fault.:cry: I simply put the TraitInfos.xml file in the wrong folder (GameInfo instead of Civilizations).

    However, the other errors are real... Strangely, I've found some similar errors in the game itself (I mean in "vanilla" Civ IV Colonization). <CityExtraYields> (in TraitInfos.xml) will never work, whatever yield I tried. The game texts are OK though. Is this error related to the <iCenterPlotFoodBonus> in the CIV4CivicInfos.xml ? I do not know...

    If so, it would be quite encouraging! One could correct both errors in the same time...
     
  17. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Yeah, still around. Haven't had time to get on here though. Glad you figured out the problem. I am not sure about the "CityExtraYields", hopefully before long I will have some time to post an update and I'll look into these things.
     
  18. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
  19. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Hi Kailric,

    Are you going to check your Inventor modcomp in the next few days/weeks/months?
    Could you please check these features?

    1) Missing light bulb icon in many screens?
    2) Incorrect images in Civilopedia screen (profession screen)
    3) Incorrect numbers in Invention screen ("current research": "1 turn left"... Actually it's "2 turns left ")
    4) Sometimes AI will accept research pact, but nothing happens.
    5) <iCenterPlotFoodBonus> tag doesn't work properly
    6) Neither does the "reveal bonus" tag...

    Thank you !
     
  20. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Ok, Robert, the next two weeks will tell me more about how much time I'll have. I am moving three states over tomorrow and will just have to go from there. Thanks for the bug reports. I really am looking forward to revisiting these mods again so stay tuned :)
     

Share This Page