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

[MODCOMP] Obtain gold on disband

Discussion in 'Civ4 - Mod Components' started by killmeplease, Jan 13, 2010.

  1. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    If a unit was disbanded inside its cultural borders, owner get :gold: as many as unit's cost in :hammers: dvivded by 4.
    • Effect scales with game speed.
    • AI knows how to use it.
    • There is a hint that shows you how many :gold: you will get:



    Download here

    In source files my code is marked with //@MOD GFD signature.
     
  2. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Awesome! Nice SDK tweaks!
     
  3. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    Thanks!
     
  4. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Looks like a nifty little change, killmeplease. :goodjob:

    I'm guessing it wouldn't be difficult to add a description of how much gold you'd receive by hovering over the Disband button?
     
  5. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    you gave good point, i have to do that
     
  6. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Does the AI ever voluntarily disband units? If so, could it be taught to prefer doing it inside its borders so as to get the extra gold?
     
  7. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Yes, the AI does disband troops that are not very high levels and are weaker, especially when the AI has financial trouble.
     
  8. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    it would be pretty simple to include inside-borders test into the criterion function to make AI disbanding units on its own territory for first. I'll put a new modcomp version into downloads database when i get button hint and additional AI logic working.

    Thanks for feedback!
     
  9. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Great!

    With those two features it will be ready for inclusion in PIG Mod. :)
     
  10. Opera

    Opera Chieftain

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    I'm very interested too ;)
     
  11. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    i have all the work done.
    and i am just wondering how to name the modcomp: "gold for disbanding" - is it grammatically correct for english language?
     
  12. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    version 1.0 released
     
  13. Opera

    Opera Chieftain

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Awesome! Thank you :goodjob:
     
  14. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    im' glad you like it :)
     
  15. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,580
    good idea, is it possible to enable this only for few units?
     
  16. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    I'd imagine you would create a new boolean XML tag for units, and check that it is true in the code that killmeplease added CvDLLWidget and CvUnit.

    Nice job, BTW Killmeplease. Merged into A New Dawn.
     
  17. Lowenar

    Lowenar Chieftain

    Joined:
    Feb 12, 2010
    Messages:
    7
    This is neat, I'd like to have something like this in my game.

    But is it possible to make it so disbanding the unit gives the nearest city (possibly enemy) a production bonus instead of money, similar to chopping?
     
  18. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    as Afforess said, you have to check if unit is scrappable upon your criteria in appropriate functions (CvUnit::kill() and the another one showing popup, just do not recall its name).

    great news!
    my work is useful :cool:

    yeah i think it would be pretty easy to mod my modcomp for this. just change gold to production and find a nearest city.
     
  19. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    there is a little problem in your modcomp: fishing boat -> fishnet -> gold you should not get.
     
  20. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    thanks Cybah!
    Bug fixed.
    download updated to version 1.1
     

Share This Page