Quick Modding Questions Thread

Sadly not directly doable.
Would either require a hack with Python (which is damn ugly and would seriously impact the performance), or a SDK component (sadly the one which we have here is outdated :().

Assuming you're answering me... How about to make it go 1 sq per turn off road, and triple or quadruple that while on the road?
 
:yup: was directed at you ;).

Sadly I don't see a good way to do that without any programming :/.
The movement rate on roads/railroads is set per road type, not depending on units, so there's no directly built in way to influence that.
 
Displaying the "trade winds" on the map in some way so the player has some clue as to what is happening is also a concern. Not to mention any issues the AI might have with it. The path finding algorithm would need to be modified to take the variations in speed vs. direction into account as well. It is not an easy issue.
 
In Final Frontier a Construction Ship becomes a Space Station. What is required to make a worker able to turn into similar fixed bunker unit.

XML only
or XML and Python
or XML, Python and DLL
 
In Final Frontier a Construction Ship becomes a Space Station. What is required to make a worker able to turn into similar fixed bunker unit.
L

You mean like fishing boats?

then it's just in units\civ4buildinfos.xml, change bkill to 1 in the appropriate build


probably misunderstood the question, strike that :S
 
It's doable in Python, as that is how the original Final Frontier did it. The key functions to look at are onUnitBuildImprovement and onImprovementBuilt in FF's CvFinalFrontierEvents.py.

Final Frontier Plus does it via changes to XML and the DLL. There is a new UnitClassBuilt tag in CIV4ImprovementInfos.xml (used by IMPROVEMENT_STARBASE and IMPROVEMENT_SENSOR) which, if given a value, causes the modified DLL (CvUnit::build in CvUnit.cpp) to not create the improvement, but create the specified unit instead and destroy the unit that built it (as smortt mentioned this part is caused by the bKill flag for the build - which is not new functionality).
 
I want to split my unitinfos and buildinginfos etc into seperate xml files (since having 600 units is a real pain with that big of a file). But when I seperate them, the game only loads the original one

how do you get it to load all of them??(Sadly sounds like dll:mad: work but hope not)
 
Im assuming by that you mean placing that in modular folders and enable modular loading in the xml file??
Thats not what i want. I saw realism invictus has like 10 or so xml files for units in the xml/units category to split it up and thats what i was looking to do
 
So, this is sort of a noob question, but I didn't know where else to put it.

I'm trying to find a mod for Civ 4 that does two things:

1. Limits the amount of units you can have in a stack, to limit the "stack of doom" strategy.
2. Shows the individual units in that stack without having to click and see. For example:

G8Tk7.png


Any help would be appreciated.
 
