Commanders v. 0.1

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.
 
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?
 
Since Afforess put this in A New Dawn, I using it and I must say it is a great idea!:goodjob::hatsoff:
 
Hello,

Using Great Generals this way and the Regular way, At a tactical view which is best?
 
Did you also increase the chance that AI will use great generals instead of settling them into a city?
 
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.
 
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.
 
From reading through this it sounds like there are problems merging with Advanced combat odds, has anyone gotten through those easily?
 
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.
 
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.
 
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.
 
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.
 

Attachments

  • commander unit.txt
    6 KB · Views: 82
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:
 
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.
 
Top Bottom