1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Tomatekh's Timurids for VP

Discussion in 'Mods Repository' started by pineappledan, May 11, 2018.

  1. Rosaria's Sandwiches

    Rosaria's Sandwiches Chieftain

    Joined:
    May 19, 2019
    Messages:
    25
    Gender:
    Female
    I've never made a mod before and my only knowledge in programming is my beginner C class but could you make a check for a pop value that decrements the condition every time you add the yield? When you stop the razing the condition won't be met and you stop giving yields.

    I agree with CrazyG the UA idea sounds very nice.
     
  2. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    Pushing a new version. Figured out a way to make the UA work without being exploitable. If you end a turn after cancelling razing a city, the city is marked. If you raze a marked city, it will only give 1 yield on being destroyed, but otherwise the UA is disabled for that city. If you stop and restart razing in the same turn then nothing happens, so no danger of misclicks.
    Code:
    v9
    Changes:
    UA reworked ==> +1 to all yields in Capital whenever a city you are razing loses 1 population or is destroyed. Cancelling razing disables the yields from losing population
    Farsakh Cannon ==> RCS reduced to 40 (was 42)
    Deh ==> 10% land trade route distance per Deh worked removed (high computational burden, and was too subtle a benefit. Could actually hurt you as often as it helped)
    
     
    CrazyG and Rosaria's Sandwiches like this.
  3. CrazyG

    CrazyG Deity

    Joined:
    Oct 14, 2016
    Messages:
    4,325
    Location:
    Beijing
    So if I raze a 10 pop city, would I get 11 of each yield in the capital? (10 per pop and 1 for destruction?)

    Those are some crazy yields. I think you could actually add a negative side effect, such as you can only raze cities (if it is doable, IDK what would be done with capitals/holy cities).
     
  4. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    No, you would get +10 yields. Going from 1 to 0 :c5citizen: in a city destroys the city, which is a separate event. Also, you'd have to capture a 14:c5citizen: city to get +10 yields right? You don't get anything for the population you lose during conquest. You also can't raze capitals, and the yields from raze come at the cost of a) :c5citizen: population in cities, and b) could mean giving up wonders or other major bonuses in cities, so it could come with a significant down-side.
     
    CrazyG likes this.
  5. CrazyG

    CrazyG Deity

    Joined:
    Oct 14, 2016
    Messages:
    4,325
    Location:
    Beijing
    I think you could remove "or is destroyed" from the UA text. I would expect "loses 1 population" to apply to going from 1 to 0.
    I'd probably just raze a city with a valuable wonder down to only 1 population, or maybe a bit more. +1 of everything in your capital is generally far more valuable than a citizen.
     
  6. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    Currently, the +1 Yields on destruction of a city happens regardless of if you stopped/restarted razing a city. It follows different rules, but I could change that.
    Probably the best move. Still, I was trying to base it off of similar bonuses, like Morocco's +1 to All Yields, and I figured the tradeoff, combined with the inherent riskiness of Timur's UA (if you lose wars you literally don't have a UA) made for a sort of balance.

    We'll give it a shot. If it's too good, we can nerf it somehow.
     
  7. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    Tiny Tim isn't supposed to steal unique buildings anymore? I am fighting Zulu, getting his cities, having him resettle them after razing for bonus yields, and his Ikanda isn't getting constructed in my capital. I will try with his capital later, but so far I think at least one of the cities would've had the building. The notice of stealing buildings does appear, it says the building is "." and I get absolutely nothing constructed at my Skull Throne. Similar thing appeared with Ottomans, but in their case it said "., well" or "well, .", can't remember. Timothy won't get no buffalo it seems, he could steal a Well and a Granary but nothing more

    Ottomans might not have built the forge yet though, maybe it's only Zero Capture uniques he can't borrow - will try later.
     
    Last edited: Jul 2, 2019
  8. Bhawb

    Bhawb Prince

    Joined:
    Nov 11, 2018
    Messages:
    500
    You don't steal the unique version of the building, and it only goes towards your capital. So if you conquer a Zulu city you'll get a Barracks in your capital, not an Ikanda.
     
  9. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    Didn't he get to steal unique buildings before? I guess with how many yields he gets for razing, it's going to be okay. RIP Timothy's potential (but improbable) Dojo + Ikanda + Barracks + Armory + Barbican city
     
  10. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    You should be able to steal uniques, but you can’t have more than 1 type of buildingclass in a city. If you capture a unique building, it should replace any existing building of the same buildingclass.

    I didn’t write the lua, but AE specifically put checks in there for uniques. Maybe something has gone wrong, can you post your lua log?

    EDIT: just got finished testing it. No unique buildings. only default buildings. You can still get unique belief and policy buildings though.
    Another hiccup: You can steal people's scrivener's offices and Printing Presses, because those wonders don't behave like other national wonders, so they miss the national wonder checks that should otherwise filter them out.
     
    Last edited: Jul 2, 2019
  11. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    Can Timmy steal Reformation Buildings? If yes, what if he didn't reform his religion and he gets the reformation building - does he get the reformation choice instantly, or just the building?

    No one's reformed yet which sucks, I want to give it a try.
     
  12. Bhawb

    Bhawb Prince

    Joined:
    Nov 11, 2018
    Messages:
    500
    I'd assume you shouldn't be able to steal Reformation buildings because they are Wonders, not just normal buildings. I'll have to give it another go next game I start up.
     
  13. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    Timurids can’t steal: nuke immune buildings (but they can steal military bases), dummy buildings, or CapitalOnly buildings. So he can’t steal world wonders, national wonders (except the diplomat wonders, but that’s a problem on G’s end), dummy buildings, or people’s palaces/tradition policy buildings.

    Everything else is fair game, including NeverCapture buildings, but Tim’s won’t steal coastal-only buildings if Samarkand isn’t on the coast
     
  14. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    Found bugs:

    Registan cannot be themed despite the description claiming it can. It has two slots, but it doesn't show it can be themed, doesn't say how, and neither 2x different civ nor 2x same civ or 1 x me 1 x their fills it.
    Registan's mini national wonders are available instantly after construction, not during renaissance like the tooltip claims.
     
  15. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    Yeah, Timmies needs some love. Their donuts aren't as good as they used to be and the cracks are showing.

    I think I fixed that bug with the Deh to everyone's satisfaction. I'm going to release a version with all the text fixes and stuff this weekend. I'll try to get a fix for the diplo wonders into the next version of VP, but if that's a no-go then I will be making the necessary changes to diplo wonders in the Timurids' own code.
     
  16. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    OP lies, it says you get +1 Prod +1 Science from economics while you get +1 Gold + 1 Science
     
  17. pineappledan

    pineappledan Deity

    Joined:
    Aug 9, 2017
    Messages:
    4,204
    Gender:
    Male
    Location:
    Alberta, Canada
    The +1:c5culture: at electricity is gone too. updated the OP.

    New update seems to work, I am going to sit tight for a new version of VP though. G is done his, there's some pull requests on Github I'd like to see added, and it sounds like there could be a lot of changes to the buildings in this new patch, if CrazyG gets his way.

    There's another big problem this patch: I have re-done the code that disables Timurids' ability to build villages and replaced the lua with SQL. This SQL deletes ALL civs' ability to built villages and re-adds their ability to do so as a trait ability using the Trait_BuildsUnitClasses table. This means that Timurids (and also Macedon, when I get around to them), are not compatible with civs that do not have this code:
    Code:
    -- reinstates the custom civs' ability to build trading posts (disabled by Timurids) and Citadels (disabled by Macedon)
    INSERT INTO Trait_BuildsUnitClasses   (TraitType, UnitClassType, BuildType)
    VALUES     
                ('TRAIT_XXXXX',    'UNITCLASS_WORKER',         'BUILD_TRADING_POST'),
                ('TRAIT_XXXXX',    'UNITCLASS_GREAT_GENERAL',     'BUILD_CITADEL');
    All of the civs I have done will have this code (I will re-release all my custom civs with this code when G pushes his newest VP version). @hokath, @HungryForFood, and @jarcast2 could take notice.
    The SQL used will catch all civs that load before Timur, so there's a chance that no change is needed at all, but that depends on your computer's load order. If you don't add this code all the other custom civs will work fine, except they won't be able to build villages. This is also only a problem for 4UC, so if people don't use 4UC they can just ignore this.

    Sorry guys. I've been wrestling with this code and trying to do it via lua for a long time, but if you do that then AI civs can break it and everyone can build Deh except the player. Maybe I can put in a feature request for a special trait table that disables improvements?

    Changelog for Timurids v.10
    Code:
    Deh code now disables villages via SQL
    Registan now has a theming bonus
    Unique promotion icons, courtesy of Asterix Rage
    corrections in civ text and documentation

    Ghazi and No Movement While Damaged promotion icons, by @Asterix Rage
     
  18. Enrico Swagolo

    Enrico Swagolo Deity

    Joined:
    Jun 10, 2013
    Messages:
    2,379
    The image's broken, but I trust it will be top tier because that's how Asterix rolls.
     
  19. HungryForFood

    HungryForFood Prince

    Joined:
    Oct 4, 2016
    Messages:
    319
    Location:
    Malaysia
    Breaking other mods' compatibilities is not ideal. I'll whip out a Trait_NoBuildImprovements real quick.
     
  20. HungryForFood

    HungryForFood Prince

    Joined:
    Oct 4, 2016
    Messages:
    319
    Location:
    Malaysia
    Try this. The new table is Trait_NoBuilds, with columns TraitType and BuildType.
     

    Attached Files:

Share This Page