Modder's Guide to A New Dawn

Discussion in 'Rise of Mankind: A New Dawn' started by Afforess, Dec 2, 2009.

  1. The_People

    The_People Of The People

    Joined:
    Apr 23, 2007
    Messages:
    59
    Location:
    Planet Earth
    Ok, so im starting to modify unit graphics, and i need some help regarding wheather or not i need to create new unit type in order to have civilization specific graphics for a unit (ex. Russian Archers).

    And i also want to know why when u play multiplayer with friends, the game is out of sync.

    Thanks for the reply.
     
  2. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,419
    Gender:
    Male
    Location:
    Western IL. cornfields
    All computers on Multiplayer must have the Exact same copy of the mod. Any thing changed will cause an OOS. So if anyone has went into the mod and tweaked something in it that the others have not, it will throw off the sync.

    JosEPh
     
  3. The_People

    The_People Of The People

    Joined:
    Apr 23, 2007
    Messages:
    59
    Location:
    Planet Earth
    o ok, would you guys like me to submit my work, so u can add it to the OOS?
    I just wanted every Civ to have unique looking units from the ancient to industrial period.
     
  4. ronjon

    ronjon Warlord

    Joined:
    Jan 5, 2007
    Messages:
    143
    "never tried to mod before, and I just want to adjust the tech diffusion upward. Any tips on how to do that."

    gonna try again
     
  5. flitz

    flitz Warlord

    Joined:
    Sep 16, 2009
    Messages:
    245
  6. Urza1234

    Urza1234 Chieftain

    Joined:
    Jul 17, 2012
    Messages:
    53
    I've been trying to incorporate the ability to build a hill into this mod by using your FeatureChange field in the Civ4BuildInfo.xml and generally copying the syntax I see being used.

    Edit: My attempts at modding are now concealed by a spoiler to prevent an overly obtrusive post.

    Spoiler :

    My Addition to the Civ4BuildInfo.xml:
    Code:
    		<BuildInfo>
    			<Type>BUILD_Hill</Type>
    			<Description>TXT_KEY_BUILD_HILL</Description>
    			<Help/>
    			<PrereqTech>TECH_PLASTICS</PrereqTech>
    			<iTime>2000</iTime>
    			<iCost>100</iCost>
    			<bKill>0</bKill>
    			<ImprovementType>IMPROVEMENT_HILL</ImprovementType>
    			<RouteType>NONE</RouteType>
    			<TerrainChange>TERRAIN_HILL</TerrainChange>
    			<EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>
    			<FeatureStructs>
    				<FeatureStruct>
    					<FeatureType>FEATURE_FOREST</FeatureType>
    					<PrereqTech/>
    					<iTime>250</iTime>
    					<iProduction>30</iProduction>
    					<bRemove>1</bRemove>
    				</FeatureStruct>
    				<FeatureStruct>
    					<FeatureType>FEATURE_JUNGLE</FeatureType>
    					<PrereqTech/>
    					<iTime>400</iTime>
    					<iProduction>0</iProduction>
    					<bRemove>1</bRemove>
    				</FeatureStruct>
    			</FeatureStructs>
    			<HotKey>KB_T</HotKey>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>1</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    			<Button>Art/Interface/Buttons/baseterrain/Hill.dds</Button>
    		</BuildInfo>
    
    My Addition to the CIV4UnitInfos.xml (for each different worker unit)
    Code:
    				<Build>
    					<BuildType>BUILD_HILL</BuildType>
    					<bBuild>1</bBuild>
    				</Build>
    
    My Addition to the CIV4ImprovementInfos.xml
    Code:
    		<ImprovementInfo>
    			<Type>IMPROVEMENT_HILL</Type>
    			<Description>TXT_KEY_BUILD_HILL</Description>
    			<Civilopedia>TXT_KEY_IMPROVEMENT_LAND_WORKED_PEDIA</Civilopedia>
    			<ArtDefineTag>ART_DEF_IMPROVEMENT_BUILD_HILL</ArtDefineTag>
    			<YieldChanges>
    				<iYieldChange>1</iYieldChange>
    				<iYieldChange>1</iYieldChange>
    				<iYieldChange>0</iYieldChange>
    			</YieldChanges>
    			<bActsAsCity>0</bActsAsCity>
    			<bHillsMakesValid>0</bHillsMakesValid>
    			<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
    			<bRiverSideMakesValid>0</bRiverSideMakesValid>
    			<bNoFreshWater>0</bNoFreshWater>
    			<bRequiresFlatlands>0</bRequiresFlatlands>
    			<bRequiresRiverSide>0</bRequiresRiverSide>
    			<bRequiresIrrigation>0</bRequiresIrrigation>
    			<bCarriesIrrigation>0</bCarriesIrrigation>
    			<bRequiresFeature>0</bRequiresFeature>
    			<bWater>0</bWater>
    			<bGoody>0</bGoody>
    			<bPermanent>0</bPermanent>
    			<iAdvancedStartCost>-1</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iTilesPerGoody>0</iTilesPerGoody>
    			<iGoodyRange>0</iGoodyRange>
    			<iFeatureGrowth>0</iFeatureGrowth>
    			<iUpgradeTime>0</iUpgradeTime>
    			<iAirBombDefense>-1</iAirBombDefense>
    			<iDefenseModifier>0</iDefenseModifier>
    			<iHappiness>0</iHappiness>
    			<iPillageGold>0</iPillageGold>
    			<bOutsideBorders>1</bOutsideBorders>
    			<TerrainMakesValids>
    				<TerrainMakesValid>
    					<TerrainType>TERRAIN_DESERT</TerrainType>
    					<bMakesValid>1</bMakesValid>
    				</TerrainMakesValid>
    				<TerrainMakesValid>
    					<TerrainType>TERRAIN_TUNDRA</TerrainType>
    					<bMakesValid>1</bMakesValid>
    				</TerrainMakesValid>
    					<TerrainMakesValid>
    					<TerrainType>TERRAIN_GRASS</TerrainType>
    					<bMakesValid>1</bMakesValid>
    				</TerrainMakesValid>
    				<TerrainMakesValid>
    					<TerrainType>TERRAIN_PLAINS</TerrainType>
    					<bMakesValid>1</bMakesValid>
    				</TerrainMakesValid>
    			</TerrainMakesValids>
    			<FeatureMakesValids/>
    			<ImprovementPillage/>
    			<ImprovementUpgrade/>
    			<TechYieldChanges/>
    			<RouteYieldChanges/>
    			<WorldSoundscapeAudioScript/>
    			<bGraphicalOnly>1</bGraphicalOnly>
    		</ImprovementInfo>
    
    My Addition to the CIV4ArtDefines_Improvement.xml
    Code:
    		<ImprovementArtInfo>
    			<Type>ART_DEF_IMPROVEMENT_BUILD_HILL</Type>
    			<bExtraAnimations>0</bExtraAnimations>
    			<fScale>2</fScale>
    			<fInterfaceScale>1.0</fInterfaceScale>
    			<NIF>Art/Structures/Improvements/LandWorked/sm_farm_house.nif</NIF>
    			<KFM>Art/Structures/Improvements/LandWorked/sm_farm_house.kfm</KFM>
    			<Button>,Art/Interface/Buttons/baseterrain/Hill.dds</Button>
    		</ImprovementArtInfo>
    


    Currently I'm getting an error when I load the version of the mod that I have changed that says that the tag BUILD_HILL in the Civ4UnitInfos.xml is incorrect.

    Please help me figure out what I am doing wrong.


    EDIT:
    It was a capitalization error on my part, now I'm having some sort of Art bug where after the hill is completed it eats the worker and what is left behind is more of a crater than a hill.
     
  7. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,555
    Gender:
    Male
    Location:
    Canberra, Australia
    If it looks like a hill after you reload the game then it is working as expected.:( The graphics for hills looks strange when you place them during a game.
     
  8. Urza1234

    Urza1234 Chieftain

    Joined:
    Jul 17, 2012
    Messages:
    53
    thx for the help with the hills.

    btw, is bCanMovePeaks for CIV4PromotionInfos.xml currently broken?
     
  9. Arkatakor

    Arkatakor King

    Joined:
    Mar 11, 2006
    Messages:
    616
    Gender:
    Male
    Location:
    Stockholm, Sweden
    I would like to try making some modifications to AND 1.75C and would like to get that specific version from SVN. Is that at all possible? I would assume it would be if it was tagged as a specific version, though I am not sure that was the case.
     
  10. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,972
    Location:
    Just wonder...
    I'll have a look at it; when I find the correct rev, I'll let you know. I guess with SVN you can revert back to every version you like to.
     
  11. Reisk@

    Reisk@ Warlord

    Joined:
    Dec 18, 2012
    Messages:
    190
    Hi all

    I would like to add ranged attack to grenadiers and modern grenadiers. What must i edit in unit infos ?

    Thanks in advance.
     
  12. Reisk@

    Reisk@ Warlord

    Joined:
    Dec 18, 2012
    Messages:
    190
    I mean such ranged attack as does archers have against units. Anyone know ?
     
  13. Reisk@

    Reisk@ Warlord

    Joined:
    Dec 18, 2012
    Messages:
    190
    Thanks a lot for nothing.
     
  14. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,184
    Sorry for not seeing this. If you want to add a ranged attack to units, there are two XML tags you have to use. These go just before the </UnitInfo>.

    <iDCMBombRange> covers how far a unit can ranged-attack.
    <iDCMBombAccuracy> covers the percentage change (out of 100) of the attack hitting.

    So if you want a range-1 attack with 70% accuracy, add these lines:
    Code:
    <iDCMBombRange>1</iDCMBombRange>
    <iDCMBombAccuracy>70</iDCMBombAccuracy>
    Are you sure of your version, though? I see that AND already has a ranged attack on Grenadiers and Modern Grenadiers. Is your Archer Bombard option turned on?
     
  15. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    The TERRAIN_HILL if i recall is just a dummy.
    Changing the terrain to TERRAIN_HILL will mess up things as the plot itself is not really a hill.
    The plottype itself has to be changed to PLOT_HILLS, not the terrain type
     
  16. Arkatakor

    Arkatakor King

    Joined:
    Mar 11, 2006
    Messages:
    616
    Gender:
    Male
    Location:
    Stockholm, Sweden
    I have gone ahead and done an svn update in an attempt to run the latest version (636) in debug mode. I have version 636 for my Rise of Mandkind - A New Dawn folder as well so both the source files and the mod folder itself are according to SVN.

    Upon running the mod in debug mode, I get an assert from line 2601 in CvInfos.cpp for TECH_PREREQS stating that "There are more siblings than memory allocated for them in SetGlobalUnitInfo." Below is the exact line of code where the assert fails:

    FAssertMsg((iNumSibs <= GC.getNUM_AND_TECH_PREREQS()) ,"There are more siblings than memory allocated for them in SetGlobalUnitInfo");

    According to my understanding of the above, it seems there is a disparity with how many elements there are in the XML file and how many the DLL is actually expecting. If this is the case, I am trying to understand why as both the source files are exactly as per the svn at version 636.

    I have not done any local modifications whatsoever.
     
  17. 45°38'N-13°47'E

    45°38'N-13°47'E Deity

    Joined:
    Jun 7, 2008
    Messages:
    5,972
    Location:
    Just wonder...
    This isn't causing any troubles if you run the final dll and not in debug mode. It's caused by the fact that there's a limit to the number of prereq techs that a tech can have. In some previous revision I've modified Future Tech prereq; now FT requires 6 or 7 techs which is beyond the limit imposed via xml, but this can be changed in some xml file, I don't remember where. Anyway it isn't causing any trouble in gameplay, prereq techs which are beyond the limit number are simply ignored (say you need 7 techs to reach FT and the limit is 6, the seventh tech is simply ignored as a prereq).
     
  18. Arkatakor

    Arkatakor King

    Joined:
    Mar 11, 2006
    Messages:
    616
    Gender:
    Male
    Location:
    Stockholm, Sweden
    Yes I was able to get this to work in release mode; As long as this assert has no adverse affects on gameplay or overall functionality I am certainly happy to ignore it.
     
  19. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,419
    Gender:
    Male
    Location:
    Western IL. cornfields
    Vokarya has working knowledge of this. When he was redoing C2C tech tree it was ran into several times.

    JosEPh
     
  20. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    You mean this?
    Code:
    	<Define>
    		<DefineName>NUM_OR_TECH_PREREQS</DefineName>
    		<iDefineIntVal>4</iDefineIntVal>
    	</Define>
    	<Define>
    		<DefineName>NUM_AND_TECH_PREREQS</DefineName>
    		<iDefineIntVal>4</iDefineIntVal>
    	</Define>
    GlobalDefines.xml
     

Share This Page