• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

[BNW] Help with a UU- settler replacement

Silvermyr

Chieftain
Joined
May 15, 2019
Messages
22
So I have been trying to make a mod that adds Applejack from My Little Pony as a playable civilization (Called the Apple Combine), and I want one of her unique units to be a special settler that can move three hexes and ignore terrain costs. I call this unit the "Trailblazer".

When I start up my game I do create a civ with the correct colour, music, ability and so on, but this unit does not seem to exist. It does not spawn as the starting settler, nor is it present in the civilopedia or anywhere else I can find.

Some pointers would be welcome.
 

Attachments

  1. This is incorrect methodology for making a unit a settler replacement
    Code:
    	-<UnitClasses>
    		-<Row>
    			<Type>UNITCLASS_TRAILBLAZER</Type>
    			<Description>TXT_KEY_UNIT_TRAILBLAZER</Description>
    			<DefaultUnit>UNIT_TRAILBLAZER</DefaultUnit>
    		</Row>
    	</UnitClasses>
    	-<Units>
    		-<Row>
    			<Class>UNITCLASS_TRAILBLAZER</Class>
    			<Type>UNIT_TRAILBLAZER</Type>
    		......................
    
    	<Civilization_UnitClassOverrides>
    		<Row>
    			<CivilizationType>CIVILIZATION_APP</CivilizationType>
    			<UnitClassType>UNITCLASS_TRAILBLAZER</UnitClassType>
    			<UnitType>UNIT_TRAILBLAZER</UnitType>
    		</Row>
    	</Civilization_UnitClassOverrides>
    The proper method would be
    Code:
    	-<Units>
    		-<Row>
    			<Class>UNITCLASS_SETTLER</Class>
    			<Type>UNIT_TRAILBLAZER</Type>
    		......................
    
    	<Civilization_UnitClassOverrides>
    		<Row>
    			<CivilizationType>CIVILIZATION_APP</CivilizationType>
    			<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
    			<UnitType>UNIT_TRAILBLAZER</UnitType>
    		</Row>
    	</Civilization_UnitClassOverrides>
  2. You have never given the unit an in-game name, and therefore cause multiple problems which the game's UI cannot overcome:
    Code:
    	-<Units>
    		-<Row>
    			<Class>UNITCLASS_TRAILBLAZER</Class>
    			<Type>UNIT_TRAILBLAZER</Type>
    			<Moves>3</Moves>
    			<Capture>UNITCLASS_WORKER</Capture>
    			<HurryCostModifier>20</HurryCostModifier>
    			<Domain>DOMAIN_LAND</Domain>
    			<DefaultUnitAI>UNITAI_SETTLE</DefaultUnitAI>
    			<Civilopedia>TXT_KEY_CIV_UNITS_TRAILBLAZER_TEXT</Civilopedia>
    			<Strategy>TXT_KEY_UNIT_TRAILBLAZER_STRATEGY</Strategy>
    			<Help>TXT_KEY_UNITS_TRAILBLAZER_HELP</Help>
    			<Food>true</Food>
    			<Found>true</Found>
    			<CombatLimit>0</CombatLimit>
    			<UnitArtInfo>ART_DEF_UNIT_SETTLER</UnitArtInfo>
    			<UnitArtInfoCulturalVariation>true</UnitArtInfoCulturalVariation>
    			<UnitFlagAtlas>CIV_ALPHA_ATLAS_APPLEJACK</UnitFlagAtlas>
    			<UnitFlagIconOffset>5</UnitFlagIconOffset>
    			<PortraitIndex>2</PortraitIndex>
    			<IconAtlas>CIV_COLOR_ATLAS_APPLEJACK</IconAtlas>
    		</Row>
    	</Units>
    
    	<Language_en_US>
    		<Row Tag="TXT_KEY_UNIT_FASHIONDEFENDER">
    			<Text>Trailblazer</Text>
    		</Row>
    		<Row Tag="TXT_KEY_UNITS_FASHIONDEFENDER_HELP">
    			<Text>TOBEWRITTEN</Text>
    		</Row>
    		<Row Tag="TXT_KEY_CIV_UNITS_FASHIONDEFENDER_TEXT">
    			<Text>TOBEWRITTEN</Text>
    		</Row>
    		<Row Tag="TXT_KEY_UNIT_FASHIONDEFENDER_STRATEGY">
    			<Text>TOBEWRITTEN</Text>
    		</Row>
    	</Language_en_US>
    • TXT_KEY_CIV_UNITS_TRAILBLAZER_TEXT, TXT_KEY_UNIT_TRAILBLAZER_STRATEGY, and TXT_KEY_UNITS_TRAILBLAZER_HELP do not match to anything here:
      Code:
      	<Language_en_US>
      		<Row Tag="TXT_KEY_UNIT_FASHIONDEFENDER">
      			<Text>Trailblazer</Text>
      		</Row>
      		<Row Tag="TXT_KEY_UNITS_FASHIONDEFENDER_HELP">
      			<Text>TOBEWRITTEN</Text>
      		</Row>
      		<Row Tag="TXT_KEY_CIV_UNITS_FASHIONDEFENDER_TEXT">
      			<Text>TOBEWRITTEN</Text>
      		</Row>
      		<Row Tag="TXT_KEY_UNIT_FASHIONDEFENDER_STRATEGY">
      			<Text>TOBEWRITTEN</Text>
      		</Row>
      	</Language_en_US>
    • You've never given the unit a <Description> reference in table <Units>. This is required, and the missing reference causes the game's UI system to fail
  3. FLAVOR_EXPLORE is not a valid FlavorType
  4. Because you need to be using UNITCLASS_SETTLER to make your unit a replacement for the standard Settler unit, this should be
    Code:
    	-<Civilization_FreeUnits>
    		-<Row>
    			<CivilizationType>CIVILIZATION_APP</CivilizationType>
    			<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
    			<Count>1</Count>
    			<UnitAIType>UNITAI_SETTLE</UnitAIType>
    		</Row>
    	</Civilization_FreeUnits>
  5. TXT_KEY_CITY_NAME_SANTA and TXT_KEY_CITY_NAME_WILDBIRCH have never been defined anywhere in table <Language_en_US>
  6. None of your atlas sheets are structured as 6x1 files. They are structured as 8x8 files.
 
