1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Simple Python Things

Discussion in 'Civ4 - Mod Components' started by The_J, Apr 27, 2009.

  1. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,756
    Location:
    Germany / Netherlands
    Thanks :).

    When you have problems with merging, you should try, if WinMerge does it better.

    Or download the latest python version, open the files with it, and try it then. It doesn't mess up the intendation there.
     
  2. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Alright, so last night, I added the Heroic Strength Promotion to the DLL. Good News is-- it is working after a unit upgrades, Bad News is-- I tested it several times last night and not once did the AI use it against me. Ok, it being in the DLL and not Python might be bad news to some as well, but it is working. I am going to do a minor tweak to the AI value for the promotion and recompile, I'll add a link here when it is up. Thank you J for an awesome concept.
     
  3. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,477
    Great. :)

    Well, can't we add additional AI code in python? See "Marauder Reloaded" code. Other possibility: Low chance for auto-promote a (leader? (= unit with leader promotion)) unit with this promotion.
     
  4. hrochland

    hrochland Prince

    Joined:
    Apr 9, 2006
    Messages:
    1,987
    Location:
    Czech Kingdom
    Yes I tested it and checking write me errors before find my code :lol:
    nevertheless thinks (some from) are functional.
    For exaple I wanted use your promotions but always one is functional. Two or more cause error :(
     
  5. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Here is the DL

    Below are some screenshots
     

    Attached Files:

  6. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,477
    very nice. thanks.
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,756
    Location:
    Germany / Netherlands
    mmhh...AI is always difficult.

    Not my concept, it was even not my idea ;).

    In my python version is additional AI code, but that's just rolling dices.

    What errors?

    :goodjob: well done.
     
  8. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,477
    there is a relict in your xml:

    Code:
        <!--Promotions DLL Start-->
        <element type="iExtraStrength" minOccurs="0"/>
        <!--Promotions DLL End-->
    		<element type="iCityAttack"/>
    		<element type="iCityDefense"/>
    		<element type="iHillsAttack"/>
    		<element type="iHillsDefense"/>
    		<element type="iKamikazePercent"/>
    		<element type="iRevoltProtection"/>
    		<element type="iCollateralDamageProtection"/>
    		<element type="iPillageChange"/>
    		<element type="iUpgradeDiscount"/>
    		<element type="iExperiencePercent"/>
        <!--Promotions DLL v0.1 Start-->
        <element type="iExtraStrength" minOccurs="0"/>
        <!--Promotions DLL v0.1 End-->
    
    one of them should be removed. ;)
     
  9. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Yeah, it is a PITA but I'm hoping the minor tweak I did works (I didn't test it before I uploaded it). Basically, what I originally did was directly clone the iCombatPercent weights for iExtraStrength then for the "tweak" all I did was add 1 to each of the multipliers for iExtraStrength (going on the logic that it will return a higher number and therefore place a higher value on the promotion if it is available).

    EDIT: Thank you Cybah, I'm going to start my own thread for this so that I don't hijack The_J's thread any further.
     
  10. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    19,723
    Gender:
    Male
    Location:
    MN
  11. mechaerik

    mechaerik Magician

    Joined:
    Oct 28, 2008
    Messages:
    7,064
    Location:
    Los Angeles
    Looks like a whitespace problem to me.
     
  12. hrochland

    hrochland Prince

    Joined:
    Apr 9, 2006
    Messages:
    1,987
    Location:
    Czech Kingdom

    What errors?
    [/QUOTE]

    When I tried paste more then one promotion was functional one only. It´s I think error im my paste way...
    Can you, please, paste here python part of code with Sneak Promotion , Heroic Strenght Promotion and celebrity Promotion combined?

    BTW, water modcomp is excellent. I´m making on animated well model now. If will be model functional, I pasted him...

    thanks
    HROCHland
     
  13. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,756
    Location:
    Germany / Netherlands
    :yup: i also guess so.

    How do you do it?
    When you use Notepad/Wordpad, always select the beginning of the line (not of the text!) when you try to copy + paste it.

    Or try Word, it also shows you the spaces.

    I'll try. I hope, i don't forget it.

    I don't suggest using the Heroic Strenght promotion, because it doesn't work after upgrading a unit (TheLadiesOgre has made a dll version, but you can't compile your own dll, and you also have your own, am i right?).
    I'll maybe take it out of the database.

    Nice, i'll update the model.

    But you should re-download it, there was an error in it. I named the improvement WELL, like the oil well :blush:. -sr has reported the error.

    ->
    Reuploaded the "water" modcomp, to fix that (renamed to WATERWELL, and changed all references).

    I've also reuploaded the respawn promotion. I've cleaned up the code a bit, it will also place ships in coastal cities (if available), and i've added a bit AI, so that the promotion will we applied to AI-controlled units.
     
  14. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    I added the Respawn promotion to my mod and confirm that it is working fine. Just a minor thing, something graphical:



    It would be nice to have that ugly pink marker replaced by i.e. a rising phoenix. Any idea how to fix this??

    EDIT: Forget it. Just change the path in the CvEventManager :blush:
     
  15. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    Here's a small contribution:

    Rising Phoenix button for the Respawn Promotion



    Man, am I talking to myself or what :p
     

    Attached Files:

  16. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    19,723
    Gender:
    Male
    Location:
    MN
    Well how about a or WHAT then, :lol: And thx.
     
  17. hrochland

    hrochland Prince

    Joined:
    Apr 9, 2006
    Messages:
    1,987
    Location:
    Czech Kingdom
  18. cfkane

    cfkane Chieftain

    Joined:
    Feb 7, 2006
    Messages:
    1,196
    Hey J, I've been trying to edit the Hagenbeck function so the buidling will start appearing and jumping at the start of the game. I tried changing the 1890 to 0 as you said, but it didn't work. If we're going by game year, wouldn't I have to change it to -4000?
     
  19. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,756
    Location:
    Germany / Netherlands
    Nice, i'll update both tomorrow :).

    I've said, the second value has to be set to 0 ;).
    For the first, -4000 is right :).




    @hrochland: File is attached :).
     

    Attached Files:

  20. Castor_Troy

    Castor_Troy Chieftain

    Joined:
    Jun 4, 2007
    Messages:
    144
    Location:
    Romania
    I would have another request if you want to do it and think it can be done, i will understand if by various reasons you simply cant do it. :)
    The ideea came from the fact that the christian religious orders ( templar,teuton etc.) were not quite mercenary (well officialy) therefore not fighting anybody would make them give it all they had so all the bonuses i gave them would apply vs every civ even the Papal States. So the ideea is that i try to simulate a morale and doctrine system for them since their "true official" goal was to fight the islam suporters.
    So basically the bonuses of this promotion should apply only vs civs that have as state religion islam.Also for the name if you want to try it i can suggest a few things like Gods_Call, Blood_Feud, Crusader but this are only suggestions, I thought I would through them up maybe they can inspire you for anything better.
    Well im waiting on your call regarding the ideea.

    With all respect,
    Castor_Troy
     

Share This Page