Making impassible terrain passable

AW Arcaeca

Deus Vult
Joined
Mar 10, 2013
Messages
3,019
Location
Operation Padlock ground zero
For the UU of the Inuit civ I'm making, I've been considering giving it the ability to walk on ice.
...Not terribly useful, but it'll do. :lol:

So I gave the unit a free new promotion that goes something like this:
Code:
	<UnitPromotions_Features>
		<Row>
			<PromotionType>PROMOTION_ICEWALKERS</PromotionType>
			<FeatureType>FEATURE_ICE</FeatureType>
			<PassableTech>TECH_AGRICULTURE</PassableTech>
		</Row>
	</UnitPromotions_Features>
And the promotion shows up, so the xml must work fine - but the unit can't walk on ice.

So any ideas? I'm guessing this will require more than just xml, so I'm bracing myself for the worst: lua. But even then can it be done, or is impassibility hard-coded in the DLL?
 
Well ice only occurs on sea tiles, so you would probably have to make those passable as well, although that leads to the problem of being able to walk on ice-free ocean tiles...

In civ 4 at least, units are confined to their domains (i.e., land, water, air), so you may have to consider that as well.
 
Dang, I didn't think of that. :crazyeye: Somehow....

So it will most definitely require lua then... any ideas as to how?
 
I am curious what happen when you add the Submarine's promotion to them. Will they embark when enter the snow; can pass snow after embark; or nothing happens.
 
We already have a couple of promotions that make features impassable:

Spoiler :

<UnitPromotions_Features>
<Row>
<PromotionType>PROMOTION_FOLIAGE_IMPASSABLE</PromotionType>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<Impassable>true</Impassable>
</Row>
<Row>
<PromotionType>PROMOTION_FOLIAGE_IMPASSABLE</PromotionType>
<FeatureType>FEATURE_FOREST</FeatureType>
<Impassable>true</Impassable>
</Row>
</UnitPromotions_Features>


Would it be possible to reverse this for your icewalkers promotion, i.e. by having a <Impassable>false</Impassable> in there?
 
You might be able to hack something in Lua, but it would be extremely ugly. However, whoward69's DLL provides exactly what you need.
Ugly? How so? And if possible, I'm looking to avoid getting into DLL modding.
Problem is, civilian units can't have promotions, so your settlers would be able to walk on ice too. Unless there's something I'm not aware of...
It's not a settler though. Actually, it's not a civilian unit at all.
We already have a couple of promotions that make features impassable:

Spoiler :

<UnitPromotions_Features>
<Row>
<PromotionType>PROMOTION_FOLIAGE_IMPASSABLE</PromotionType>
<FeatureType>FEATURE_JUNGLE</FeatureType>
<Impassable>true</Impassable>
</Row>
<Row>
<PromotionType>PROMOTION_FOLIAGE_IMPASSABLE</PromotionType>
<FeatureType>FEATURE_FOREST</FeatureType>
<Impassable>true</Impassable>
</Row>
</UnitPromotions_Features>


Would it be possible to reverse this for your icewalkers promotion, i.e. by having a <Impassable>false</Impassable> in there?
Don't know, haven't tried it... I do, however, doubt that will work, as <Impassable> defaults to false anyway. I guess it's worth a shot, though.
 
Ugly? How so? And if possible, I'm looking to avoid getting into DLL modding.
Ugly as in extremely difficult. Even if you could get the unit to cross into another domain without embarking, do you really want to deal with pathfinding? Ugh.

Using whoward69's DLL wouldn't be actual DLL modding; he's already done the work for you. The problem, of course, is that a user can only use one DLL at a time, though whoward69's is the most popular.

Your mod would require his DLL, and then you'd implement something like the Arctic Corp promotion from this mod.

For an Inuit civ, though, I'd recommend it be a UA (or part of it, anyway), and apply to all [land] units [and maybe give the Ice Breaker promotion from the above mod to your sea units].
 
...So basically what I getting here is that doing this is nigh impossible without having to deal with DLL?
Dang...

Well, does anyone have any other unit ability ideas?
And the main problem sounds like getting units to be able to move into terrain of another domain, but what about mountains? They're also part of the land domain, so shouldn't it be relatively simple to make mountains passable to land units?
 
Your mod would require his DLL, and then you'd implement something like the Arctic Corp promotion from this mod.

For an Inuit civ, though, I'd recommend it be a UA (or part of it, anyway), and apply to all [land] units [and maybe give the Ice Breaker promotion from the above mod to your sea units].

There is already a trait coded into the terrain mods - it's just not used by any of my micro-mods

Code:
    <!-- Permits land units to cross ice, this is the trait version (ie applies to all units of the civ) of PROMOTIONS_CROSS_ICE -->
    <Row Class="2" Name="TRAITS_CROSSES_ICE" Value="0"/>
 
Ugly as in extremely difficult. Even if you could get the unit to cross into another domain without embarking, ...

You can't. It's the reverse of putting ships onto land, while you can do it with Lua, at the end of the turn the DLL checks that all units are in the correct domain (or embarked in the case of land units) and if not does a "jump to nearest valid plot"
 
I've had an idea and forgive me if this is impossible, it's just a thought from someone who can't program lua or the DLL !!

Could we possible create a new domain type which includes land and ice? I'm presuming that somewhere DOMAIN_LAND has been defined as including grasslands+plains+mountains et al. If it were possible, we could then give the unit DOMAIN_LANDPLUSICE as it's..er..domain.

Be gentle with me if it's a no-goer ;).
 
There is no definition of a domain being X+Y+Z types. Plot types (ocean, land, hills, mountains) have a single domain type and units have a single domain restriction. DOMAIN_AIR and DOMAIN_HOVER are hard-coded as special cases within the C++ code
 
There is already a trait coded into the terrain mods - it's just not used by any of my micro-mods

Code:
    <!-- Permits land units to cross ice, this is the trait version (ie applies to all units of the civ) of PROMOTIONS_CROSS_ICE -->
    <Row Class="2" Name="TRAITS_CROSSES_ICE" Value="0"/>
Interesting... so do you think it would be possible to take the methods used in this trait and apply them to my own trait, then use lua to remove the promotion (PROMOTION_CROSSES_ICE) from all units except the UU?
Or maybe just use the promotion without the trait?
 
Oh... I just realized what whoward69 was saying: not that the promotion is found in the base xml file but are part of his mods. Unfortunately, it seems this particular mod has a DLL prerequisite.

Which is exactly what I'm trying to avoid: I don't want to mod DLL or include it, since the game can only use 1 DLL mod at a time, and I would rather not have my new civ incompatible with other people's mods. (Except with other Inuit mods, but I'm hoping that most people have enough common sense to not enable two mods of the same civ at once.)

So I guess then crossing ice isn't a unit ability I can use then... :(
 
Back
Top Bottom