Multiple units of same type

Joined
Oct 24, 2005
Messages
413
Location
Vukojebina, Croatia
Is it possible to make multiple versions of unit that are same class(ie. multiple versions of infantry) and are all buildable by all civs but their build req. depend on strategic resources.

IE. I'm thinking of a future space mod, would it be possible to make multiple versions of one unit, like different generations of a space ship, but they would require different components to build. And these components would be obtainable from factories that would produce these resources as strategic goods(ie. like the gunsmith that produces muskets, you'd have a factory that makes warp drives/plasma torpedoes/whatever)...
 
well to make multiple types of the same unit with different resorce requirements all you would really need to do is duplicate the unit info in the XML file and change the requirements.

I don't really know about the statigic resorce idea but you can make buildings a prerequisite so you can make multiple buldies like factories and then make those factories required in a city before that city can build the unit...

I did this with nukes in my game. I made it so you need to build a Missle Silo (basicly a bunker with an unhappyness bonus and no other bonuses) in a city before that city can build ICBMs. It won't generate a static resorce or be tradable but it will make things tougher.

Actually as an afterthought while writing this I guess you could modify a building to be similar to the Rock & Roll wonder (but without the wonder) and make a resorce (change Hit Singles for Power Coils) and it wouldn't be that hard to impliment :P
 
Exactly, I was thinking like national wonders as component factories:

IE. Ironworks produce three units of steel(like hollywood produces 5 hit movies). You cannot build railroad without steel. To build railroad, you need the tech and steel. Either build ironworks or import it.

Or better yet, how about generations of jet fighter based on similar national wonders. I think this would add more diversity and as long as multiple copies of same class do not cause conflicts, this would be very interesting.
 
omg I love this Idea. you could smelters for copper and iron :goodjob:
reworking the whole thing to make all units buildable from the start and need to research the actual technology to produse them. Pretty much the way it is, but more realistic in regrading trade... :hmm:

you can easily see how the game handles the multiple units of the same type by duplicating a unit and giving it diferent stats, though.. I'd presume there would have to be some upgrade path. Meaning the two could not exist at the same time for any one civ.
 
Do you have to create multiple versions of the same unit depending on resources available (copper, iron, etj.) or special sources such as Hit Movies, etj. created from buildings?

It would be easier to create a new unit (available to all) depending on natural resources:

CIV4UnitInfos.xml

<UnitInfo>
<Class>UNITCLASS_SWORDSMAN</Class>
<Type>UNIT_IRON_SWORDSMAN</Type>
<BonusType>BONUS_IRON</BonusType>
<iCombat>6</iCombat>
</UnitInfo>

<UnitInfo>
<Class>UNITCLASS_SWORDSMAN</Class>
<Type>UNIT_COPPER_SWORDSMAN</Type>
<BonusType>BONUS_COPPER</BonusType>
<iCombat>7</iCombat>
</UnitInfo>

Currently Swordsman needs Iron to be built , but just illustrating the changes that can be made ... You define the resource ("bonus") needed to build the unit , and they will be available to all civs...
 
Keep in mind you'll also have to define the units in CIV4UnitClassInfos.xml and (preferably) set their values to -1 to make them unlimited.
 
I'm not sure if you know how to make buildings that give resources, but this might be the thing. This comes from Jaynus's realism mod. This makes a gunsmith that is necessary to build musket dudes. I think this is all that would be necessary

