More Unique Components for Vox Populi

[Extension] 3rd and 4th Unique Components for VP - Official thread 88.10

I had a problem with the Japan Kabuki Theater.
When this building finished, my existing guilds were upgraded, but the specialists that were already assigned to these guilds were lost.

I tested it three times in different cities and this happened every time.
I would for example have a city of 14 population, but can only assign 10 workers to tiles and specialists slots; the 4 pop that were assigned to existing guilds were gone.

I tried:
- restarting the game
- reassigning workers to the new guilds and unassigning them
- resetting the city to let the AI assign all workers
makes sense. If you delete a building via lua that had a citizen working it, you delete the citizen. We’re going to have to create some sort of workaround. The easiest thing might be to either force assign all citizens to tiles, or force assign all citizens in the city as labourers before the guilds are deleted.

Maybe @Infixo can comment? He’s the lord-commander of city management UI

Thanks for reporting this bug, Kevin
 
Was wondering what the logic behind Venice having 2 naval unique units both being researched at same tech. Is there a specific strategy for this? It just feels awkward cause i feel like i have to pump out massive amounts of naval units to get my moneys worth at a very specific time. And Im not quite sure which of the 2 units should be used in which capacities or ratios. Any thoughts?
 
The venetian UUs are effectively 1 UU that has 2 different power levels. They are both ranged naval units, but one is 3:c5strength:3:c5rangedstrength: stronger than a normal galleass, while the other is 3:c5strength:3:c5rangedstrength: weaker than a normal galleass, but costs no maintenance and is much cheaper to build

So, if you need raw power, build the Great Galleass. If you just need vision and a bit of barb protection for your TRs, but you don't feel like committing to a full navy at the moment, build Fustas

This was mostly done because Venice's original UU was boooring, both conceptually and mechanically.
 
Last edited:
MkIy60X.png


Finally done with the Steam Mill code. Debugging took a while.

The code will be incorporated in the next VP version, but I'll put my DLL and SQL here so you can do some testing and release the next version sooner. Use version 2-17-3 of VP.

You should replace all references of VICTORIA_STEAM_MILL to STEAM_MILL. I'm purposely making my Steam Mill have a different type/string reference from the 3/4UC one.

Currently it grants 10% of the progress to the next Great Engineer when a building is constructed, and gives +2 Production to engineers.

