Adding alien units to harmony affinity, need help.

Khtugg

Chieftain
Joined
Oct 29, 2014
Messages
14
Hi all,

I would very much like to be able to make alien units as a harmony colony. How do I do this? In Age of Myhology I could make a faction spawn/train units they are not able to do normaly, but I have no experience with Civilization Beyond Earth.

More questions: Would it be possible to tie the different alien unit types to harmony rank? And could waterbound aliens be build as well? -In coastal cities of course. Any advice would be much appreciated!

Thanks for reading
 
You'd need to use Lua (Player.CanTrain). I'm not sure offhand how to check the rank, but I'm sure if you grep the game's Lua files, you can find the appropriate function to use as the condition.
 
You could also try copying all the attributes of Alien units to new custom units and use this:

Code:
<Unit_AffinityPrereqs>
		<Row>
			<UnitType>UNIT_.....</UnitType>
			<AffinityType>AFFINITY_TYPE_HARMONY</AffinityType>
			<Level>...</Level>
		</Row>
 
Both of you, thanks for replying, where do I find this Player.CanTrain lua? I'm having trouble locating it...
 
Roger that, Nutty. I'll try the Leugi way but in what file do I make these changes in? I mention earlier that I made basic modding(with emphasis on basic) in Age of Mythology but it's another game and it's been a while...

Another question: to do the Leugi I copy text of alien unit X, paste in elsewhere in the same file and rename it "Garm" for instance and then paste above text in, replace the part

<UnitType>UNIT_.....</UnitType>
with
<UnitType>UNIT_Garm</UnitType>

Finally I replace the "..." in <Level>...</Level> with the desired level of affinity I want them available in, correct?

I can almost hear the manticores snoring in the fungus plantation :)
 
Ok, I've found CivBEUnit.XML, is this what I'm looking for?

How do I rename the custom units? Like the Kraken, It's top most line is:

<Type>UNIT_ALIEN_KRAKEN</Type>

Do I simply change the KRAKEN part with an unique name or is more change needed?
 
Directly editing the game files is a possible simplistic form of modding, but if you want to release this for others to use through the Workshop, then you'll have to learn how to make a real mod, which has a bit of a learning curve. There are lots of online tutorials about Civ5 modding, which carries over completely to modding BE.

The short version: You install the game SDK from within Steam by going to Library > Tools. Open ModBuddy, start a new mod, add a new XML file, pasting in Leugi's code and making the appropriate changes to reference your new units (e.g., UNIT_GARM). Then add the sections copied from CivBEUnit.XML [between the <GameData> and </GameData> tags], changing entries wherever appropriate to your new units. You'll also need the entries for the UnitClasses table. Set the file to OnModActivated > UpdateDatabase in the mod properties. You'll need another file (or another section of the same file) to add new entries to the Localization database that will change TXT_KEY_* to the text that you see onscreen [or, alternatively, you can just be lazy and just put literal text in any of those entries with TXT_KEY references, but if you've gotten this far, you might as well do it right, in case someone wants to translate your mod to their language).
 
Hello Nutty,

I've tried changing that file over a pair of days, but I cannot make it work. Game will not start proper when the modded file is in the folder. I just don't know what I'm doing:confused:

Earlier you mentioned that you could write the code/lua/what-it-is for me. I would very much like to ask you of that favour, if the offer still stands.

Thanks for reading.
 
You could also try copying all the attributes of Alien units to new custom units and use this:

Code:
<Unit_AffinityPrereqs>
		<Row>
			<UnitType>UNIT_.....</UnitType>
			<AffinityType>AFFINITY_TYPE_HARMONY</AffinityType>
			<Level>...</Level>
		</Row>

In order to make the alien units build-able in theory you just need to create them their own class by altering the <UnitClasses> section

Code:
<UnitClasses>
                <Row>
			<Type>UNITCLASS_RAPTOR_BUG</Type>
			<Description>TXT_KEY_UNIT_RAPTOR_BUG</Description>
			<DefaultUnit>UNIT_ALIEN_RAPTOR_BUG</DefaultUnit>
		</Row>
<UnitClasses>

<Units>
                <Where Type="UNIT_ALIEN_RAPTOR_BUG"/>
                <Set Class="UNITCLASS_RAPTOR_BUG">
</Units>

The above in theory should then make it so the Raptor Bug unit is then produce-able in your cities.
 