Thank you ever so much. The unit at least shows up in the civilopedia, so it exists now. However, for whatever reason its cost is set to "FREE", and it cannot be built by my civ when I start up the game. It also does not spawn in as the starting unit. A regular settler appears instead. The civ seems to recognize that the Trailblazer exists as a unit though, since I am unable to build normal settlers (which presumably have been replaced). Further help would be appreciated.
 

Attachments

Code:
-<Row>
			<Class>UNITCLASS_TRAILBLAZER</Class>
			<Type>UNIT_TRAILBLAZER</Type>
needs to be UNITCLASS_SETTLER

You need to alter and update to UNITCLASS_SETTLER everywhere in your mod where you've still got UNITCLASS_TRAILBLAZER.
 
Well, that was a silly mistake on my part. Sorry for wasting your time with that. Anyhow, the unit works as intended now and can be built. However, it refuses to show up as a starting unit. I still get a regular settler at the beginning of the game. Do you know of any way to fix that? Perhaps I have made a mistake when designating the start count somehow? I tried to designate specifically what unit I should start with, rather than only designating unit class, but then my civ broke completely.

Again, thank you ever so much for your time.
 

Attachments

Well everything is working fine for me with your latest version of the mod. When I play as the civ I get a Trailblazer at the start of the game.
  • Make sure you have all pieces and parts of previous versions eliminated from the game's Mods folder.
  • Make sure in Modbuddy you've checked the ReloadUnitSystem box on the mod properties page.
 