What happens at turn 7-8?
It's crashing my mod every time. I've narroed it down to this code:
Spoiler :
Code:
		<UnitInfo>
			<Class>UNITCLASS_SPECIAL_FORCES</Class>
			<Type>UNIT_MACV_SOG</Type>
			<UniqueNames/>
			<Special>SPECIALUNIT_INFANTRY</Special>
			<Capture>NONE</Capture>
			<Combat>UNITCOMBAT_GUN</Combat>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
			<Invisible>NONE</Invisible>
			<SeeInvisible>NONE</SeeInvisible>
			<Description>MACV SOG</Description>
			<Civilopedia>TXT_KEY_UNIT_MACV_SOG_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_UNIT_SPECIAL_FORCES_STRATEGY</Strategy>
			<Advisor>ADVISOR_MILITARY</Advisor>
			<bAnimal>0</bAnimal>
			<bFood>0</bFood>
			<bNoBadGoodies>0</bNoBadGoodies>
			<bOnlyDefensive>0</bOnlyDefensive>
			<bNoCapture>1</bNoCapture>
			<bQuickCombat>0</bQuickCombat>
			<bRivalTerritory>0</bRivalTerritory>
			<bMilitaryHappiness>1</bMilitaryHappiness>
			<bMilitarySupport>1</bMilitarySupport>
			<bMilitaryProduction>1</bMilitaryProduction>
			<bPillage>1</bPillage>
			<bSpy>0</bSpy>
			<bSabotage>0</bSabotage>
			<bDestroy>0</bDestroy>
			<bStealPlans>0</bStealPlans>
			<bInvestigate>0</bInvestigate>
			<bCounterSpy>0</bCounterSpy>
			<bFound>0</bFound>
			<bGoldenAge>0</bGoldenAge>
			<bInvisible>0</bInvisible>
			<bFirstStrikeImmune>0</bFirstStrikeImmune>
			<bNoDefensiveBonus>0</bNoDefensiveBonus>
			<bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>
			<bCanMoveImpassable>1</bCanMoveImpassable>
			<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
			<bFlatMovementCost>0</bFlatMovementCost>
			<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
			<bNukeImmune>0</bNukeImmune>
			<bPrereqBonuses>0</bPrereqBonuses>
			<bPrereqReligion>0</bPrereqReligion>
			<bMechanized>0</bMechanized>
			<bSuicide>0</bSuicide>
			<bHiddenNationality>0</bHiddenNationality>
			<bAlwaysHostile>0</bAlwaysHostile>
			<UnitClassUpgrades/>
			<UnitClassTargets/>
			<UnitCombatTargets/>
			<UnitClassDefenders/>
			<UnitCombatDefenders/>
			<FlankingStrikes/>
			<UnitAIs>
				<UnitAI>
					<UnitAIType>UNITAI_ATTACK</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_RESERVE</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_CITY_DEFENSE</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
			</UnitAIs>
			<NotUnitAIs/>
			<Builds/>
			<ReligionSpreads/>
			<CorporationSpreads/>
			<GreatPeoples/>
			<Buildings/>
			<ForceBuildings/>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<PrereqBuilding>NONE</PrereqBuilding>
			<PrereqTech>TECH_US_UNITS</PrereqTech>
			<TechTypes>
				<PrereqTech>TECH_RIFLING</PrereqTech>
				<PrereqTech>TECH_INDUSTRIALISM</PrereqTech>
				<PrereqTech>NONE</PrereqTech>
			</TechTypes>
			<BonusType>NONE</BonusType>
			<PrereqBonuses/>
			<ProductionTraits/>
			<Flavors/>
			<iAIWeight>0</iAIWeight>
			<iCost>260</iCost>
			<iHurryCostModifier>0</iHurryCostModifier>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iMinAreaSize>-1</iMinAreaSize>
			<iMoves>1</iMoves>
			<bNoRevealMap>0</bNoRevealMap>
			<iAirRange>0</iAirRange>
			<iAirUnitCap>0</iAirUnitCap>
			<iDropRange>12</iDropRange>
			<iNukeRange>-1</iNukeRange>
			<iWorkRate>0</iWorkRate>
			<iBaseDiscover>0</iBaseDiscover>
			<iDiscoverMultiplier>0</iDiscoverMultiplier>
			<iBaseHurry>0</iBaseHurry>
			<iHurryMultiplier>0</iHurryMultiplier>
			<iBaseTrade>0</iBaseTrade>
			<iTradeMultiplier>0</iTradeMultiplier>
			<iGreatWorkCulture>0</iGreatWorkCulture>
			<iEspionagePoints>0</iEspionagePoints>
			<TerrainImpassables/>
			<FeatureImpassables/>
			<TerrainPassableTechs/>
			<FeaturePassableTechs/>
			<iCombat>28</iCombat>
			<iCombatLimit>100</iCombatLimit>
			<iAirCombat>0</iAirCombat>
			<iAirCombatLimit>0</iAirCombatLimit>
			<iXPValueAttack>4</iXPValueAttack>
			<iXPValueDefense>2</iXPValueDefense>
			<iFirstStrikes>0</iFirstStrikes>
			<iChanceFirstStrikes>0</iChanceFirstStrikes>
			<iInterceptionProbability>0</iInterceptionProbability>
			<iEvasionProbability>75</iEvasionProbability>
			<iWithdrawalProb>0</iWithdrawalProb>
			<iCollateralDamage>0</iCollateralDamage>
			<iCollateralDamageLimit>0</iCollateralDamageLimit>
			<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
			<iCityAttack>0</iCityAttack>
			<iCityDefense>0</iCityDefense>
			<iAnimalCombat>0</iAnimalCombat>
			<iHillsAttack>0</iHillsAttack>
			<iHillsDefense>0</iHillsDefense>
			<TerrainNatives/>
			<FeatureNatives/>
			<TerrainAttacks/>
			<TerrainDefenses/>
			<FeatureAttacks/>
			<FeatureDefenses/>
			<UnitClassAttackMods/>
			<UnitClassDefenseMods/>
			<UnitCombatMods/>
			<UnitCombatCollateralImmunes/>
			<DomainMods/>
			<BonusProductionModifiers/>
			<iBombRate>0</iBombRate>
			<iBombardRate>0</iBombardRate>
			<SpecialCargo>NONE</SpecialCargo>
			<DomainCargo>NONE</DomainCargo>
			<iCargo>0</iCargo>
			<iConscription>1</iConscription>
			<iCultureGarrison>12</iCultureGarrison>
			<iExtraCost>0</iExtraCost>
			<iAsset>4</iAsset>
			<iPower>28</iPower>
			<UnitMeshGroups>
				<iGroupSize>3</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<fPadTime>1</fPadTime>
				<iMeleeWaveSize>3</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>3</iRequired>
					<EarlyArtDefineTag>ART_DEF_UNIT_MACV_SOG</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>
			<FormationType>FORMATION_TYPE_DEFAULT</FormationType>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<FreePromotions>
				<FreePromotion>
					<PromotionType>PROMOTION_AMPHIBIOUS</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_1</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_2</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_3</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_BLITZ</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
			</FreePromotions>
			<LeaderPromotion>NONE</LeaderPromotion>
			<iLeaderExperience>0</iLeaderExperience>
		</UnitInfo>