SQL:
Code:
--==========================================================================================================================
-- BUILDINGS
--==========================================================================================================================
-- Buildings
--------------------------------
INSERT INTO Buildings
       (Type, BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier
FROM Buildings WHERE Type = 'BUILDING_FACTORY';

UPDATE Buildings SET Cost = 1000, GoldMaintenance = 6 WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
UPDATE Buildings SET PrereqTech = 'TECH_STEAM_POWER' WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
UPDATE Buildings SET Help = 'TXT_KEY_BUILDING_VICTORIA_STEAM_MILL_HELP', Description = 'TXT_KEY_BUILDING_VICTORIA_STEAM_MILL', Civilopedia = 'TXT_KEY_CIV5_BUILDINGS_VICTORIA_STEAM_MILL_TEXT', Strategy = 'TXT_KEY_BUILDING_VICTORIA_STEAM_MILL_STRATEGY' WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
UPDATE Buildings SET SpecialistCount = 2 WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
--UPDATE Buildings SET TradeRouteTargetBonus = 3, TradeRouteRecipientBonus = 3 WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
UPDATE Buildings SET IconAtlas = 'COMMUNITY_ATLAS', PortraitIndex = 36 WHERE Type = 'BUILDING_VICTORIA_STEAM_MILL';
--------------------------------
-- Building_ImprovementYieldChanges
--------------------------------
INSERT INTO Building_ImprovementYieldChanges
       (BuildingType, ImprovementType, YieldType, Yield)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', ImprovementType, YieldType, Yield+2
FROM Building_ImprovementYieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChanges
--------------------------------
INSERT INTO Building_YieldChanges
       (BuildingType, YieldType, Yield)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', YieldType, Yield
FROM Building_YieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_Flavors
--------------------------------
INSERT INTO Building_Flavors
       (BuildingType, FlavorType, Flavor)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', FlavorType, Flavor+5
FROM Building_Flavors WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ClassesNeededInCity
--------------------------------
INSERT INTO Building_ClassesNeededInCity
       (BuildingType, BuildingClassType)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', BuildingClassType
FROM Building_ClassesNeededInCity WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChangesPerPop
--------------------------------
INSERT INTO Building_YieldChangesPerPop
       (BuildingType, YieldType, Yield)
SELECT   'BUILDING_VICTORIA_STEAM_MILL', YieldType, 50
FROM Building_YieldChangesPerPop WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ResourceYieldChanges
--------------------------------
INSERT INTO Building_ResourceYieldChanges
       (BuildingType, ResourceType, YieldType, Yield)
VALUES   ('BUILDING_VICTORIA_STEAM_MILL', 'RESOURCE_COAL', 'YIELD_PRODUCTION', 3);
--------------------------------
-- Building_GreatPersonProgressFromConstruction
--------------------------------
INSERT INTO Building_GreatPersonProgressFromConstruction
       (BuildingType, GreatPersonType, EraType, Value)
VALUES   ('BUILDING_VICTORIA_STEAM_MILL', 'GREATPERSON_ENGINEER', 'ERA_INDUSTRIAL', 10);
--------------------------------
-- Building_SpecialistYieldChangesLocal
--------------------------------
INSERT INTO Building_SpecialistYieldChangesLocal
       (BuildingType, SpecialistType, YieldType, Yield)
VALUES   ('BUILDING_VICTORIA_STEAM_MILL', 'SPECIALIST_ENGINEER', 'YIELD_PRODUCTION', 2);

Strings:
Code:
       <Row Tag="TXT_KEY_BUILDING_VICTORIA_STEAM_MILL">
           <Text>Steam Mill</Text>
       </Row>
       <Row Tag="TXT_KEY_CIV5_BUILDINGS_VICTORIA_STEAM_MILL_TEXT">
           <Text>Stationary steam engines are fixed steam engines used for pumping or driving mills and factories, and for power generation. They are distinct from locomotive engines used on railways, traction engines for heavy steam haulage on roads, steam cars (and other motor vehicles), agricultural engines used for ploughing or threshing, marine engines, and the steam turbines used as the mechanism of power generation for most nuclear power plants. They were introduced during the 18th century and widely made for the whole of the 19th century and most of the first half of the 20th century, only declining as electricity supply and the internal combustion engine became more widespread.</Text>
       </Row>
       <Row Tag="TXT_KEY_BUILDING_VICTORIA_STEAM_MILL_HELP">
           <Text>+1 [ICON_PRODUCTION] Production for every 2 [ICON_CITIZEN] Citizens in the City. Manufactories worked by the City gain +4 [ICON_PRODUCTION] Production.[NEWLINE][NEWLINE]Gain 10% of the progress towards the next [ICON_GREAT_ENGINEER] Great Engineer in the City when constructing buildings which are Industrial Era or later.[NEWLINE][NEWLINE]+2 [ICON_PRODUCTION] Production to Engineer Specialists.[NEWLINE][NEWLINE]Nearby [ICON_RES_COAL] Coal: +3 [ICON_PRODUCTION] Production.</Text>
       </Row>
       <Row Tag="TXT_KEY_BUILDING_VICTORIA_STEAM_MILL_STRATEGY">
           <Text>Unique British replacement for the Factory. The Steam Mill is cheaper, requires no [ICON_RES_COAL] Coal, is available earlier than the Factory, and provides additional Production to [ICON_RES_COAL] Coal worked by the City. The Steam Mill also provides [ICON_GREAT_ENGINEER] Great Engineer points when constructing buildings, while increasing the [ICON_PRODUCTION] Production of Engineer specialists. Since Steam Mills do not require Coal, you can use your Coal surplus to build Seaports and Coal Plants, or you can trade it away for a large amount of gold.</Text>
       </Row>

You'll need to replace a few VP files. You should make a backup and keep it until the next version, but leaving the files after pasting should be fine too. Download from Mediafire.

- CvGameCore_Expansion2.dll: ...\MODS\(1) Community Patch
- UnifiedYields.xml: ...\MODS\(1) Community Patch\Core Files\PNM Mods DB\API
- CityView.lua: ...\MODS\(6a) Community Balance Overhaul - Compatibility Files (EUI)\LUA

Your code's missing some things. Namely, the building is not connected to England or a factory of it. Assuming I didn't screw some line up, the below should work well for England.
Spoiler :

--==========================================================================================================================
-- CIVILIZATIONS
--==========================================================================================================================
--------------------------------
-- Civilization_BuildingClassOverrides
--------------------------------
INSERT INTO Civilization_BuildingClassOverrides
(CivilizationType, BuildingClassType, BuildingType)
VALUES ('CIVILIZATION_ENGLAND', 'BUILDINGCLASS_FACTORY', 'BUILDING_STEAM_MILL');

--==========================================================================================================================
-- BUILDINGS
--==========================================================================================================================
-- Buildings
--------------------------------
INSERT INTO Buildings
(Type, BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier)
SELECT 'BUILDING_STEAM_MILL', BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier
FROM Buildings WHERE Type = 'BUILDING_FACTORY';

UPDATE Buildings SET Cost = 1000, GoldMaintenance = 6 WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET PrereqTech = 'TECH_STEAM_POWER' WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET Help = 'TXT_KEY_BUILDING_STEAM_MILL_HELP', Description = 'TXT_KEY_BUILDING_STEAM_MILL', Civilopedia = 'TXT_KEY_CIV5_BUILDINGS_STEAM_MILL_TEXT', Strategy = 'TXT_KEY_BUILDING_STEAM_MILL_STRATEGY' WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET SpecialistCount = 2 WHERE Type = 'BUILDING_STEAM_MILL';
--UPDATE Buildings SET TradeRouteTargetBonus = 3, TradeRouteRecipientBonus = 3 WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET IconAtlas = 'COMMUNITY_ATLAS', PortraitIndex = 36 WHERE Type = 'BUILDING_STEAM_MILL';
--------------------------------
-- Building_ImprovementYieldChanges
--------------------------------
INSERT INTO Building_ImprovementYieldChanges
(BuildingType, ImprovementType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', ImprovementType, YieldType, Yield+2
FROM Building_ImprovementYieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChanges
--------------------------------
INSERT INTO Building_YieldChanges
(BuildingType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', YieldType, Yield
FROM Building_YieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_Flavors
--------------------------------
INSERT INTO Building_Flavors
(BuildingType, FlavorType, Flavor)
SELECT 'BUILDING_STEAM_MILL', FlavorType, Flavor+5
FROM Building_Flavors WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ClassesNeededInCity
--------------------------------
INSERT INTO Building_ClassesNeededInCity
(BuildingType, BuildingClassType)
SELECT 'BUILDING_STEAM_MILL', BuildingClassType
FROM Building_ClassesNeededInCity WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChangesPerPop
--------------------------------
INSERT INTO Building_YieldChangesPerPop
(BuildingType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', YieldType, 50
FROM Building_YieldChangesPerPop WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ResourceYieldChanges
--------------------------------
INSERT INTO Building_ResourceYieldChanges
(BuildingType, ResourceType, YieldType, Yield)
VALUES ('BUILDING_STEAM_MILL', 'RESOURCE_COAL', 'YIELD_PRODUCTION', 3);
--------------------------------
-- Building_GreatPersonProgressFromConstruction
--------------------------------
INSERT INTO Building_GreatPersonProgressFromConstruction
(BuildingType, GreatPersonType, EraType, Value)
VALUES ('BUILDING_STEAM_MILL', 'GREATPERSON_ENGINEER', 'ERA_INDUSTRIAL', 10);
--------------------------------
-- Building_SpecialistYieldChangesLocal
--------------------------------
INSERT INTO Building_SpecialistYieldChangesLocal
(BuildingType, SpecialistType, YieldType, Yield)
VALUES ('BUILDING_STEAM_MILL', 'SPECIALIST_ENGINEER', 'YIELD_PRODUCTION', 2);
 
Yeah, the full thing will be (assuming lack of mistakes)

Spoiler :

--==========================================================================================================================
-- CIVILIZATIONS
--==========================================================================================================================
--------------------------------
-- Civilization_BuildingClassOverrides
--------------------------------
INSERT INTO Civilization_BuildingClassOverrides
(CivilizationType, BuildingClassType, BuildingType)
VALUES ('CIVILIZATION_ENGLAND', 'BUILDINGCLASS_FACTORY', 'BUILDING_STEAM_MILL');

--==========================================================================================================================
-- BUILDINGS
--==========================================================================================================================
-- Buildings
--------------------------------
INSERT INTO Buildings
(Type, BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier)
SELECT 'BUILDING_STEAM_MILL', BuildingClass, Cost, GoldMaintenance, ArtDefineTag, SpecialistType, TradeRouteTargetBonus, TradeRouteRecipientBonus, MinAreaSize, ConquestProb, HurryCostModifier
FROM Buildings WHERE Type = 'BUILDING_FACTORY';

UPDATE Buildings SET Cost = 1000, GoldMaintenance = 6 WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET PrereqTech = 'TECH_STEAM_POWER' WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET Help = 'TXT_KEY_BUILDING_STEAM_MILL_HELP', Description = 'TXT_KEY_BUILDING_STEAM_MILL', Civilopedia = 'TXT_KEY_CIV5_BUILDINGS_STEAM_MILL_TEXT', Strategy = 'TXT_KEY_BUILDING_STEAM_MILL_STRATEGY' WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET SpecialistCount = 2 WHERE Type = 'BUILDING_STEAM_MILL';
--UPDATE Buildings SET TradeRouteTargetBonus = 3, TradeRouteRecipientBonus = 3 WHERE Type = 'BUILDING_STEAM_MILL';
UPDATE Buildings SET IconAtlas = 'COMMUNITY_ATLAS', PortraitIndex = 36 WHERE Type = 'BUILDING_STEAM_MILL';
--------------------------------
-- Building_ImprovementYieldChanges
--------------------------------
INSERT INTO Building_ImprovementYieldChanges
(BuildingType, ImprovementType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', ImprovementType, YieldType, Yield+2
FROM Building_ImprovementYieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChanges
--------------------------------
INSERT INTO Building_YieldChanges
(BuildingType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', YieldType, Yield
FROM Building_YieldChanges WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_Flavors
--------------------------------
INSERT INTO Building_Flavors
(BuildingType, FlavorType, Flavor)
SELECT 'BUILDING_STEAM_MILL', FlavorType, Flavor+5
FROM Building_Flavors WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ClassesNeededInCity
--------------------------------
INSERT INTO Building_ClassesNeededInCity
(BuildingType, BuildingClassType)
SELECT 'BUILDING_STEAM_MILL', BuildingClassType
FROM Building_ClassesNeededInCity WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_YieldChangesPerPop
--------------------------------
INSERT INTO Building_YieldChangesPerPop
(BuildingType, YieldType, Yield)
SELECT 'BUILDING_STEAM_MILL', YieldType, 50
FROM Building_YieldChangesPerPop WHERE BuildingType = 'BUILDING_FACTORY';
--------------------------------
-- Building_ResourceYieldChanges
--------------------------------
INSERT INTO Building_ResourceYieldChanges
(BuildingType, ResourceType, YieldType, Yield)
VALUES ('BUILDING_STEAM_MILL', 'RESOURCE_COAL', 'YIELD_PRODUCTION', 3);
--------------------------------
-- Building_GreatPersonProgressFromConstruction
--------------------------------
INSERT INTO Building_GreatPersonProgressFromConstruction
(BuildingType, GreatPersonType, EraType, Value)
VALUES ('BUILDING_STEAM_MILL', 'GREATPERSON_ENGINEER', 'ERA_INDUSTRIAL', 10);
--------------------------------
-- Building_SpecialistYieldChangesLocal
--------------------------------
INSERT INTO Building_SpecialistYieldChangesLocal
(BuildingType, SpecialistType, YieldType, Yield)
VALUES ('BUILDING_STEAM_MILL', 'SPECIALIST_ENGINEER', 'YIELD_PRODUCTION', 2);
--------------------------------
-- Building_YieldFromInternalTREnd
--------------------------------
INSERT INTO Building_YieldFromInternalTREnd
(BuildingType, YieldType, Yield)
VALUES ('BUILDING_STEAM_MILL', 'YIELD_PRODUCTION', 50);

 
@HungryForFood, how about this?

- Reduce the manufactory boost to +2:c5production: (same as base factory)
- Change the +2:c5production: to Engineers to +1:c5production: to Engineers, Merchants, and Scientists.

It's a bit similar to the Satraps Court, but it adds that desired merchant/scientist flavor which is historically relevant.
I'm not a huge fan of how you can use the Steam Mill to get +7:c5production: if you build a Manufactory on a coal deposit. That tile is worth ~24-29:c5production: by itself, depending on if you went Rationalism; it's a bit too much stacking. A combined +5:c5production: is plenty
I'll follow your lead as to whether you choose to include/reject the +3:c5gold: to TRs. I don't really care, but I've left it in for now. Your code contains the boost, but your text does not.
 
Last edited:
I'm neutral about this change and either is fine for me, but I don't see it's point. While the Manufactory bonus makes sense to be higher, the specialist change will further encourage wide (if you have pop to spare that is) which fits the civ, but it's also less focused and slightly more generic. Granted, I don't think the Manufactory thing is a problem. Why even settle the Manufactory on Coal when Coal mines are so strong? If you have enough pop to work both tiles, put it on Tobacco, or Wheat, or whatever improvement as long as it comes earlier than the stronger ones like Oil, Aluminum, Uranium, Coal. It's way more effective and you gain several Production this way. By the time you research and make those 10 Industrial+ era buildings for a Great Engineer, the game is pretty much over. +5 Production won't matter in atomic (or late modern) era when you get those buildings, this is not going to shave off a single turn off anything - and popping the Engineer at that point for 1000+ Production is almost certainly going to give you more than the Manufactory will before the game is over.

Question : do late era buildings that are given for free still proc the 10% Engineer? Like, I get free Airports from Autocracy, or free Hospitals from Freedom, do I get 10% Engie if a Steam Mill is present?
 
Hmm, looks like I missed quite a few things. Don't release things before testing guys. :mischief:

Question : do late era buildings that are given for free still proc the 10% Engineer? Like, I get free Airports from Autocracy, or free Hospitals from Freedom, do I get 10% Engie if a Steam Mill is present?

In the DLL, it is triggered at the same time as the yields from constructing buildings. So, does it trigger the Progress or Broadway bonus?

RE: the specialist bonus, I thought about doing it the way you mentioned, but didn't because Roosevelt's Assembly Plant is also a factory replacement which had a +1 yield to Engineers, Merchants, Scientists.

RE: the manufactory bonus, I don't think +2 on top of whatever yield which is already there makes a huge difference.
 
Last edited:
Hmm, looks like I missed quite a few things. Don't release things before testing guys. :mischief:



In the DLL, it is triggered at the same time as the yields from constructing buildings. So, does it trigger the Progress or Broadway bonus?

RE: the specialist bonus, I thought about doing it the way you mentioned, but didn't because Roosevelt's Assembly Plant is also a factory replacement which had a +1 yield to Engineers, Merchants, Scientists.

RE: the manufactory bonus, I don't think +2 on top of whatever yield which is already there makes a huge difference.

Yeah I think it does trigger Progress/Broadway. I am sure buying things with Faith does, at least. I never pay attention to these things by the time the free building stuff comes online.
 
@HungryForFood, how about this?

- Reduce the manufactory boost to +2:c5production: (same as base factory)
- Change the +2:c5production: to Engineers to +1:c5production: to Engineers, Merchants, and Scientists.

It's a bit similar to the Satraps Court, but it adds that desired merchant/scientist flavor which is historically relevant.
I'm not a huge fan of how you can use the Steam Mill to get +7:c5production: if you build a Manufactory on a coal deposit. That tile is worth ~24-29:c5production: by itself, depending on if you went Rationalism; it's a bit too much stacking. A combined +5:c5production: is plenty
I'll follow your lead as to whether you choose to include/reject the +3:c5gold: to TRs. I don't really care, but I've left it in for now. Your code contains the boost, but your text does not.

I don't feel these changes are needed. The +4 :c5production: to Manufactories is a good compliment to to the GE :c5greatperson: on Industrial and later Buildings: powerful and worth waiting for.

Buying with Faith does Trigger Progress/ Industry bonuses.
 
Aight, well I will lockstep with Hungry for now then.
Hmm, looks like I missed quite a few things. Don't release things before testing guys. :mischief:
Not releasing anything until a new VP is pushed. No point in testing these changes until I can confirm that the changes you made to CPP are integrated correctly.

I am trying to work on a fix for @kevincelis' issue regarding the Kabuki. Deleting a guild annihilates any population that was working that slot when the lua fires, so you need a way to clear the population out of the guild slots before you delete them. This is a well documented problem with deleting buildings with specialists. This bumps up against 2 problems however:
  1. If you TASK_REMOVE_SPECIALIST on a slot the AI has assigned, it will immediately re-add the specialist, causing an infinite loop of CheckSpecialist --> RemoveSpecialist -->CheckSpecialist -->RemoveSpecialist
  2. BNW broke our ability to deactivate city specialist assignments via TASK_NO_AUTO_ASSIGN_SPECIALISTS for AIs. You can deactivate auto-assign, remove the specialists, then reactivate auto-assign for Human players, but not AIs.
Lastsword suggested a workaround: zeroing city population, thereby removing all citizens from all slots, making the building swap, then re-adding the city population.

Exhibit A:
Code:
function OnConstructionUpgradeGuilds(iPlayer, iCity, iBuilding)
    local pPlayer = Players[iPlayer]
 
    if not (pPlayer and pPlayer:GetCivilizationType() == eCivilizationJapan) then return end
    if iBuilding ~= eBuildingKabuki then return end
        
    local pCity = pPlayer:GetCityByID(iCity)
    pCity:SetNumRealBuilding(ePopDummy, pCity:GetPopulation())
 
    if pCity:IsHasBuilding(eBuildingWritersGuild) then
        pCity:SetPopulation(0, true)
        pCity:SetNumRealBuilding(eBuildingWritersGuild, 0)
        pCity:SetNumRealBuilding(eBuildingMonogatari, 1)
    end

    if pCity:IsHasBuilding(eBuildingArtistsGuild) then
        pCity:SetPopulation(0, true)
        pCity:SetNumRealBuilding(eBuildingArtistsGuild, 0)
        pCity:SetNumRealBuilding(eBuildingUkiyoe, 1)
    end

    if pCity:IsHasBuilding(eBuildingMusiciansGuild) then
        pCity:SetPopulation(0, true)
        pCity:SetNumRealBuilding(eBuildingMusiciansGuild, 0)
        pCity:SetNumRealBuilding(eBuildingGagaku, 1)
    end

    pCity:SetPopulation(pCity:GetNumRealBuilding(ePopDummy), true)
    pCity:SetNumRealBuilding(ePopDummy, 0)
    NotificationLoad(0, pPlayer, pCity)
end
The one issue Lastsword pointed out is that this could cause a problem for any processes which trigger at set populations. For instance, If a Japanese Guild replacement fires in a city with >10 population, it could fire the Authority finisher and give the city a free military unit.

@Infixo, @adan_eslavo, @Enginseer, @Blue Ghost, @hokath, @HungryForFood, please advise?

EDIT: I ran a game, and it seems to work well. Removing/Re-adding citizens did not trigger the Authority Finisher or bonus :c5science: on Groves. I did not check if the :c5science: from Progress or the :c5production: from Aqueducts were triggered, but if Groves and Authority don't trigger then hopefully those two won't either.

There's no need to change the second part of the code because it triggers on the initial construction of the guilds, so the AI has no time to assign specialists into slots that disappear immediately after they appear.
 
Last edited:
i was "checking"^^ stuff in your code and i found something weird about your code with the Teutonic order:
Spoiler :

upload_2019-3-3_19-49-24.png


shouldn't the "local iCurrentBarracks = 0" be before the loop? if not, the last condition "iCurrentBarracks == iNumberOfBarracks" would never be true didn't it?
 
Hmm. Yeah that does seem like it should be outside the loop, so that the value isn't set back to 0 every city...
 
I haven't actually finished a game as Songhai yet, but I "finished" my 4th playthrough, as I'll probably quit at this point. No compelling reason to continue hitting next turn in a game where I have 5 vassals, more than 10 techs ahead, half a policy tree, and I'm soaring ahead as I snap up every worthwhile wonder since I have 4 capitals with super-production. Songhai honestly feel a tiny bit broken, but I don't think 4UC has anything to do with it. Their UU is insane, and they generate so much gold and production that your cities will camp at nearly fully built until you start having to spend more money investing in wonders/upgrading units. But the reality is the instant you hit Chivalry you will be able to level at least 2 civs easily since you don't even need siege units to set up. Just run horses at their face and shoot at whatever is nearby.

Feel really fun to play though, and the 4UC components are nice. The new Gumey is a bit weird sometimes with TRs dodging your city, but you can fix that with direct to/from TRs.
 
Yay! Songhai is the one civ I feel we actually nerfed in 4UC. Stacking them with sofas makes them very tough, but where they are in base VP is just insane. Taking 15CS horses with no reduction vs cities and double flanking before most civs even have walls up is evil. If Songhai wants you dead there’s not much you can do about it in base VP.
 
Gave Byzantium a lenghty spin. Both Dromon and Hippodrome feel good. Dromon gives some tasty, tasty early coastal dominance, and Hippodrome enables a pretty sweet WLTKD strategy together with Byz's guaranteed religion.

Minor nitpickery incoming; feel free to disagree on these.

I think I originally suggested Dromon to have splash damage I... and that's the part that still feels the least impactful. Greek Fire is great (although as with all such effects, you miss on the on-kill bonuses if the enemy unit dies to the ticking damage), but would it be over the top to have Splash Damage II as well, but up the production cost back to normal? Dromon is not statwise much different from Penteconter, after all (2 RCS more, IIRC), and cheaper-to-produce is one of the few bits you generally don't notice with UC's at all to the point where it might as well not be there. Heck, I think I'd rather go for a more-expensive-but-better option here, fitting the perceived opulence of Theodora, heh.

This is just me really liking promotions that stay, particularly on such early UU's.

Hippodrome feels like it should give a small set of free Horses(2-4), because sometimes you just have those lousy starts with none of the stuff, and not being able to make Cataphracts is a major feelbad. This was probably discussed before though. Mind you; no need to actually spawn horses near the city, as that would double-dip with Hippodrome's horse resource buff.
 
Normally Naval Units can't get Splash Damage II. So adding Splash II would mean Greek Fire would need a nerf in exchange.
Oh. I didn't know that.
Although, would it? Splash Damage(s) not exactly the most powerful of promotions to begin with, especially not before you get additional range (and if you manage to get your Dromon all the way up to a Cruiser, you deserve it). Greek Fire is lost on upgrade anyway, as it should.
 
Back
Top Bottom