@Khtugg: As PlymJim underscores (and mentioned in my previous post), did you add the UnitClasses entry?

@PlymJim: You missed the closing slash on the Units Set command, and on </UnitClasses>.
EDIT: And didn't put your Where/Set in an <Update>.
EDIT #2: And will that prevent the Alien player from spawning aliens without the proper affinity level? I'm not sure it will, given the way Aliens.lua works, but I'd have to look at it again to be sure.
EDIT #3: And, assuming the Alien Flyer is one of the units desired, he'll need this:
Code:
<Civilization_UnitClassOverrides>
		<Delete UnitClassType="UNITCLASS_ALIEN_FLYER"/>
</CivilizationUnitClassOverrides>

...And he'll need copies of the Units rather than just updating the class, to get around AlienLifeForm=1 and what that entails, as well as to set appropriate Cost, etc.
 
I'd do it something like this:
Code:
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_WOLF_BEETLE_HARMONY',Description,Civilopedia,Strategy,Help,40,30,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_WOLF_BEETLE_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_ALIEN_SCIENCES',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_WOLF_BEETLE';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_RAPTOR_BUG_HARMONY',Description,Civilopedia,Strategy,Help,100,75,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_RAPTOR_BUG_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_GENETIC_DESIGN',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_RAPTOR_BUG';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_FLYER_HARMONY',Description,Civilopedia,Strategy,Help,80,60,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_FLYER_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_ALIEN_LIFEFORMS',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_FLYER';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_MANTICORE_HARMONY',Description,Civilopedia,Strategy,Help,80,60,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_MANTICORE_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_ALIEN_ETHICS',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_MANTICORE';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_SEA_DRAGON_HARMONY',Description,Civilopedia,Strategy,Help,300,225,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_SEA_DRAGON_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_ALIEN_ECOLOGY',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_SEA_DRAGON';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_SIEGE_WORM_HARMONY',Description,Civilopedia,Strategy,Help,350,265,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_SIEGE_WORM_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_TRANSGENICS',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_SIEGE_WORM';
INSERT INTO Units (Type,Description,Civilopedia,Strategy,Help,Cost,AdvancedStartCost,AirInterceptRange,AirUnitCap,AlienLifeform,AlienColossus,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,Class,Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,PrereqTech,ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,ShowInPedia,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense)
	SELECT 'UNIT_ALIEN_KRAKEN_HARMONY',Description,Civilopedia,Strategy,Help,400,300,AirInterceptRange,AirUnitCap,0,0,BaseBeakersTurnsToCount,BaseCultureTurnsToCount,BaseHurry,BaseSightRange,CoastalWalk,Capture,CaptureWhileEmbarked,CivilianAttackPriority,'UNITCLASS_KRAKEN_HARMONY',Combat,CombatClass,CombatLimit,Conscription,DeepWaterOnly,DefaultUnitAI,Domain,DomainCargo,DontShowYields,EarthlingSettler,ExtraMaintenanceCost,Food,Found,FoundAbroad,FreePolicies,GoodyHutUpgradeUnitClass,HurryCostModifier,HurryMultiplier,IgnoreBuildingDefense,Immobile,LeaderExperience,LeaderPromotion,Mechanized,MilitaryProduction,MilitarySupport,MinAreaSize,MoveRate,Moves,NoBadGoodies,NoMaintenance,NumExpeditionCharges,NumFreeTechs,NumGoldPerEra,ObsoleteTech,Orbital,Pillage,PillagePrereqTech,PrereqResources,'TECH_ARTIFICAL_EVOLUTION',ProjectPrereq,Range,OrbitalAttackRange,RangeAttackIgnoreLOS,RangeAttackOnlyInDomain,RangedCombat,RangedCombatLimit,Requirements,RivalTerritory,RushBuilding,0,SpaceshipProject,Special,SpecialCargo,Suicide,Trade,Unhealth,UnitArtInfo,UnitArtInfoCulturalVariation,UnitArtInfoEraVariation,UnitArtInfoUpgradeVariation,UnitArtInfoAffinityVariationStart,Worker,WorkRate,XPValueAttack,XPValueDefense
	FROM Units WHERE Type = 'UNIT_ALIEN_KRAKEN';

