Having a problem with a special unit not showing in civilopedia

LeeS

Imperator
Joined
Jul 23, 2013
Messages
7,241
Location
Illinois, USA
I've been working on a Knights Templar mod where a new World Wonder will give a special unit every X turns. I want the unit to only be available via my wonder. Everything is working correctly, and the unit functions properly in-game, but nothing shows in the civilopedia for my special unit. The icon shows in the tech tree, and the <Help> tag is being properly displayed when I mouse over the unit icon in the tech tree, just nothing whatsoever appears in the civilopedia. I'm not seeing anything in the logs except "Missing Entry for UNIT_CRUSADER_LEGION" which isn't telling me a whole lot. OK, it probably is telling me everything I need to know, but I can't tell from this what is "missing".

To be more clear: everything in my mod is working correctly except the civilopedia for my Crusader unit.

Is this because of the way I locked-out the unit from being built or puchased by a player?

Is there a better way to accomplish the "lock" for my unit? One that will let my unit show up on the civilopedia?

PS: I'm using a copy of the roman legion unit to act as a "stand-in" for my Crusader unit. I simply copied everything from the units.xml for the Roman Legion, and then altered as I needed to create my Crusader unit.

edit to remove the attachment since I have my question answered
 
Log messages usually need the lines above to make sense, in this case

Code:
[40044.707] Validating UnitGameplay2DScripts
[40044.707] Missing Entry for UNIT_CRUSADER_LEGION

Your new unit doesn't have any sounds (UnitGameplay2DScripts entries) associated with it - it doesn't need any, but if you don't give them you'll get those warnings in xml.log, eg

Code:
<GameData>
  <UnitGameplay2DScripts>
    <Row>
      <UnitType>UNIT_MORINDIM_EARTH_SPIRIT_CLASSICAL</UnitType>
      <SelectionSound>AS2D_SELECT_MUSKETMAN</SelectionSound>
      <FirstSelectionSound>AS2D_BIRTH_MUSKETMAN</FirstSelectionSound>
    </Row>
  </UnitGameplay2DScripts>
</GameData>

As to why the unit is not showing the pedia :confused:
 
Log messages usually need the lines above to make sense, in this case

Code:
[40044.707] Validating UnitGameplay2DScripts
[40044.707] Missing Entry for UNIT_CRUSADER_LEGION

Your new unit doesn't have any sounds (UnitGameplay2DScripts entries) associated with it - it doesn't need any, but if you don't give them you'll get those warnings in xml.log, eg

Code:
<GameData>
  <UnitGameplay2DScripts>
    <Row>
      <UnitType>UNIT_MORINDIM_EARTH_SPIRIT_CLASSICAL</UnitType>
      <SelectionSound>AS2D_SELECT_MUSKETMAN</SelectionSound>
      <FirstSelectionSound>AS2D_BIRTH_MUSKETMAN</FirstSelectionSound>
    </Row>
  </UnitGameplay2DScripts>
</GameData>
I must have overlooked the 2DScripts table. (obviously, since it's not in my code). Probably also why I'm getting the same sounder as you get for the Barbarian Brute when you're playing as Germany and have "converted" a Brute to your side.
As to why the unit is not showing the pedia :confused:
Yeah. So am I. The confused part anyway.
 
Yeah. So am I. The confused part anyway.

It's the cost of -1 that's doing it (which will also cripple the upgrade cost), here how I stop one of my special units being built while giving them a standard cost

Code:
local iUnitRanger = GameInfoTypes.UNIT_RANGER

GameEvents.PlayerCanTrain.Add(function(iPlayer, iUnit) 
  if (iUnit == iUnitRanger) then
	return false;
  end

  return true
end)
 
Back
Top Bottom