Help with unit mod please

kingchris20

Wisdom Seeker
Joined
Jul 30, 2012
Messages
1,343
Location
Resident of Heaven; Currently in the Waiting Room
I am trying to add a merchant ship to the game, but other computer-controlled civs dont know how to use them, they build them fine, but cannot use them....

They are used in much the same way as the Great Merchant, but since they are a ship, they can only be used on coastal city states.

I wanted to make them to where they provided less influence than Great Merchants but I couldn't figure out how to change that for just this unit, anytime I tried it changed it for both the Merchant ship and the Great Merchant :/

Spoiler :
<GameData>
<UnitClasses>
<Row>
<Type>UNITCLASS_MERCHANTSHIP</Type>
<Description>TXT_KEY_UNIT_MERCHANTSHIP</Description>
<DefaultUnit>UNIT_MERCHANTSHIP</DefaultUnit>
</Row>
</UnitClasses>
<Units>
<Row>
<Class>UNITCLASS_MERCHANTSHIP</Class>
<Type>UNIT_MERCHANTSHIP</Type>
<PrereqTech>TECH_SAILING</PrereqTech>
<Cost>50</Cost>
<Moves>4</Moves>
<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_HIGH</CivilianAttackPriority>
<Special>SPECIALUNIT_PEOPLE</Special>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_MERCHANT</DefaultUnitAI>
<Description>TXT_KEY_UNIT_MERCHANTSHIP</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_MERCHANTSHIP</Civilopedia>
<Strategy>TXT_KEY_UNIT_MERCHANTSHIP_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_MERCHANTSHIP</Help>
<Capture>UNITCLASS_MERCHANTSHIP</Capture>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<CaptureWhileEmbarked>true</CaptureWhileEmbarked>
<Mechanized>true</Mechanized>
<AdvancedStartCost>10</AdvancedStartCost>
<WorkRate>1</WorkRate>
<CombatLimit>0</CombatLimit>
<XPValueDefense>3</XPValueDefense>
<BaseGold>100</BaseGold>
<NumGoldPerEra>50</NumGoldPerEra>
<UnitArtInfoEraVariation>true</UnitArtInfoEraVariation>
<UnitArtInfo>ART_DEF_UNIT_GREAT_ADMIRAL</UnitArtInfo>
<UnitFlagIconOffset>92</UnitFlagIconOffset>
<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>15</PortraitIndex>
<MoveRate>WOODEN_BOAT</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_MERCHANT</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_EXPLORE_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_WORKER_SEA</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<PromotionType>PROMOTION_OCEAN_IMPASSABLE_UNTIL_ASTRONOMY</PromotionType>
</Row>
</Unit_FreePromotions>
<Unit_Flavors>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_GOLD</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>6</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
<Flavor>2</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_DIPLOMACY</FlavorType>
<Flavor>75</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_GROWTH</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_HAPPINESS</FlavorType>
<Flavor>5</Flavor>
</Row>
</Unit_Flavors>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_MERCHANTSHIP">
<Text>Merchant Ship</Text>
</Row>
</Language_en_US>
</GameData>


Ideally, the text for the "Conduct Trade Mission" button would also reflect that it is a Merchant Ship instead of a Great Merchant, but for now I can't figure out a way to change that for just the Merchant Ship either.......

Anybody know how to do this? The priority right now is getting AI civs to use them properly (that is actually conduct the trade mission), because right now, they produce them, but then just sail around with them aimlessly....

After that, I would want to figure out the influence change and the text change...
 
