Announcement

Collapse
No announcement yet.

Python wish list

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Python wish list

    I didn't see a thread for this, but it might make a cool sticky? if other modders have anything they want. Don't know if Firaxis would care.. but if they don't know what we want they can't be blamed for not providing it. I realize the SDK will make a lot of stuff easier.. but it would be cool to flesh out the Python API anyway.

    I'd like:
    Per-city:
    A python-only(not used by the rest of the game code) variable per yield type that gets added in before bonuses are calculated. This way, modders who want to add hammers to base production, food, or commerce can do so without ugly python workarounds like invisibly resetting the production numbers. As it stands, there's no visual feedback for anything we do, so if we make a change the player may get confused as to why 5 hammers got added this turn, when his total production only shows in the mouseover as 3..

    A python-only variable per yield type that is a percent bonus (ie Organized Religion etc). The production mouseover could just call it Miscellaneous Bonuses or something.. it would allow modders to keep their changes more visible.

    A SetYield function added to CyPlot to allow direct manipulation of a plot's output. I realize you don't want to add new data to plots so they don't take up a huge amount of memory, but you could create a linklist of Plot*, Yield override, and use an empty flag (if there is one) in the plot class. I haven't seen the codebase, so naturally that's conjecture.

    Anyone else have something they want to do in Python and can't??
    4
    Adding stuff to the Python API is good!
    75.00%
    3
    Adding stuff to the Python API is bad!
    0.00%
    0
    I don't care and am here for no reason.
    25.00%
    1
    Boogie woogie woo..
    0.00%
    0

  • #2
    I would love to have a function to determine how many turns a specific unit would take to reach some CyPlot from it's current location, factoring in roads/bonuses/etc..

    Just like when you tell a unit to Goto a location and it indicates how many turns it would take... there seems to be no function in Python that exposes this.

    Comment


    • #3
      Ah, that reminds me.

      An API function that allows the modder to disallow certain types of improvements when settlers are autobuilding. I hate it when they cover the land in cottages. It would be really cool if you could disable only certain 2-tuples (ie , etc)

      Comment


      • #4
        In my mod, I edited the interface to include how much bonus food and production are being produced in the city manager screen. If the bonus production wasn't a modifier (based on my judgement) I could have called the existing modifier and multiplied it out as needed.

        However, the mouseovertooltips remain an elusive, uneditable portion of the code. It would be easier to just change the function for how production is calculated so everything else would update properly, though.
        Mylon Mod - Adressing game pace and making big cities bigger.
        Inquisition Mod - Exterminating heretic religions since 1200 AD

        Comment


        • #5
          Originally posted by Mylon
          In my mod, I edited the interface to include how much bonus food and production are being produced in the city manager screen. If the bonus production wasn't a modifier (based on my judgement) I could have called the existing modifier and multiplied it out as needed.

          However, the mouseovertooltips remain an elusive, uneditable portion of the code. It would be easier to just change the function for how production is calculated so everything else would update properly, though.
          I looked hard at your code.. it was what got me started in Python. Using a multiplier as you did, only pretty big cities benefit (due to integer truncation). That's a design choice, I respect it.. but consider the problem once you decide to put in actual hammer increases:

          You can't add directly to the base yield, so the mouseover actually gives false information!
          You can't do the multiplication right (verify this with debug prints!) because the various yield retrieval functions only give you some of the bonuses (ie

          getProductionModifier() and
          pCity.getYieldRateModifier(YieldTypes.YIELD_PRODUC TION)
          return different bonuses, and even adding them together does not get all the possible bonuses accounted for.

          In addition, the python-side multiplication is messed up because, if you only have 1 hammer of strategic resource (say a horse) and you are producing 3 hammers normally in the town, and you have a 25% bonus (say organized religion) you wont get ANY hammers bonus, since the yield calculation 3*0.25=0 (integer math) and 1*0.25=0... it sucks!

          The problem is that workarounds, in this kind of situation, are just plain hacks and should be avoided, if Firaxis were willing to change the API, by giving us a proper way to manipulate the system.

          /end rant.

          Comment

          Working...
          X