Help improve the expansion pack!

Two minor (and non-essential) tweaks

Code:
function ResetCsFriendships(iPlayer)
[COLOR="Red"]  -- Only need to reset for major civs
  if (iPlayer < GameDefines.MAX_MAJOR_CIVS) then[/COLOR]
[COLOR="Magenta"]    -- No need to check the Barbarians, so -2[/COLOR]
    for iCs = GameDefines.MAX_MAJOR_CIVS, [COLOR="magenta"]GameDefines.MAX_CIV_PLAYERS-2[/COLOR], 1 do
      local pCs = Players[iCs]

      if (pCs:IsEverAlive()) then
        pCs:ChangeMinorCivFriendshipWithMajor(iPlayer, -1 * pCs:GetMinorCivFriendshipWithMajor(iPlayer))
      end
    end
[COLOR="red"]  end[/COLOR]
end
 
"Liberated cities return to their pre-capture status (puppet, occupied, or normal)."

This is non-trivial.

Easy for Civ A captures city X which is then captured by Civ B and then re-captured by Civ A, but not so easy for A then B then C then A

And even more complex if one of the civ's was a City State capturing a non-original, but current capital if the original capital is liberated in the interim

I was going to give it a try, but I shall pass having thought on it some more (basically you need to store the restore state for every city for every player - quite a lot of data)
 
"Find a way to show double unit prerequisites in the civilopedia. "

What does that mean?

I'm assuming it's something on the Units entry, but I could be wrong.

What type of pre-reqs? Techs? Resources?

An example of the <Unit> entry would (could) help.
 
I was going to give it a try, but I shall pass having thought on it some more (basically you need to store the restore state for every city for every player - quite a lot of data)

Right, that's why I've put it off too. :lol:

The multiple unit prerequisites is just a matter of scanning and displaying the information in the Unit_TechTypes table, used in vem/armies/vea_units.xml. It's a table form of the PrereqTech field in the Units table.

I'll update the todo list... some of those entries are a year old, from when I knew less about how things work.
 
The multiple unit prerequisites is just a matter of scanning and displaying the information in the Unit_TechTypes table, used in vem/armies/vea_units.xml. It's a table form of the PrereqTech field in the Units table.

In CivilopediaScreen.lua, around line 2770

Code:
-- update the prereq techs
g_PrereqTechManager:ResetInstances();
buttonAdded = 0;

[COLOR="Red"]if thisUnit.PrereqTech then
  local prereq = GameInfo.Technologies[thisUnit.PrereqTech];
  if prereq then[/COLOR]
    local thisPrereqInstance = g_PrereqTechManager:GetInstance();
    if thisPrereqInstance then
      local textureOffset, textureSheet = IconLookup( prereq.PortraitIndex, buttonSize, prereq.IconAtlas );        
      if textureOffset == nil then
        textureSheet = defaultErrorTextureSheet;
        textureOffset = nullOffset;
      end        
      UpdateSmallButton( buttonAdded, thisPrereqInstance.PrereqTechImage, thisPrereqInstance.PrereqTechButton, textureSheet, textureOffset, CategoryTech, Locale.ConvertTextKey( prereq.Description ), prereq.ID );
      buttonAdded = buttonAdded + 1;
    end  
[COLOR="red"]  end
end  [/COLOR]
UpdateButtonFrame( buttonAdded, Controls.PrereqTechInnerFrame, Controls.PrereqTechFrame );

-- update the obsolete techs

change the red lines to iterate "prereq" over the zero or more pre-req techs for the unit.

As you know the tables/relationships it'll be quicker for you to work that out than me!
 
Thanks for finding it! Copying that and replacing the first two lines in the copy with this worked:
PHP:
for info in GameInfo.Unit_TechTypes(string.format("UnitType = '%s'", thisUnit.Type)) do
	local prereq = GameInfo.Technologies[info.TechType];
 
Conquistadors don't die after founding a city.
It takes a little time for the UI to catch up, but they certainly do die after founding a city.
 
It's only visual in that the unit flag is left above the city (and possibly the unit name is left in the drop down units list if that was visible at the time) until the next user event (mouse click, etc)

It's an artifact of how an event driven system works - no event, no change - and as I've discovered with the Trade Opportunities mod, it's almost impossible to circumvent.
 
That's one way to read it I suppose - me thinks some clarification is needed from the Power That Be ;-)
 
This should clarify it:
  • Add new unit missions:
    • Conquistador "Found City" mission that does not kill the unit.
    • Great Artist mission gives culture to the nearest city.
 
The icon doesn't match the modified effect:

attachment.php


An ideal icon would be a hammer which fits the other Order tree policies (I put populism in with communism, socialism, etc). I tried matching good icons to each modified policy effect, but just couldn't figure out a way to get this one to work. It's the old crossed-swords nationalism icon (represented a combat bonus).

If you're interested in creating policy icons, there's a few more which could use a custom icon. Populism just stands out most as mismatched between effect and icon. :)
 

Attachments

  • Populism.JPG
    Populism.JPG
    34.1 KB · Views: 362
Back
Top Bottom