FeaturePassableTechs not working

Nuts. You are correct. I made the change so that all units have FeatureImpassables, no unit has FeaturePassableTechs (yet), and my python explicitly spawns a warrior. All of the AI warriors come up with UNITAI_ATTACK where they used to come up with UNITAI_EXPLORE, and then they just sit in their cities. So, this approach cannot be used for my original goal, preventing movement into fallout except for rare cases.

Is there any other approach people can suggest, outside of creating a custom dll?
 
Do you mean resetting the AI type with pUnit.setUnitAIType? That is an interesting suggestion. I tried it out; after I create the initial unit, I set its AI to explore. I am pleasantly surprised that this seems to work. The warriors set out to explore. However, the code found by Dresden means that no unit will ever become an explorer, unless I specifically make it one. During the course of the game, I don't want to keep looking over the shoulder of the AI and deciding which of the units it's building should be explorers.

Any other directions I can try?
 
You shouldn't be intimidated by the SDK if you have any reasonable coding experience. I found it surprisingly easy to setup under Visual Studio Express 2005 using a combination of Chazcon's instructions and smacfan's makefile (which I had to slightly update for BTS 3.17.)

Anyhow, regarding non-DLL methods of working around this, how critical is it for all units to stay out of the fallout? Could you have a scout-type unit good solely for exploring that is still able to enter fallout? Perhaps with a turn-ending event that checks for explorers in fallout and drops their health if they've stopped there?

If that doesn't do, here's another off-the-wall workaround suggestion. Have two versions of a scout/explorer unit. One which can be built but has no impassable flags set, and a second which can't be built but has the proper xml flags. Then hook the onUnitBuilt event to check for the first being created and replace it with the other version, copying over the AIType and any other necessary data. That way the AI would have a viable explorer unit to build and you could "patch" it to the proper unit flags before it has a chance to actually go out in the field.
 
Interesting line of thought. My original idea is to have a mid game tech make a promotion available, which any unit could take. So initially no player unit could move into fallout; later certain experienced units could. Some of the animals (mutants) can move into fallout anytime, in fact they prefer to spawn there. So it makes a good hiding place, but not a perfect hiding place.

The problem is that any unit *could* be an explorer unit, it depends on what the AI has available. So I would have to make two of every unit. I am already using two of some units to represent running out of gas, and swapping the units when they run out or get refueled. There is a handy pUnit.convert() function which does all the needed copying. So for these units, I'd wind up with four XML entries. That is starting to get a little unwieldy.
 
I know this is an old topic but I had a similar situation where I wanted to create a water unit which could go through ice at a later stage of the game.

Code:
<iEspionagePoints>0</iEspionagePoints>
<TerrainImpassables/>
<FeatureImpassables>
        <FeatureImpassable>
                <FeatureType>FEATURE_ICE</FeatureType>
                <bFeatureImpassable>1</bFeatureImpassable>
        </FeatureImpassable>
</FeatureImpassables>
<TerrainPassableTechs/>
<FeaturePassableTechs>
        <FeaturePassableTech>
                <FeatureType>FEATURE_ICE</FeatureType>
                <PassableTech>TECH_INDUSTRIALISM</PassableTech>
        </FeaturePassableTech>
</FeaturePassableTechs>
<iCombat>0</iCombat>
What I found was that the unit would not go through ice regardless of whether or not I had the Industrialism technology.

However once I changed the bCanMoveImpassable from a 0 to a 1, it worked exactly as intended.

Code:
<bCanMoveImpassable>1</bCanMoveImpassable>
This tag turns on the ability for the vessel to move through all water tiles regardless of feature and the code provided by davidlallen allows me to flag ice as impassable for it. Setting the FeaturePassableTech then allows it again once the requisite technology has been attained.

~Ted
 
Another thing, I noticed you mentioned putting stuff in the my documents/my games folder....

that could be your problem. There are some mystifying and unexplainable things that occur when you put mods in that folder.

I would recommend putting ALL mods into the;
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods
folder, there you will certainly have less problems overall.
 
I know this is an old topic but I had a similar situation where I wanted to create a water unit which could go through ice at a later stage of the game.

Code:
<iEspionagePoints>0</iEspionagePoints>
<TerrainImpassables/>
<FeatureImpassables>
        <FeatureImpassable>
                <FeatureType>FEATURE_ICE</FeatureType>
                <bFeatureImpassable>1</bFeatureImpassable>
        </FeatureImpassable>
</FeatureImpassables>
<TerrainPassableTechs/>
<FeaturePassableTechs>
        <FeaturePassableTech>
                <FeatureType>FEATURE_ICE</FeatureType>
                <PassableTech>TECH_INDUSTRIALISM</PassableTech>
        </FeaturePassableTech>
</FeaturePassableTechs>
<iCombat>0</iCombat>
What I found was that the unit would not go through ice regardless of whether or not I had the Industrialism technology.

However once I changed the bCanMoveImpassable from a 0 to a 1, it worked exactly as intended.

Code:
<bCanMoveImpassable>1</bCanMoveImpassable>
This tag turns on the ability for the vessel to move through all water tiles regardless of feature and the code provided by davidlallen allows me to flag ice as impassable for it. Setting the FeaturePassableTech then allows it again once the requisite technology has been attained.

~Ted

That is because FEATURE_ICE itself is set to be impassable in the CIV4FeatureInfos.xml file with the bImpassable flag and ONLY the bCanMoveImpassable will override this.

FeaturePassableTech will only work to counter a bFeatureImpassable flag set for the same unit in CIV4UnitInfos.xml
 
Back
Top Bottom