Searching for a tag in use (without the closing slash) can provide clues, like with the Caravel unit entry.It means that this unit can explore rival territory without the need for open borders and without causing it to declare war (a caravel, for example).
Thanks Baldyr. Here is the unit info for one of the Civ's, each Civ has a similar ship unit. Below this is the UnitClassInfo as all the Civs units are based off of the FF units. This one being the Invasion Ship. Really hopeing you can help.If you will be waiting a while I - or someone else - would be able to do this for you.
<UnitInfo><!-- Liandra Frigate -->
<Class>UNITCLASS_LIANDRA</Class>
<Type>UNIT_LIANDRA</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_FRIGATE</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_LIANDRA</Description>
<Civilopedia>TXT_KEY_UNIT_LIANDRA_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_LIANDRA_STRATEGY</Strategy>
<Help/>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</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>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>1</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_COUNTER</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_B5_EARLY_SPACE_CRAFT</PrereqTech>
<TechTypes>
<PrereqTech>TECH_B5_LASER_WEAPONS</PrereqTech>
<PrereqTech>TECH_B5_PLASMA_WEAPONS</PrereqTech>
</TechTypes>
<BonusType>NONE</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>150</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>15</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>1</iMoves>
<bNoRevealMap>0</bNoRevealMap>
<iAirRange>0</iAirRange>
<iAirUnitCap>0</iAirUnitCap>
<iDropRange>5</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>10</iCombat>
<iCombatLimit>100</iCombatLimit>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<iInterceptionProbability>5</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>5</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>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_SQUADRON</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_FRIGATE</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_DESTROYER</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_CRUISER</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_CAPITAL_SHIP</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_CARRIER_SHIP</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_STARBASE</UnitCombatType>
<iUnitCombatMod>0</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers>
<BonusProductionModifier>
<BonusType>BONUS_ALUMINIUM</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
<BonusProductionModifier>
<BonusType>BONUS_TITANIUM</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
<BonusProductionModifier>
<BonusType>BONUS_IRON</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
<BonusProductionModifier>
<BonusType>BONUS_OXYGEN</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
<BonusProductionModifier>
<BonusType>BONUS_URANIUM</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
<BonusProductionModifier>
<BonusType>BONUS_HYDROGEN</BonusType>
<iProductonModifier>5</iProductonModifier>
</BonusProductionModifier>
</BonusProductionModifiers>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>SPECIALUNIT_MISSILE</SpecialCargo>
<DomainCargo>DOMAIN_AIR</DomainCargo>
<iCargo>2</iCargo>
<iConscription>7</iConscription>
<iCultureGarrison>16</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>6</iAsset>
<iPower>4</iPower>
<UnitMeshGroups>
<iGroupSize>1</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>1</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_LIANDRA</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<FormationType>FORMATION_TYPE_MACHINE</FormationType>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions>
<FreePromotion>
<PromotionType>PROMOTION_ARMOR_I</PromotionType>
<bFreePromotion>1</bFreePromotion>
</FreePromotion>
</FreePromotions>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
<MovementSound>AS3D_UN_INVASION_SHIP_RUN</MovementSound>
</UnitInfo>
<UnitClassInfo><!-- Liandra Frigate -->
<Type>UNITCLASS_LIANDRA</Type>
<Description>TXT_KEY_UNIT_LIANDRA</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_INVASION_SHIP_II</DefaultUnit>
</UnitClassInfo>
The Python for the Mod is available in Final Frontier if you haven't deleted it. As far as i'm aware we didn't use BUG but i am thinking of merging it with Final Frontier Plus that does use BUG. That won't happen for a while yet though.By the way, is the mod you're mod-modding in turn based on the BUG mod? Because then it requires a somewhat different approach. (Is the Python for the mod available for download somewhere? A link would be helpful.)
You might be thinking about the latest RFC patch. I suspect that was achieved in the SDK, but I don't know for sure. I think I'll actually try to look it up.Correct me if I'm wrong but isn't it true that workboats can't leave national waters in the extremely early stages? Or was this part of a mod that I was using way back... can't remember... perhaps there was some sort of tag in there that could be used for such a purpose.
def unitCannotMoveInto(self,argsList):
ePlayer = argsList[0]
iUnitId = argsList[1]
iPlotX = argsList[2]
iPlotY = argsList[3]
[B] # start Liandra movement restriction
eLiandraClass = gc.getInfoTypeForString("UNITCLASS_LIANDRA")
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitID)
eUnitType = pUnit.getUnitType()
eUnitClass = gc.getUnitInfo(eUnitType).getUnitClassType()
if eUnitClass == eLindraClass:
pPlot = gc.getMap().plot(iPlotX, iPlotY)
return pPlot.getOwner() != ePlayer
# end Liandra movement restriction[/B]
return False
<Define>
<DefineName>USE_UNIT_CANNOT_MOVE_INTO_CALLBACK</DefineName>
<iDefineIntVal>1</iDefineIntVal>
</Define>
# start Liandra movement restriction
eLiandraClass = gc.getInfoTypeForString("UNITCLASS_LIANDRA")
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitI[COLOR="Red"]d[/COLOR])
eUnitType = pUnit.getUnitType()
eUnitClass = gc.getUnitInfo(eUnitType).getUnitClassType()
if eUnitClass == eLindraClass:
pPlot = gc.getMap().plot(iPlotX, iPlotY)
return pPlot.getOwner() != ePlayer
# end Liandra movement restriction
Don't worry if you did, i'll let you knowHopefully I didn't mess anything else up.
I used the unit class instead of unit type, so the restriction extends to UNIT_LIANDRA and any other unit types derived from UNITCLASS_LIANDRA. These lines achieve this:Further to this, the unit i gave you as an example was a unique unit for one of the civs, nearly all the units are UU for the B5 mod. If i wanted to do the same restriction for the other civs would i need to add the same entry over and over but just change the UNITCLASS_LIANDRA to UNITCLASS_?????????? (enter ship class) or could i just add the units class and extend the entries on the original file entry?
[B]eLiandraClass[/B] = gc.getInfoTypeForString("[B]UNITCLASS_LIANDRA[/B]")
...
if eUnitClass == [B]eLindraClass[/B]:
# start movement restriction
tRestrictedUnitClasses = (
gc.getInfoTypeForString("UNITCLASS_LIANDRA"),
gc.getInfoTypeForString("UNITCLASS_[B]SAMPLE[/B]"),
)
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitId)
eUnitType = pUnit.getUnitType()
eUnitClass = gc.getUnitInfo(eUnitType).getUnitClassType()
if eUnitClass in tRestrictedUnitClasses:
pPlot = gc.getMap().plot(iPlotX, iPlotY)
return pPlot.getOwner() != ePlayer
# end movement restriction
That's perfect, exactly what i needed, thanks Baldyr, i'll get to work on making the additions i need.Or do you need to extend this restriction to other classes? Then you can replace the Liandra restriction with this:
Code:
# start movement restriction
tRestrictedUnitClasses = (
gc.getInfoTypeForString("UNITCLASS_LIANDRA"),
gc.getInfoTypeForString("UNITCLASS_SAMPLE"),
)
pUnit = gc.getPlayer(ePlayer).getUnit(iUnitId)
eUnitType = pUnit.getUnitType()
eUnitClass = gc.getUnitInfo(eUnitType).getUnitClassType()
if eUnitClass in tRestrictedUnitClasses:
pPlot = gc.getMap().plot(iPlotX, iPlotY)
return pPlot.getOwner() != ePlayer
# end movement restrictionChange the word SAMPLE to some other valid unit class name. And you can simply add as many classes as you wish by adding lines to the array. Just don't forget to end each line with a comma.