Why do you have the extra entries in Unit_AITypes? I think there should only be UNITAI_MERCHANT there (but I can't guarantee that the AI will use them properly if you do so).
 
^ That should fix the problem.

And high holy hell, overpowered unit???? That should be at like...Compass or something, and it should cost a lot more hammers (250? 300?)
 
Oh yeah, I started out with just the UNITAI_MERCHANT, but in the course of trying to get the Com-Civs to use them, I added every naval AI I could........ which still didnt work........same with the UNIT_FLAVORS, which should probably only be FLAVOR_GOLD with a flavor of 1 (like the Great Merchant is)

And for the Sailing, I have a civ that gets free sailing, so having it that easy to obtain, is merely for testing purposes.....Ideally, the unit would get 100 gold and 5 influence for each trade mission, but I have a problem with setting the "MINOR_FRIENDSHIP_FROM_TRADE_MISSION" (GlobalDefines.xml), I can update it to be 5, but if I do that, even the Great Merchant drops to 5 influence for trade missions, and I dont know how to set that for Merchant Ship only.......................I also wanted it to give up its weight in gold to the captor, but I think the only option is for units to get gold from kills instead of giving gold for being killed..........

those were the ideas for making it not overpowered, but it seems impossible...

I am wondering if the AI just doens't know how to use it because units with UNITAI_MERCHANT are only gained through "Great People" points, instead of built?
 
I am wondering if the AI just doens't know how to use it because units with UNITAI_MERCHANT are only gained through "Great People" points, instead of built?

If the AI was hardcoded like that, I would shoot myself.

No, they should be fine if you set them to just be a merchant. They'll seek out city-states - but since the movement is restricted to sea they won't only travel to land.

They shouldn't try to settle them because you don't have a unit build associated with them...so they'll move out.

Don't set them to naval explore because then they may do just that...likewise with naval combat and stuffs. Just let them be merchants, they'll treat them like a Great Merchant who is embarked.

Also if you want to test a unit the best method is FireTuner. That way you can set its normal attributes but plop as many as you need, without having to build them.

May I also suggest having the merchant ships give a lower amount of gold (25-ish? remember it goes up a lot per era) but the 30 influence remains static, so "trading" with the city-states is a diplomatic thing rather than an economic thing.

Also give them a HurryCostModifier of -1 so you can't rush buy them.
 
Just as a note: I am making the Merchant Ship available to all civs (not a unique unit)............I do like the idea of a small amount of gold, 30 influence, and -1 hurrycostmodifier,

But how in the world do you use FireTuner to test new units? That would make this a much much easier process!
 
no matter what I do, the AI civs will build them, but they just go back and forth between hexes..........I think becasue UNITAI_MERCHANT is coded the way it is, naval units confuse the AI civs and they just dont know what to do with it. Maybe if there was a UNTIAI_NAVALMERCHANT it would work, but idk --------------- this is what I have now

Spoiler :
<GameData>
<UnitClasses>
<Row>
<Type>UNITCLASS_MERCHANTSHIP</Type>
<Description>TXT_KEY_UNIT_MERCHANTSHIP</Description>
<DefaultUnit>UNIT_MERCHANTSHIP</DefaultUnit>
</Row>
</UnitClasses>
<Units>
<Row>
<Class>UNITCLASS_MERCHANTSHIP</Class>
<Type>UNIT_MERCHANTSHIP</Type>
<PrereqTech>TECH_SAILING</PrereqTech>
<Cost>50</Cost>
<Moves>4</Moves>
<CivilianAttackPriority>CIVILIAN_ATTACK_PRIORITY_HIGH</CivilianAttackPriority>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_MERCHANT</DefaultUnitAI>
<Description>TXT_KEY_UNIT_MERCHANTSHIP</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_MERCHANTSHIP</Civilopedia>
<Strategy>TXT_KEY_UNIT_MERCHANTSHIP_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_MERCHANTSHIP</Help>
<Capture>UNITCLASS_MERCHANTSHIP</Capture>
<CaptureWhileEmbarked>true</CaptureWhileEmbarked>
<AdvancedStartCost>-1</AdvancedStartCost>
<WorkRate>1</WorkRate>
<CombatLimit>0</CombatLimit>
<XPValueDefense>3</XPValueDefense>
<BaseGold>50</BaseGold>
<NumGoldPerEra>50</NumGoldPerEra>
<UnitArtInfoEraVariation>true</UnitArtInfoEraVariation>
<UnitArtInfo>ART_DEF_UNIT_GREAT_ADMIRAL</UnitArtInfo>
<UnitFlagIconOffset>92</UnitFlagIconOffset>
<IconAtlas>EXPANSION_UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>15</PortraitIndex>
<MoveRate>WOODEN_BOAT</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<UnitAIType>UNITAI_MERCHANT</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<PromotionType>PROMOTION_OCEAN_IMPASSABLE_UNTIL_ASTRONOMY</PromotionType>
</Row>
</Unit_FreePromotions>
<Unit_Flavors>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_GOLD</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>6</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
<Flavor>2</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_DIPLOMACY</FlavorType>
<Flavor>75</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_GROWTH</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<UnitType>UNIT_MERCHANTSHIP</UnitType>
<FlavorType>FLAVOR_HAPPINESS</FlavorType>
<Flavor>5</Flavor>
</Row>
</Unit_Flavors>
<Language_en_US>
<Row Tag="TXT_KEY_UNIT_MERCHANTSHIP">
<Text>Merchant Ship</Text>
</Row>
</Language_en_US>
</GameData>
 
Back
Top Bottom