INSERT INTO UnitClasses (Type,Description,DefaultUnit)
	VALUES	('UNITCLASS_WOLF_BEETLE_HARMONY','TXT_KEY_UNIT_ALIEN_WOLF_BEETLE','UNIT_ALIEN_WOLF_BEETLE_HARMONY'),
			('UNITCLASS_FLYER_HARMONY','TXT_KEY_UNIT_ALIEN_FLYER','UNIT_ALIEN_FLYER_HARMONY'),
			('UNITCLASS_RAPTOR_BUG_HARMONY','TXT_KEY_UNIT_ALIEN_RAPTOR_BUG','UNIT_ALIEN_RAPTOR_BUG_HARMONY'),
			('UNITCLASS_MANTICORE_HARMONY','TXT_KEY_UNIT_ALIEN_MANTICORE','UNIT_ALIEN_MANTICORE_HARMONY'),
			('UNITCLASS_SEA_DRAGON_HARMONY','TXT_KEY_UNIT_ALIEN_SEA_DRAGON','UNIT_ALIEN_SEA_DRAGON_HARMONY'),
			('UNITCLASS_SIEGE_WORM_HARMONY','TXT_KEY_UNIT_ALIEN_SIEGE_WORM','UNIT_ALIEN_SIEGE_WORM_HARMONY'),
			('UNITCLASS_KRAKEN_HARMONY','TXT_KEY_UNIT_ALIEN_KRAKEN','UNIT_ALIEN_KRAKEN_HARMONY');

INSERT INTO Unit_AffinityPrereqs (UnitType,AffinityType,Level)
	VALUES	('UNIT_ALIEN_WOLF_BEETLE_HARMONY','AFFINITY_TYPE_HARMONY',2),
			('UNIT_ALIEN_FLYER_HARMONY','AFFINITY_TYPE_HARMONY',3),
			('UNIT_ALIEN_RAPTOR_BUG_HARMONY','AFFINITY_TYPE_HARMONY',5),
			('UNIT_ALIEN_MANTICORE_HARMONY','AFFINITY_TYPE_HARMONY',6),
			('UNIT_ALIEN_SEA_DRAGON_HARMONY','AFFINITY_TYPE_HARMONY',8),
			('UNIT_ALIEN_SIEGE_WORM_HARMONY','AFFINITY_TYPE_HARMONY',10),
			('UNIT_ALIEN_KRAKEN_HARMONY','AFFINITY_TYPE_HARMONY',11);

Attached is my test mod.

EDIT: You indicated you wanted to rename them. You can do that by changing:
Code:
	SELECT 'UNIT_ALIEN_WOLF_BEETLE_HARMONY',Description,Civilopedia,Strategy...
to
Code:
	SELECT 'UNIT_ALIEN_WOLF_BEETLE_HARMONY',[COLOR=RED]'Garm'[/COLOR],Civilopedia,Strategy...
The single quotes are important.
 

Attachments

@Khtugg: As PlymJim underscores (and mentioned in my previous post), did you add the UnitClasses entry?

@PlymJim: You missed the closing slash on the Units Set command, and on </UnitClasses>.
EDIT: And didn't put your Where/Set in an <Update>.
EDIT #2: And will that prevent the Alien player from spawning aliens without the proper affinity level? I'm not sure it will, given the way Aliens.lua works, but I'd have to look at it again to be sure.
EDIT #3: And, assuming the Alien Flyer is one of the units desired, he'll need this:
Code:
<Civilization_UnitClassOverrides>
		<Delete UnitClassType="UNITCLASS_ALIEN_FLYER"/>
</CivilizationUnitClassOverrides>

...And he'll need copies of the Units rather than just updating the class, to get around AlienLifeForm=1 and what that entails, as well as to set appropriate Cost, etc.

Haha yep, I've missed a lot of stuff out, been hella tired of late, trying to get my head around modding with SQL, Lua and apply the concepts to the coding im doing for my own game to allow easy modding. So a bit sleep deprived at the moment :P
 
Haha yep, I've missed a lot of stuff out...
Oh, I wouldn't worry about it. You should see the mess I made with half of my quickie request fulfillments. The people on the Workshop (perhaps rightly) think I'm a moron.
 
Oh, I wouldn't worry about it. You should see the mess I made with half of my quickie request fulfillments. The people on the Workshop (perhaps rightly) think I'm a moron.

Haha sometimes I feel like a child messing with fire. Cant count the amount of nights ive sat hunting through code to find why an ai has randomly done something that i wasnt expecting :)
 
Back
Top Bottom