[DLL] R.E.D. Combat

Status
Not open for further replies.
Also, I found a bug. When perform a ranged attack, the "Approx DMG Inflicted" always gives 0.(see attachment)

Why would a ranged attack inflict damage on the attacker?
 
Hi whoward69, oh yeah my mistake :blush:
Hi Gedemon, I code I posted is using MustAbortAttack function but it crashes even I return true.
 
Quick question - in order to use different parts of your dll do I need to modify the GlobalDefines files and add different lines (GAMEOPTION_CAN_STACK_IN_CITY)?

Will this let me have 2 units per turn? I'd like to have 1 combat class (infantry, tanks, etc) stack with 1 support class (artillery, medics, engineers, machineguns, etc).

Thanks!
-Smitty
 
Activation are made via options, not defines.

You set it up either by adding it to the option table (XML or SQL) or Lua

SQL example
Code:
INSERT INTO GameOptions (Type, "Default", Visible) VALUES ( 'GAMEOPTION_CAN_STACK_IN_CITY', 1, 0 );

Lua example
Code:
PreGame.SetGameOption("GAMEOPTION_CAN_STACK_IN_CITY", 1)

Note that this option is used to allow any unit to stack with other in a city (infinite amount), you won't have to set any option for your class mechanism.

For 2 stacking class, I'm using "SetIsSpecialType(boolean)" to units, it's always available when the DLL is active.

When an unit is created, I check if its one of the "support" unit in the mod (Howitzer, Field Guns, AA-Guns, Tank Destroyer, Assault Gun, ...) then initialize it with
Code:
unit:SetIsSpecialType(true)

Now that unit will be able to stack with" classic" units (infantries, tanks, etc...) but not with any other unit initialized this way.

SetIsSpecialType is not the simplest way to create such a mechanism, but I've used it to allow temporary stacking of any unit that can be remove it with unit:SetIsSpecialType(false)

I plan to add a more specific feature: create a new table "UnitStackingClass" and a new corresponding tag in the UnitClasses table.

You could then simply add a "COMBAT" class type and a "SUPPORT" class type in "UnitStackingClass", set the "StackingClass" tags for each UnitClasses to be one or the other, and the DLL would then allow stacking of units that have different "StackingClass"
 
yes, it's fixed in the R.E.D. DLL for BNW.

The old version for Vanilla and G+K is not supported anymore (not enough free time), but the (updated) code is still available on GitHub.
 
Moderator Action: one post moved to the R.E.D. DLL for BNW thread to prevent confusion between versions
 
Status
Not open for further replies.
Top Bottom