In Civ4BuildingInfos:
<BuildingInfo>
<BuildingClass>BUILDINGCLASS_GUNSMITH</BuildingClass>
<Type>BUILDING_GUNSMITH</Type>
<SpecialBuildingType>NONE</SpecialBuildingType>
<Description>TXT_KEY_BUILDING_GUNSMITH</Description>
<Civilopedia>TXT_KEY_BUILDING_GUNSMITH_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_FORGE_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<ArtDefineTag>ART_DEF_BUILDING_FORGE</ArtDefineTag>
<MovieDefineTag>NONE</MovieDefineTag>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
<VictoryPrereq>NONE</VictoryPrereq>
<FreeStartEra>NONE</FreeStartEra>
<MaxStartEra>NONE</MaxStartEra>
<ObsoleteTech>NONE</ObsoleteTech>
<PrereqTech>TECH_GUNPOWDER</PrereqTech>
<TechTypes/>
<Bonus>NONE</Bonus>
<PrereqBonuses/>
<ProductionTraits/>
<PowerBonus>NONE</PowerBonus>
<FreeBonus>BONUS_MUSKETS</FreeBonus>
<iNumFreeBonuses>1</iNumFreeBonuses>
<FreeBuilding>NONE</FreeBuilding>
<FreePromotion>NONE</FreePromotion>
<CivicOption>NONE</CivicOption>
<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
<bTeamShare>0</bTeamShare>
<bWater>0</bWater>
<bRiver>0</bRiver>
<bPower>0</bPower>
<bDirtyPower>0</bDirtyPower>
<bAreaCleanPower>0</bAreaCleanPower>
<bDiploVote>0</bDiploVote>
<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
<bCapital>0</bCapital>
<bGovernmentCenter>0</bGovernmentCenter>
<bGoldenAge>0</bGoldenAge>
<bMapCentering>0</bMapCentering>
<bNoUnhappiness>0</bNoUnhappiness>
<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
<bNeverCapture>0</bNeverCapture>
<bNukeImmune>0</bNukeImmune>
<bPrereqReligion>0</bPrereqReligion>
<bCenterInCity>0</bCenterInCity>
<iAIWeight>0</iAIWeight>
<iCost>100</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>-1</iMinAreaSize>
<iConquestProb>0</iConquestProb>
<iCitiesPrereq>0</iCitiesPrereq>
<iTeamsPrereq>0</iTeamsPrereq>
<iLevelPrereq>0</iLevelPrereq>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>90</iMaxLatitude>
<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
<iAnarchyModifier>0</iAnarchyModifier>
<iGlobalHurryModifier>0</iGlobalHurryModifier>
<iExperience>0</iExperience>
<iGlobalExperience>0</iGlobalExperience>
<iFoodKept>0</iFoodKept>
<iAirlift>0</iAirlift>
<iAirModifier>0</iAirModifier>
<iNukeModifier>0</iNukeModifier>
<iNukeExplosionRand>0</iNukeExplosionRand>
<iFreeSpecialist>0</iFreeSpecialist>
<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
<iMaintenanceModifier>0</iMaintenanceModifier>
<iWarWearinessModifier>0</iWarWearinessModifier>
<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
<iHealRateChange>0</iHealRateChange>
<iHealth>0</iHealth>
<iAreaHealth>0</iAreaHealth>
<iGlobalHealth>0</iGlobalHealth>
<iHappiness>0</iHappiness>
<iAreaHappiness>0</iAreaHappiness>
<iGlobalHappiness>0</iGlobalHappiness>
<iStateReligionHappiness>0</iStateReligionHappiness>
<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
<iSpaceProductionModifier>0</iSpaceProductionModifier>
<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
<iTradeRoutes>0</iTradeRoutes>
<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
<iTradeRouteModifier>0</iTradeRouteModifier>
<iGlobalPopulationChange>0</iGlobalPopulationChange>
<iFreeTechs>0</iFreeTechs>
<iDefense>0</iDefense>
<iAllCityDefense>0</iAllCityDefense>
<iAsset>2</iAsset>
<iPower>4</iPower>
<fVisibilityPriority>1.0</fVisibilityPriority>
<SeaPlotYieldChanges/>
<GlobalSeaPlotYieldChanges/>
<YieldChanges/>
<CommerceChanges/>
<ObsoleteSafeCommerceChanges/>
<CommerceChangeDoubleTimes/>
<CommerceModifiers/>
<GlobalCommerceModifiers/>
<SpecialistExtraCommerces/>
<StateReligionCommerces/>
<CommerceHappinesses/>
<ReligionChanges/>
<SpecialistCounts/>
<FreeSpecialistCounts/>
<CommerceFlexibles/>
<CommerceChangeOriginalOwners/>
<ConstructSound>AS2D_BUILD_FORGE</ConstructSound>
<BonusHealthChanges/>
<BonusHappinessChanges/>
<BonusProductionModifiers/>
<UnitCombatFreeExperiences/>
<DomainFreeExperiences/>
<DomainProductionModifiers/>
<BuildingHappinessChanges/>
<PrereqBuildingClasses/>
<BuildingClassNeededs>
<BuildingClassNeeded>
<BuildingClassType>BUILDINGCLASS_FORGE</BuildingClassType>
<bNeededInCity>1</bNeededInCity>
</BuildingClassNeeded>
</BuildingClassNeededs>
<SpecialistYieldChanges/>
<BonusYieldModifiers/>
<Flavors>
<Flavor>
<FlavorType>FLAVOR_MILITARY</FlavorType>
<iFlavor>10</iFlavor>
</Flavor>
</Flavors>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
</BuildingInfo>

In Civ4BonusInfos:
<BonusInfo>
<Type>BONUS_MUSKETS</Type>
<Description>TXT_KEY_BONUS_MUSKETS</Description>
<Civilopedia>TTXT_KEY_BONUS_MUSKETS_PEDIA</Civilopedia>
<BonusClassType>BONUSCLASS_GENERAL</BonusClassType>
<ArtDefineTag>ART_DEF_BONUS_COAL</ArtDefineTag>
<TechReveal>NONE</TechReveal>
<TechCityTrade>TECH_GUNPOWDER</TechCityTrade>
<TechObsolete>NONE</TechObsolete>
<YieldChanges/>
<iAITradeModifier>10</iAITradeModifier>
<iHealth>0</iHealth>
<iHappiness>0</iHappiness>
<iPlacementOrder>-1</iPlacementOrder>
<iConstAppearance>0</iConstAppearance>
<iMinAreaSize>-0</iMinAreaSize>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>0</iMaxLatitude>
<Rands>
<iRandApp1>0</iRandApp1>
<iRandApp2>0</iRandApp2>
<iRandApp3>0</iRandApp3>
<iRandApp4>0</iRandApp4>
</Rands>
<iPlayer>100</iPlayer>
<iTilesPer>0</iTilesPer>
<iMinLandPercent>0</iMinLandPercent>
<iUnique>0</iUnique>
<iGroupRange>0</iGroupRange>
<iGroupRand>0</iGroupRand>
<bArea>0</bArea>
<bHills>0</bHills>
<bFlatlands>0</bFlatlands>
<bNoRiverSide>0</bNoRiverSide>
<bNormalize>0</bNormalize>
<TerrainBooleans/>
<FeatureBooleans/>
<FeatureTerrainBooleans/>
</BonusInfo>

Then, for the unit, <BonusType>BONUS_MUSKETS</BonusType>, like Shqype said.
 
Back
Top Bottom