Tomatekh's Timurids for VP

I also started reworking Jewel's code. No problem. I have only one issue: I cannot load saved timurids game because it says I have not enouth mods enabled. But I have such! Do you have the same?

EDIT: Fixed. In main file you have " <MinCompatibleSaveVersion>71</MinCompatibleSaveVersion>". Change it to <MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
 
Last edited:
This might encourage players to pillage the improvements, withdraw until they are repaired, and then come pillage again. Could this be abused, or are you not concerned due to the rarity of great person improvements?
Denmark gain bonus for each pillage, not just GPTI, so this is fine.
 
@pineappledan: I fixed and simplified the code. Both abilities works well now. Now 1000 lines of code are smashed to 50.

I added GameEvents.BattleJoined.Add(JewelOfTheEast1) so you need to enable correspondent value via SQL like we did in MUCfVP.

There will be only small issue with UBs build in capital: code in MUCfVP is made to block all other nations than standard owner f.e. for Chaebol code runs only for Korea. That means that if Timurids have Chaebol, then it will not be able to use its special abilities programmed in lua. This must be programmed in MUCfVP: you need to add it the same way Rome was added, but to all UBs not only those which has NeverCapture == 0, because Timurids can have all UCs.

I blocked World Wonders and Dummies, so they won't be built in capital. Does World Wonders have some value saying that they are WW? I used WonderSplashScreen column but it is not ideal. For Dummies I used HurryCost. Also not so ideal.

Check if it works the way you wanted. If some corrections are needed, then tell me.
 

Attachments

  • Timurid lua scripts.zip
    2.6 KB · Views: 294
Last edited:
Timurids shouldn't be able to steal national wonders either, just regular buildings.
There's the BuildingClasses.MaxGlobalInstances for world wonders, and BuildingClasses.MaxPlayerInstances for national wonders

All national/world wonders and dummy buildings are also nuke immune, so you could use that. The only normal building which is nuke immune is the military base, So you can make that 1 exception:

Code:
if pCity:IsHasBuilding(building.ID) and (building.NukeImmune == 0 or building.ID == 39)
 
Last edited:
Nuke immune would be better. You can change that. Of course you can add exception like: "if building is nuke immune and building is not Miltary base". Such one exception can be done easily.
 
Here you have:
 

Attachments

  • Timurid lua scripts.zip
    2.6 KB · Views: 262
Ok check now (small correction):
 

Attachments

  • Timurid lua scripts.zip
    2.6 KB · Views: 291
That works!
Major issue, however, is that non-uniques don't replace base buildings.

For example, if I conquer a mongolian city, which has Mongolia's unique Ger. If the Timurid capital already has a Granary, then the capital will now have BOTH, a Ger and a Granary. The code would have to clear any pre-existing building from that buildingclass.

This is why I’m hesitant to go forward with this whole idea, now that I get the full scope of it. It requires overhauling a significant amount of 4UC lua to make it work, it will likely cause some very scary balance issues, and it’s a serious headache to code.

I made an updated version of the vanilla version of the timurid building capture code, I can just sub that in and have it work without unique buildings.
 
Last edited:
Not concerned. GPTs are pretty rare. It's also very similar to the Denmark playstyle, but Timurids' is more surgical, and more concerned with snowballing from long-term bonuses, rather than instant boosts.

I would just like to point out that pillaging and withdrawing fits with what the Vikings did, but according to what I have read Timur would roll in his grave if someone suggested he would not conquer :lol:.

I know I keep harping on this but some mechanic to encourage razing would be so thematic. Some historians estimate 5% of the world's population died as a direct result of Timur's campaigns!

No matter what you decide, I can't wait to play this civ.
 
I'll release a version of it tomorrow with a modified version of the base vanilla building capture:

Your Palace gains +1:c5culture:Culture/:c5science: Science/:c5gold:Gold/:c5production:Production/:c5war:Military Supply whenever you Capture or :c5razing: Destroy a City. Buildings from captured cities are immediately constructed in your :c5capital: Capital.

It will not build unique buildings in your capital, but unlike the vanilla version, it will allow mutually exclusive buildings to exist within your capital (wells/watermills, etc.), and you will be able to steal guilds, so you could hypothetically get a 4th guild on empire.
 
