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

Tsentom1 Python Traits

Discussion in 'Civ4 - Mod Components' started by tsentom1, Nov 1, 2008.

  1. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    I've tried it out, and i have to say: great work :goodjob:!

    I've looked into the code, and it seems to be very difficult?
    How much did it take, to program that?
     
  3. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    It's not that bad. I've been using Civ to teach myself Python kinda so after a while I can do it relatively quickly. The hardest part is figuring out the correct functions.

    If you're looking to merge this, winmerge makes it really easy as it shows you exactly where to copy and paste.

    Added:


    Nomadic Trait


     
  4. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    :eek: python is really horrible (-> my opinion).
    No idea, how you could teach it yourself.

    But really great work :goodjob:, maybe i'll use 2 of them in my mod.

    How about a global production-modifier in a trait?
     
  5. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    I would love a building production modifier in a trait.
     
  6. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    As per request:

    Resourceful Trait





    Made it in two different flavors one lowering the cost of units the other buildings. (-20% Cost is equal to +25% production)

    No matter how you make a production trait I feel it'll be very powerful. Hope it's useful.
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    :worship::worship::worship:


    Balancing is the magic word :).
    Maybe it'll be combined with other weaker traits, i'll just try it out.
     
  8. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    It's easy to change to -10 or -15 % Cost. In the python currently you'll see it says return 80 (or 80% of the cost) just make it 90 or 85, etc. (then of course go into the xml text file and change the description)

    Also, it won't show up as a +25% when hovering over your hammers in the city screen. Rather if you compare the actual hammer cost of the building or unit when selecting production it'll be lower.
     
  9. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Updated the Strategic Trait

     
  10. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    I also think, that's no problem, but it'll just take some time to get it balanced.
    But it'll be done :).
     
  11. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    Will we find your other traits from Thomas War here in the future?
    I think, they can't be all done alone in the xml files, am i right?
     
  12. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Oh, I can separate them if you want. In truth there a are ton of python wonders, buildings, civics in that thing that I wrote and have been just too lazy to separate.

    My Mercantile is actually all XML.

    My Nationalistic is half and half - but I kinda cheated with it (in how its accomplished but it works 100% so I guess that's in the eye of the beholder) which is why I never separated it.

    The Barbaric trait in Thomas' War is also half and half python and xml. (No one uses Barbaric though, there are quite a few things programmed into Thomas' War that are hidden just because I never got around to assigning them to things).
     
  13. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,900
    Location:
    Germany / Netherlands
    I only wanted to know, if you're planning it.
    would be nice, if you have the time.
    If not, it's no problem (for me) to get it out of your mod (if you don't mind...).

    Really!?! ;)

    :hmm: ah, that's what
    PHP:
    <traderouteyields>
    does, isn't it?

    I think i have an idea of what you're meaning :D.

    I'll look into it, let's see what can be found :cool:.
     
  14. Chief of Staff

    Chief of Staff Chieftain

    Joined:
    Jan 11, 2006
    Messages:
    53
    Location:
    Paducah, McCracken County, Kentucky
    Greetings,

    I have added those four traits above and I have to say I am quite pleased. Now you mentioned that there are other traits not yet separated for add-on, I am eagerly awaiting them in future.

    On other hand, I actually thought there was already a Scientific trait but looking into original XML version from both vanilla, warlords, and bts folders, I can find none. Should there be a Scientific trait or is that already covered by other traits?

    Come to think of it, I wonder what are other possible traits. Aside from Scientific, I am thinking of Innovative, Progressive, and so on. What else are possible, trait-wise?

    Regardless, good work and thanks for those traits! =D

    -Chief of Staff
     
  15. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Hey tsentom1, if you're taking requests I'd like a Progressive Trait. I'd like it to have a 10% Tech reduction cost, and +1 culture per religion (so state religion gives 2 culture, and non state religions 1), and religious buildings. I'm also wanting it to have no revolution penalties from non state religions, as per the Revolutions mod, though I'm pretty sure I could code that myself (and if not, I know where to start and what questions to ask to figure it out). If not, it's cool, just noticed you were taking requests, and this is one I'd like to add to the WolfRevolution mod, but don't really know how to go about doing it.
     
  16. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Tech costs kinda baffle me in the python as I know exactly where I have to edit it but the code I write for it always works kinda weird. I have like 5 things half done with tech costs I'm still trying to clean up. So that might be a bit. Though if you're simply talking about a general +10% research bonus (not affecting the specific cost persay, I can do that easily with the XML. The religion thing I can probably do on begin player turn, scan cities, get number of religions, and add +1 culture per religion. Let me see how that code would work out.
     
  17. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Speaking of requests, it's really a simple matter to convert any of my wonders to civics to traits, etc. For the most part (there are a few exceptions mainly the ones that increase commerce on a tile type that's not ocean or river), so if people wanted me to do any of them I could.
     
  18. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    How would you do this in the XML? Research bonus isn't in Traits, there is a tag in civics though. Also I've rethought it, and it would be more balanced to simply have it so non state religions produced +1 culture, rather then giving a bonus to religious buildings as well as the state religion. This would also give an advantage to choosing no state religion (such as the free religion civic, or just in general) as only no state religion would really give a noticeable bonus, a city in a civ with a state religion other then the state religion would still be helped, but it wouldn't be overpowered, as the original suggestion was. Anyway thanks for considering this trait.
     
  19. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Code:
    			<iHealth>0</iHealth>
    			<iHappiness>0</iHappiness>
    			<iMaxAnarchy>-1</iMaxAnarchy>
    			<iUpkeepModifier>0</iUpkeepModifier>
    			<iLevelExperienceModifier>0</iLevelExperienceModifier>
    			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
    			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
    			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
    			<iMaxGlobalBuildingProductionModifier>0</iMaxGlobalBuildingProductionModifier>
    			<iMaxTeamBuildingProductionModifier>0</iMaxTeamBuildingProductionModifier>
    			<iMaxPlayerBuildingProductionModifier>0</iMaxPlayerBuildingProductionModifier>
    			<ExtraYieldThresholds/>
    			<TradeYieldModifiers/>
    			<CommerceChanges/>
    			[B]<CommerceModifiers/>[/B]
    			<FreePromotions/>
    			<FreePromotionUnitCombats/>
    
    
    
    			<CommerceModifiers>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    				<iCommerce>0</iCommerce>
    			</CommerceModifiers>
    In traits, any commerce (gold, research, espionage, culture) you can increase by a total percent. I forget which one is which, the first is gold and the last is espionage, so research is one of the middle ones
     
  20. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Thanks, I recognize that, same as buildings, and similar to terrain improvements, cool. Let me know if you figure out how to use python to make it so non state religions produce culture.
     

Share This Page