How do you not award Embarkation on researching Optics?

trystero49

Prince
Joined
Apr 30, 2012
Messages
515
I'm looking for a way to implement Ice Walk, and one of the problems I have is that it is totally incompatible with Embarkation. Because I'm only implementing Ice Walk for one unit, I was thinking that I could get around this by not allowing Embarkation. Unfortunately, when Embarkation is awarded, Ice Walk no longer works, and neither does Embarkation! Instead, you can only embark in ice tiles.

I was wondering if there was a way to not awarding Embarkation to this one specific unit. I was going to try to implement a newly defined UnitCombatClass and then set this special unit as a different UnitCombatClass. This could work because I could set Ice Walk to be awarded only to that specific UnitCombatClass, and then not set Embarkation to award to that UnitCombatClass. The problem here is that I don't know how to make a new UnitCombatClass (or even if I CAN), and even if I did, wouldn't I effect the ability for this unit to do battle in strange mysterious ways?

Thanks
 
You can set AllowsEmbarking to 0 in and update tag for that tech that allows it, that will disable it, unless you add it to a different technology. Also may want to change EmbarkedMoveChange to 0 for the tech that change this, just to prevent any misshaps :)
 
The problem with that is that would remove embarking for all units. I wanted to remove it for just one unit.

I've actually solved this problem since I started the thread. I just made a new CombatUnitType that doesn't get the embarkation upgrade. Thanks for your response, though.
 
Your new UnitCombatType doesn't cause any problems in other game aspects?

I'm curious because I wanted to do exactly the same thing for a unit...
 
Your new UnitCombatType doesn't cause any problems in other game aspects?

I'm curious because I wanted to do exactly the same thing for a unit...

I'm sure a lot of work goes into making a new unit combat because you have to include promotions that the unit is eligible to obtain.
 
I actually wanted to do this for a new Civilian unit.

The problem is that I can't find any info on how Civilian units obtain the Embarkation promotion in the first place.
It seems the promotion is given to CombatClasses:

Spoiler :
<UnitPromotions_UnitCombats>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_ARMOR</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_HELICOPTER</UnitCombatType>
</Row>


Since workers, great people and so on don't actually have a CombatClass, I have no idea how they get the promotion. Or how to deny the promotion for a unit...
 
I actually wanted to do this for a new Civilian unit.

The problem is that I can't find any info on how Civilian units obtain the Embarkation promotion in the first place.
It seems the promotion is given to CombatClasses:

Spoiler :
<UnitPromotions_UnitCombats>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_ARMOR</UnitCombatType>
</Row>
<Row>
<PromotionType>PROMOTION_EMBARKATION</PromotionType>
<UnitCombatType>UNITCOMBAT_HELICOPTER</UnitCombatType>
</Row>


Since workers, great people and so on don't actually have a CombatClass, I have no idea how they get the promotion. Or how to deny the promotion for a unit...

Don't underestimate the power of hardcoding. I wouldn't be surprised if embarkation is specifically given to those units.
 
Your new UnitCombatType doesn't cause any problems in other game aspects?

I'm curious because I wanted to do exactly the same thing for a unit...

The new unit type doesn't cause any other problems, except that there is no unit that gets bonuses against it (e.g. bonus vs. mounted) and I had to add code adding all the promotions that are available to my new combatclass. It doesn't take that much work, surprisingly. My unit is a military unit, though, so I don't know about that awarding embarkation to civilian units.
 
Thanks for the info, I'll keep trying.

I want my Witch for the Supernatural Beliefs mod to float on water, dammit! :D
 
Have you checked how the unit of your new combat class behaves in combat? Last time I checked, combat animations weren't played, and the unit icons disappeared after the fight.
 
Thanks for the info, I'll keep trying.

I want my Witch for the Supernatural Beliefs mod to float on water, dammit! :D

Floating on water? If you want to make a unit that can "float" on water, you should try giving it a promotion where <CanMoveAllTerrain> is "true", and then set <impassable> to true for all terrain and features you don't want it to move on, using <promotions_features> or whatever the table is called (I don't remember). It works like a charm, except on mountain terrain.
 
I tried that, but there is several problems:

- Embarkation breaks the whole thing. Even with "MoveAllTerrain" the unit gains the Embark promotion and then just keeps embarking when moving on water tiles.

- Mountains don't count as "terrain", so you can't make them impassable after granting "MoveAllTerrain", the unit will always walk over mountains.

I tried making the unit DOMAIN_SEA and then granting MoveAllTerrain with exclusion of ocean and mountains. Ocean works fine, but no matter what I do the unit will climb those mountains happily...

No clue if there is a workaround...
 
Yeah, I`m having a big problem with the mountain terrain. How come it doesn`t count as terrain? It's listed as terrain in the game XMLs...

Also, embarkation does break the whole thing. That's why I started the thread. When you said "float on water", I assumed you wanted a unit that could walk on water as though it were land. To get around the embark effect, just make a new CombatClass and then don't list embarkation as a promotion that the new CombatClass can great. Pros: Get around problem. Cons: Unit can never ever embark.
 
I don't know why Mountains are listed under terrain.

I think mountains and hills don't count as terrain, because both can exist on grassland, desert, tundra, ...

They are kind of a special case. In the improvements xml you also find things like <TerrainHillsYieldChange> (or something similar).

They are somewhat an addition to the terrains. Somehow. ;P
 
That's really bizarre. Is there some kind of way to stop mountainwalk with Lua? I know literally no lua, so I'm kind of helpless there.

That's really bizarre about hills and mountains. They aren't terrains, but they aren't listed as features...
 
I checked the new unitcombatclass in regular view, and it's true that the unit you attack disappears after combat, and now animation plays. Is there a way I can add animations to a new combat class? Many of the forum posts only deal with adding animations to a new unit.
 
Back
Top Bottom