I have been tinkering a bit with this now, and I wanted to ask if you had any further ideas to try to get the Trailblazers to show up at the beginning of the game rather than normal settlers. I have ensured the ReloadUnitSystem is indeed checked, and I don't think any remnants of previous iterations of this mod left in my files. I tried to download my own version of the mod from above (the one you said you got to work), and it still gave me a regular settler.

Thank you for your time. It means a lot to get this much help for the first time I ask anything on this site.
 

Attachments

Disable each and every other mod you currently have active, inluding CP / Vox Populi if you are using those. Except for IGE if you have it running.

Your mod works just fine for me. I have IGE running but none of the CP / Vox Populi / EUI combos.

If you have not done so, enable error logging (whoward69's enable error logging tutorial)
 
Okay, everything works now. It was the mod "Really Advanced Setup" that somehow does not like new starting units. Thanks for all you help :)
 
So I have tested this for a while now and it works just fine when played as your own civ. However, when I put this as an AI civ, it does not seem to build Trailblazers. Is there a way to solve this issue?
 

Attachments

Not really other than to ensure you've added this as Firaxis does for Settlers
Code:
	<Unit_AITypes>
		<Row>
			<UnitType>UNIT_SETTLER</UnitType>
			<UnitAIType>UNITAI_SETTLE</UnitAIType>
		</Row>
	</Unit_AITypes>
In addition to the unit's inherent DefaultUnitAI of UNITAI_SETTLE.

The Ai are notoriius for not using special abilities of Unique Units. Conquistadors are never used by an AI to make a city, Samauri never make fishing boats, etc.
 
While I doubt it matters, I thought I should mention that when I observe this civ in an AI only game, I have seen it get one Trailblazer unit occasionally (probably from the Tradition policy tree) and it does use that Trailblazer to found a second city. The issue is not that it does not use the unit; it's that the unit is never built in the first place.
 
My memory on this particular subject is vague at best but it might be a case of the Ai behavior being coded to look specifically for whether it can build UNIT_SETTLER when it wants to add a new city, and ignoring any UNIT_SOMETHING that is not the default Settler unit when the AI decides what to build in a city.
 
While it isn't exactly the same issue as yours, I too once experienced a problem of getting my modded civ AI to build a unique building I added for it. The problem ultimately ended up being that I had never defined any flavors for the building, so the AI would always find something else to prioritize. Try adding a high expansion flavor for your unit, like so:
Code:
<Unit_Flavors>
        <Row>
            <UnitType>UNIT_TRAILBLAZER</UnitType>
            <FlavorType>FLAVOR_EXPANSION</FlavorType>
            <Flavor>50</Flavor>
        </Row>
</Unit_Flavors>
It is odd to me that the AI will just ignore building your settler unit even without any flavors, though. It could be just as LeeS said: the AI could simply be looking for the default Settler unit when it decides to try and make a new city.
 
That seems to have worked! Thank you ever so much for your help; I really thought I had backed myself into a corner there.
 
Yes. This will have been the issue.

When the AI decides it needs to build a unit to "Expand", it looks for units with an Expansion flavor: finding none available to it, it defaults to doing something else in that city.

Building Flavors work in a similar manner: when the AI decides a city needs to build something that is good for X, is looks for buildings with Flavor_X. It does not analyze the actual Yield Values or other effects of buildings available to it -- it only looks at the assigned flavors. So, no FLAVOR_CULTURE and the AI will never construct the building regardless of how much culture it can generate even though the AI determines an individual city ought to construct a "Culture" building.

LeaderFlavors affect how often an individual AI player will go for something which is good for Flavor_X, but won't alter the way an AI decides a unit or building is good for "X".

Tbh I never thought to look for flavor settings that might have been missing. Civ6 works differently and I've been primarily modding 6 rather than 5, even though I've still been helping people out with 5 problems.
 
Back
Top Bottom