Creating new unitcombat classes?

Shieldelf

Chieftain
Joined
Dec 12, 2012
Messages
10
Location
America
Hey guys. I was wondering if it was possible to create new unitcombat classes with XML, or if thats something that would have to be done with Lua or DLL. Specifically looking at making a UNITCOMBAT_MAGIC type and a cross between UNITCOMBAT_ARCHER and UNITCOMBAT_MELEE for a fantasy mod.
 
I have created tons of new unitcombat types in my mod with no ill effect. IIRC there was a mention of the vanilla unitcombat classes being linked to animations. Thus if you changed a units unitcombat entry, you likely prevented the animations.

Aside from that, I dont think there should be any issues. Its also a good approach if you plan to use magic type units that can earn promotions that trump other unitcombat classes if you wanted to do a tier based system.
 
Can you explain what you mean by tier based system? And what would I do to create a new unitcombat type? I didnt see the XML when I looked for it
 
The tier comment was just a suggestion on the basis you know what your doing. Kind of like a level 1 wizard combating a level 2 wizard (using the unitcombat values)

As for creating entries, I prefer SQL which is easier on the eyes and to trouble shoot. XML is actually converted to SQL by the game and then read into the game tables.

Code:
INSERT INTO "UnitCombatInfos" (Type, Description)
SELECT 'UNITCOMBAT_INFANTRY','TXT_KEY_UNITCOMBAT_INFANTRY' UNION ALL
SELECT 'UNITCOMBAT_FORTIFIED','TXT_KEY_UNITCOMBAT_FORTIFIED' UNION ALL
SELECT 'UNITCOMBAT_MOTORIZED_INFANTRY','TXT_KEY_UNITCOMBAT_MOTORIZED_INFANTRY' UNION ALL
SELECT 'UNITCOMBAT_CAVALRY','TXT_KEY_UNITCOMBAT_CAVALRY' UNION ALL
SELECT 'UNITCOMBAT_TANK','TXT_KEY_UNITCOMBAT_TANK' UNION ALL
SELECT 'UNITCOMBAT_TANK_DESTROYER','TXT_KEY_UNITCOMBAT_TANK_DESTROYER' UNION ALL
SELECT 'UNITCOMBAT_ASSAULT_GUN','TXT_KEY_UNITCOMBAT_ASSAULT_GUN' UNION ALL
SELECT 'UNITCOMBAT_ARTILLERY','TXT_KEY_UNITCOMBAT_ARTILLERY' UNION ALL
SELECT 'UNITCOMBAT_GROUND_ATTACK','TXT_KEY_UNITCOMBAT_GROUND_ATTACK' UNION ALL
SELECT 'UNITCOMBAT_FAST_BOMBER','TXT_KEY_UNITCOMBAT_FAST_BOMBER' UNION ALL
SELECT 'UNITCOMBAT_MEDIUM_BOMBER','TXT_KEY_UNITCOMBAT_MEDIUM_BOMBER';
 
Back
Top Bottom