Vanilla code was not adjusted to additional mods. You have to add it manually. My code can be simplified to one function (30 lines?) and it will look for base buildings instead of uniques, and what is more important it will check whole table. I can do that for you later today, after work. Upload latest version when you finish and I will do changes to Jewels.
 
Vanilla code was not adjusted to additional mods. You have to add it manually.
I added all the new building classes which are unique to VP (grove, herbalist, Stupa, etc.). The vanilla version already contained everything needed for compatibility with Enlightenment Era. I also updated the code so that it selects the Timurid capital specifically; Tomatekh's old code used a for loop to check every city for if it was the capital.

Tomatekh's version builds a table of all the available buildings once, at the beginning of the game, rather than compiling a list of all buildings each time a city is captured. It should be a bit more efficient for computer resources.

I'm pretty happy just to let the building capture mechanic only take base buildings. It keeps the lid on a whole Pandora's box of issues:
  • Even with 4UC, there are civs with no UBs to be stolen (Huns, Portugal). It adds another layer of RNG to your game, because you might be really lucky to get Ethiopia next to you (to steal a Stele), or you might feel forced to kepp England alive for a very long time (to take her factory)
  • There are some UBs which would have to be blocked for balance reasons, because having 1 on your empire is almost as good as having 10 (Zulu Ikanda, Greek Agora, Ottoman Tersane, Ottoman Siege Foundry)
  • There are some other issues with UBs transferring to new civs that would cause problems
    • Any on-construction effect would not trigger, if built via lua (Resource placement for Candi, Buffalo Pound, Nilometer)
    • Some UBs move around, based on if EE is installed (Schutzenstand, Ostrog, Grande Ecole, Sambadrome)
    • Some UBs have weird interactions with replaced UBs (Have to make special exception for Barbican)
    • If there is no expectation that unique buildings will be built, then custom civs aren't considered incompatible (Won't have to update Timurids every time a new civ is released)
Upload latest version when you finish and I will do changes to Jewels.
4UC compatible version has now been uploaded. I would recommend, however, that we at least wait for some feedback for now.
 
What I meant was that if any mod change the building (add, remove, change) (vp, vpee, mucfvp) then you need to add those changes manually. Recently there were some religious building revamp in vp. My code does this automatically for every mod that adds buikdings not only 3 base ones. Theres no difference between that old table or that I use. Table is table and both are created at the same time. Such change save you lots of time and code looks better.

You just dropped UBs so simplifying means that tBuildings table Ive added is not needed anymore.
 
Last edited:
Well, hopefully VP is not looking to add/remove any new buildings at this point. I've had to roll out 10+ versions of Sumer at this point, so it's not the end of the world
 
If it is possible code should adapt automatically to any other mod. If not you will have to enumerate them in main post, but its unproffessional. Lets say you will stop updating it then the mod will become out of date quickly.
 
Last edited:
Okay, well futureproofing sounds good to me, though I'm fairly certain that at this point the building list for VP is stable. Numbers/balance might change, but I don't think G is looking to scrap or add entirely new buildings now.

If you are willing to do the work, then the only caveat is coastal vs non-coastal buildings. Right now they are in 2 separate tables and the code checks for them separately, after determining if the capital is a coastal city or not. No point in having lighthouses/harbors/etc. built in a landlocked city; they would only add building maintenance.
 
The attribute does not seem to work. Upon conquering I got neither the increased yields or the free buildings.

I did make one change: I changed it to "<MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>" as adan_eslavo has posted to enable loading saved games.
 
The attribute does not seem to work. Upon conquering I got neither the increased yields or the free buildings.

I did make one change: I changed it to "<MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>" as adan_eslavo has posted to enable loading saved games.
Oh crap, I forgot to make that change to my own local instal after it was mentioned. I was preoccupied with trying to get the diplo splash screen to work

EDIT: Base VP and 4UC are online, as of 10 minutes from writing this. Fixed savefile issue, fixed lua problem
 
Last edited:
Current version of the Timurids does not capture nevercapture buildings (walls, barracks, etc.).
It would be nice if it were possible, but I don't know if it is doable without adding back the issue with unique buildings. What do you think, @adan_eslavo?
 
Top Bottom