It's a special unit in the game, and if it's not in the map at turn 7-8, the game doesn't crash.

EDIT:

Who made this skin for marine? I found it burried in my Civ IV units folder, and made the MACV SOG based on this skin.

Spoiler :
attachment.php

attachment.php
 

Attachments

  • marine_skin.jpg
    marine_skin.jpg
    9.2 KB · Views: 160
  • SOG_Unit.jpg
    SOG_Unit.jpg
    47.3 KB · Views: 316
What happens at turn 7-8?
It's crashing my mod every time. I've narroed it down to this code:
Spoiler :
Code:
		<UnitInfo>
			<Class>UNITCLASS_SPECIAL_FORCES</Class>
			<Type>UNIT_MACV_SOG</Type>
			<UniqueNames/>
			<Special>SPECIALUNIT_INFANTRY</Special>
			<Capture>NONE</Capture>
			<Combat>UNITCOMBAT_GUN</Combat>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
			<Invisible>NONE</Invisible>
			<SeeInvisible>NONE</SeeInvisible>
			<Description>MACV SOG</Description>
			<Civilopedia>TXT_KEY_UNIT_MACV_SOG_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_UNIT_SPECIAL_FORCES_STRATEGY</Strategy>
			<Advisor>ADVISOR_MILITARY</Advisor>
			<bAnimal>0</bAnimal>
			<bFood>0</bFood>
			<bNoBadGoodies>0</bNoBadGoodies>
			<bOnlyDefensive>0</bOnlyDefensive>
			<bNoCapture>1</bNoCapture>
			<bQuickCombat>0</bQuickCombat>
			<bRivalTerritory>0</bRivalTerritory>
			<bMilitaryHappiness>1</bMilitaryHappiness>
			<bMilitarySupport>1</bMilitarySupport>
			<bMilitaryProduction>1</bMilitaryProduction>
			<bPillage>1</bPillage>
			<bSpy>0</bSpy>
			<bSabotage>0</bSabotage>
			<bDestroy>0</bDestroy>
			<bStealPlans>0</bStealPlans>
			<bInvestigate>0</bInvestigate>
			<bCounterSpy>0</bCounterSpy>
			<bFound>0</bFound>
			<bGoldenAge>0</bGoldenAge>
			<bInvisible>0</bInvisible>
			<bFirstStrikeImmune>0</bFirstStrikeImmune>
			<bNoDefensiveBonus>0</bNoDefensiveBonus>
			<bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>
			<bCanMoveImpassable>1</bCanMoveImpassable>
			<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
			<bFlatMovementCost>0</bFlatMovementCost>
			<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
			<bNukeImmune>0</bNukeImmune>
			<bPrereqBonuses>0</bPrereqBonuses>
			<bPrereqReligion>0</bPrereqReligion>
			<bMechanized>0</bMechanized>
			<bSuicide>0</bSuicide>
			<bHiddenNationality>0</bHiddenNationality>
			<bAlwaysHostile>0</bAlwaysHostile>
			<UnitClassUpgrades/>
			<UnitClassTargets/>
			<UnitCombatTargets/>
			<UnitClassDefenders/>
			<UnitCombatDefenders/>
			<FlankingStrikes/>
			<UnitAIs>
				<UnitAI>
					<UnitAIType>UNITAI_ATTACK</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_RESERVE</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
				<UnitAI>
					<UnitAIType>UNITAI_CITY_DEFENSE</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
			</UnitAIs>
			<NotUnitAIs/>
			<Builds/>
			<ReligionSpreads/>
			<CorporationSpreads/>
			<GreatPeoples/>
			<Buildings/>
			<ForceBuildings/>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<PrereqBuilding>NONE</PrereqBuilding>
			<PrereqTech>TECH_US_UNITS</PrereqTech>
			<TechTypes>
				<PrereqTech>TECH_RIFLING</PrereqTech>
				<PrereqTech>TECH_INDUSTRIALISM</PrereqTech>
				<PrereqTech>NONE</PrereqTech>
			</TechTypes>
			<BonusType>NONE</BonusType>
			<PrereqBonuses/>
			<ProductionTraits/>
			<Flavors/>
			<iAIWeight>0</iAIWeight>
			<iCost>260</iCost>
			<iHurryCostModifier>0</iHurryCostModifier>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iMinAreaSize>-1</iMinAreaSize>
			<iMoves>1</iMoves>
			<bNoRevealMap>0</bNoRevealMap>
			<iAirRange>0</iAirRange>
			<iAirUnitCap>0</iAirUnitCap>
			<iDropRange>12</iDropRange>
			<iNukeRange>-1</iNukeRange>
			<iWorkRate>0</iWorkRate>
			<iBaseDiscover>0</iBaseDiscover>
			<iDiscoverMultiplier>0</iDiscoverMultiplier>
			<iBaseHurry>0</iBaseHurry>
			<iHurryMultiplier>0</iHurryMultiplier>
			<iBaseTrade>0</iBaseTrade>
			<iTradeMultiplier>0</iTradeMultiplier>
			<iGreatWorkCulture>0</iGreatWorkCulture>
			<iEspionagePoints>0</iEspionagePoints>
			<TerrainImpassables/>
			<FeatureImpassables/>
			<TerrainPassableTechs/>
			<FeaturePassableTechs/>
			<iCombat>28</iCombat>
			<iCombatLimit>100</iCombatLimit>
			<iAirCombat>0</iAirCombat>
			<iAirCombatLimit>0</iAirCombatLimit>
			<iXPValueAttack>4</iXPValueAttack>
			<iXPValueDefense>2</iXPValueDefense>
			<iFirstStrikes>0</iFirstStrikes>
			<iChanceFirstStrikes>0</iChanceFirstStrikes>
			<iInterceptionProbability>0</iInterceptionProbability>
			<iEvasionProbability>75</iEvasionProbability>
			<iWithdrawalProb>0</iWithdrawalProb>
			<iCollateralDamage>0</iCollateralDamage>
			<iCollateralDamageLimit>0</iCollateralDamageLimit>
			<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
			<iCityAttack>0</iCityAttack>
			<iCityDefense>0</iCityDefense>
			<iAnimalCombat>0</iAnimalCombat>
			<iHillsAttack>0</iHillsAttack>
			<iHillsDefense>0</iHillsDefense>
			<TerrainNatives/>
			<FeatureNatives/>
			<TerrainAttacks/>
			<TerrainDefenses/>
			<FeatureAttacks/>
			<FeatureDefenses/>
			<UnitClassAttackMods/>
			<UnitClassDefenseMods/>
			<UnitCombatMods/>
			<UnitCombatCollateralImmunes/>
			<DomainMods/>
			<BonusProductionModifiers/>
			<iBombRate>0</iBombRate>
			<iBombardRate>0</iBombardRate>
			<SpecialCargo>NONE</SpecialCargo>
			<DomainCargo>NONE</DomainCargo>
			<iCargo>0</iCargo>
			<iConscription>1</iConscription>
			<iCultureGarrison>12</iCultureGarrison>
			<iExtraCost>0</iExtraCost>
			<iAsset>4</iAsset>
			<iPower>28</iPower>
			<UnitMeshGroups>
				<iGroupSize>3</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<fPadTime>1</fPadTime>
				<iMeleeWaveSize>3</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>3</iRequired>
					<EarlyArtDefineTag>ART_DEF_UNIT_MACV_SOG</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>
			<FormationType>FORMATION_TYPE_DEFAULT</FormationType>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<FreePromotions>
				<FreePromotion>
					<PromotionType>PROMOTION_AMPHIBIOUS</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_1</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_2</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_JUNGLE_RAIDER_3</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
				<FreePromotion>
					<PromotionType>PROMOTION_BLITZ</PromotionType>
					<bFreePromotion>1</bFreePromotion>
				</FreePromotion>
			</FreePromotions>
			<LeaderPromotion>NONE</LeaderPromotion>
			<iLeaderExperience>0</iLeaderExperience>
		</UnitInfo>

It's a special unit in the game, and if it's not in the map at turn 7-8, the game doesn't crash.
I am not sure, but its probably something specific to your mod so from the code it would be hard to tell. What I would do is take the closest unit (assuming this is a UU so take special forces) and change one thing at a time. Change just the name, and try it, to make sure everything is okay. Then start changing details (Art etc.) one at a time so then you can tell what is wrong.
 
Back
Top Bottom