Commanders v. 0.1

The assert comes up whenever I click on a promotion when unit promoting. These promotions don't have the onsalught tag in promotioninfos.xml. Wouldn't checking for a null value fix this assert, besides just deleting the assert?

Code:
	if (getOnslaughtCount != NULL)
	{
		FAssert(getOnslaughtCount() >= 0);
	}
 
hmm i thought i successfully merged this mod into mine (w BBAI) but now my assault mech gets unlimited attacks, regardless if the commander shares the same tile.

for example, a stack of 10 barbarian warriors gets eliminated in one move by the assault mech. it seems that the attack on the first warrior doesnt subtract a move from the mech.

EDIT: ok this behavior happens with any unit with blitz. but not against harder opponents. ill check with a vanilla mod. BTW, im not getting the above error. the mod seems to be working fine.
 
there is the Initiative IV promotion having this effect.
A unit continues to attack unless it gets damaged (or an enemy stack is completely eliminated)

strange thing, the commander didn't have that promotion yet, and even if the commander was far away it would happen.

Also I tried to merge the defender withdrawl on top of this mod, i couldn't get that to kick in during testing, but the effect I described above stopped.

I noticed DW overwrote some "onslaught" code in the SDK, maybe the effect I saw was related to "onslaught"?
 
strange thing, the commander didn't have that promotion yet, and even if the commander was far away it would happen.

Also I tried to merge the defender withdrawl on top of this mod, i couldn't get that to kick in during testing, but the effect I described above stopped.

I noticed DW overwrote some "onslaught" code in the SDK, maybe the effect I saw was related to "onslaught"?

uh yes, maybe its the cause
iirc i was planning to add an onslaught promotion having this effect for units
 
uh yes, maybe its the cause
iirc i was planning to add an onslaught promotion having this effect for units

ok so i should try to remove the onslaught stuff from the SDK?

also in CIV4PromotionInfos.xml

this code breaks the promotions for "can only defend units" like the machine gun.
Code:
<iWithdrawalChange>10</iWithdrawalChange><!-- @MOD Commanders -->

no other units were effected, (like the cannon).
 
ok i removed onslaught from everything, i guess that sort of breaks the last promotion as intended. compiled and appears to work correctly.

i think i may try separating out the commander from the great general unit. i think this is how AND works.

thanks again for crafting this mod, it really makes the great generals useful. i always thought attaching them to a unit was a waste.
 
Ok I compiled my version of the mod (link to download)

Basically I commented out the onslaught code, and broke out the commander into its own unit. When you first get a great general you now have 3 options:
  • can attach great general to unit
  • can join city as instructor
  • can upgrade to commander

changes from original mod (SDK and XML changes):
  • BUG 4.4 compatible
  • removed unfinished onslaught promotion from SDK and XML
  • separated out commanders into their own unit
  • great generals can upgrade to commanders
  • commanders identified by leadership points < 0 (req SDK and XML change)
  • ai values commanders after level 2 (was 4)
  • changed the art for new unit
side note:
Spoiler :

in theory you can make any unit able to get commander promotions by setting
<iLeaderExperience>-1</iLeaderExperience> in Civ4unitinfos.xml

sdk files changed from original mod:
Spoiler :

  • CvUnitAI.cpp
  • CvGameTextMgr.cpp
  • CvInfos.cpp
  • CvInfos.h
  • CvUnit.cpp
  • CvUnit.h
The python file in /screens/ (CvMainInterface.py) is built on the BUG 4.4 version, use the original file for a non-BUG install.

Thanks again to killmeplease for an awesome mod!:goodjob:
 
This is really great guys...can't wait to try it out. I was wondering though....would it be possible to make a unit act as a commander with just a promotion?
 
yeah, all is possible
though making an ordinary unit a commander will require relatively complicated coding to teach AI how to use it as both a combat unit and a commander.
having a separate non-combat unit for the commander is much easier from this perspective.
 
Right...ok. I was just wondering about having different commanders...like a gunship commander that only gives the benefit to the other gunships, while a marine commander gives different benefits to the marine units. Would that work somehow?
 
I was just wondering about having different commanders...like a gunship commander that only gives the benefit to the other gunships, while a marine commander gives different benefits to the marine units. Would that work somehow?

I had mentioned something like this previously, but no one responded to it. In the mod History of the Three Kingdoms, that mods used great generals in a very unique way. Many had names of great generals from the past that could be recruited for gold. They also had a way of generating random heroes (new generals) the same way vanilla ones are made when you attain enough combat experience.

The heroes (generals) in this mod had rankings for different military types. Since this mod was strictly medieval, there was only melee, archer, naval, siege, and mounted. There were rankings for each category and, the higher the ranking, the more promotions that were available.

The generals also attached to a Core unit, but could include other specific units (Legion). If any unit under the heroes command won a battle (or successfully withdrew), the commander gained experience. However, if the core unit was defeated, the general could be captured, could escape, be killed, or simply be reassigned to another surviving unit of his legion. A captured general could also be recruited by the winning side.

I would still like to see something like this for multi-era units. I would love to see the generals that WilliamofOrange is inquiring about and make the generals a major part of the game instead of just a one unit, or small number of units, wonder.

Just some thoughts to add in.
 
There are many great things in the 3K mod...thanks for clearing that up..I couldn't remember how they worked. I plan on using the code from here or there for my mod....which ever is easier. Since, I am doing a modmod of Orbis, this modcomp might be easiest for a first code job.
 
Top Bottom