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

Commanders v. 0.1

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

  1. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    Afforess thank you for the notice, i'll fix it. Also its great to see Commanders included into New Dawn mod!

    WilliamOfOrange you just have not to copy the code marked with //@MOD DWM sig, only with //@MOD Commanders one. I've included DWM to make 'tactics' default commander promotion to look better. Generally DWM is not required for Commanders.

    Also the current version of modcomp uses DWM 1.0 while DWM 2.0 is available.

    P.S. i have literally no free time now so i can't maintain my modcomps. I hope i will be able to release a final version of Commanders by the end of this month.
     
  2. WilliamOfOrange

    WilliamOfOrange Chieftain

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    I have another question. I was wondering if by making different types of GGs (for a preset game, not to have them spawn from GGPs) would it be possible to have an infantry commander for the infantry troops and a cavalry commander for cavalry troops? I would like to have different units affected with varying promotions or abilities when in the presence or range of different commanders. For example, a Marine Commander giving the Amphibious promotion to those all units except for siege units or Cavalry Commander giving Flanking to other mounted units but Formation to melee units. How does that sound? Would something like this be possible?
     
  3. NBAfan

    NBAfan boss

    Joined:
    Aug 30, 2007
    Messages:
    3,351
    Location:
    Dallas TX,United States
    Since Afforess put this in A New Dawn, I using it and I must say it is a great idea!:goodjob::hatsoff:
     
  4. BobeBrown

    BobeBrown Chieftain

    Joined:
    Oct 4, 2009
    Messages:
    255
    Hello,

    Using Great Generals this way and the Regular way, At a tactical view which is best?
     
  5. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Did you also increase the chance that AI will use great generals instead of settling them into a city?
     
  6. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,326
    Location:
    israel
    hi,

    can anyone help me merge a section of cvunit.cpp with the changes in bbai 1 cvunit.cpp:

    //@MOD Commanders:
    //adjust level thresholds to a world size.
    if (isCommander())
    {
    iExperienceNeeded = iExperienceNeeded * GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getCommandersLevelThresholdsPercent() / 100;
    }
    //end mod

    this section is problematic since in bbai the entire part with the iExperienceNeeded was removed...so i dont know what to do.

    hope someone can help, thanks in advance.
     
  7. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    You don't need to keep that Keldath, since he never uses the XML adjustments anyway. That means you can delete the code he added to CvWorldInfo too.
     
  8. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,326
    Location:
    israel
    man o man! thanks afforess!
     
  9. Admiral Armada

    Admiral Armada The Admiral of Armadas

    Joined:
    Sep 11, 2004
    Messages:
    462
    Location:
    Terra
    From reading through this it sounds like there are problems merging with Advanced combat odds, has anyone gotten through those easily?
     
  10. Vanya

    Vanya Chieftain

    Joined:
    Oct 30, 2011
    Messages:
    37
    hi killmeplease,

    1 thanks for your work!
    2 how can i assign the comanding power and the relevant bonus dued to promotions to a unit? you see i wanna to continue adding extra XP to unit merging the GG to a stack and to continue to grant the unit special promotion as medic III, combat V and so on.

    with your mod i cannot if i wanna to boost my stack with your promotion.
    so i've created a new unit the Commander who basically is a swordsman but is entitled to receive your promotion (he gets only your promotions) and is limited in 4 per player and cost 200 hammer.

    but the game refuse to grant the stack of troops the bonuses dued to promotions of the new unit commander.

    all is fine if instead of commander unit is present a GG with your promotions added by editor (but he can't get them in the normal play). please help me.
     
  11. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    Hello Vanya!

    It's strange commanders cant get promotions. Normally you can either attach it to a unit (and give xp to a stack) or move around with a stack, not attaching it to any unit. In the latter case GG would receive XP when units of his stack fight, and level up, getting promotions.

    I've made the commanders mod long time ago so i may not be 100% right, but AFAIR stack bonuses checking is linked to a unit's combat type: algorhitm loops through nearby units, seeks for commander (GG), and sees what promotions it has, and applies their effects. See source code (*.cpp) for clearing this.

    OFC you can change the code to check all the units for stack promotions, not only GGs. That will make the game to run a bit slower though.
     
  12. Vanya

    Vanya Chieftain

    Joined:
    Oct 30, 2011
    Messages:
    37
    hi killmeplease,

    thanks for so quick response

    i've not explained myself.

    actually with your mod the GG can

    merge with a unit in a stack and give 20 xp to all the unit in the stack and boost 1 specific unit with free promotion.

    or

    boost the entire stack with his promotion (from your mod)

    but so i've to choose what to do with my GG. i can't get both bonuses. the option offered by your mod is better but so i lose the special promotion offered by the leader.

    i would like to maintain the function of the GG as is in the original game (give a special leader promotion to a unit sacrificing the GG and mergin it with the stack) AND HAVE the chance to boost a limited number of army with a special unit called commander with a relative high contruction cost who give the bonus given by your promotions. this way i can lead my troops with the commander unit and eventually have some special promotion mergin the GG. but i don't know how tell the game the "commander" unit is a commanding unit and it must extend your promotion to a number of unit equal to control points.

    eventually you could tell me how make your promotions active (and extended to a stack) ALSO when the GG is merged with a unit/stack.

    thanks.
     
  13. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    that unit should have a type of UNITCOMBAT_COMMANDER and iControlPoints > 0 (See GG's entry in unitinfo.xml)
     
  14. Vanya

    Vanya Chieftain

    Joined:
    Oct 30, 2011
    Messages:
    37
    i've thought that and i've edited accordingly the xml. but the game does not give the promotion bonuses of the commander to the stack. actually i think there is a line in the source code (.cpp) which states how identify the commanding unit. but i do not know what is the line. and maybe also the issue is in the python code (for issue i intend where is the line whic identifies the commanding unit)

    in the attach is my xml text relative to the "commander" unit

    help me. plz. i don't know how to make my modify to work.

    p.s. my GG has a type of combat: none and work the same.
     

    Attached Files:

  15. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    I've looked into sources, commander is determined by leader experience.
    So you have to add leaderexperience to your unit or to rewrite the cvUnit:isCommander() function
     
  16. Vanya

    Vanya Chieftain

    Joined:
    Oct 30, 2011
    Messages:
    37
    i've edited the "commander" unit adding 1 leader experience point and it worked.
    thanks. now i can have a commanding unit and a great general to grant the special promotion medic III as well.

    thanks :goodjob:
     
  17. stolenrays

    stolenrays Chieftain

    Joined:
    Aug 2, 2009
    Messages:
    2,061
  18. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    its about onslaught promotion.
    you can remove it
     
  19. Jennvare

    Jennvare Chieftain

    Joined:
    Jan 10, 2010
    Messages:
    371
    Have you considered using great generals in the same way that the Mod History of the Three Kingdoms. They use commanders well, but the commanders are set for medieval units (melee, ranged, mounted, naval, and siege). I was wondering if you could make one similar that also deals with modern units in later eras.

    Something to consider. I love the way HoTK does their generals. Would like to see a modern multi-era version.
     
  20. stolenrays

    stolenrays Chieftain

    Joined:
    Aug 2, 2009
    Messages:
    2,061

Share This Page