Resist
  • Resist
  • 50.25% (Neutral)
  • Private Topic Starter
8 years ago
So I added this to a unit :
  Behavior = SpecialAbility ModuleTag_07
    SpecialPowerTemplate = SpecialAbilityTankHunterNukeTNTAttack
    UpdateModuleStartsAttack = Yes
    InitiateSound = TankHunterVoiceTNT
  End
  Behavior = SpecialAbilityUpdate ModuleTag_08
    SpecialPowerTemplate = SpecialAbilityTankHunterNukeTNTAttack
    StartAbilityRange = 12.0
    PreparationTime = 3000
    SpecialObject = TNTStickyNukeBomb
    MaxSpecialObjects = 4
    SpecialObjectsPersistWhenOwnerDies = No ;Charges are removed instantly when owner dies (nobody can detonate).
    SpecialObjectsPersistent = Yes          ;Charges are persistent till lifetime expires or owner detonates them.
    UniqueSpecialObjectTargets = Yes        ;This prevents multiple charges placed on the same object.
    Flee
of course I added to specialpower.ini "SpecialPower SpecialAbilityTankHunterNukeTNTAttack
Enum = SPECIAL_TANKHUNTER_TNT_ATTACK
ReloadTime = 12500 ; in milliseconds
PublicTimer = No
End" without quotes.

I had TNTStickyNukeBomb in factionunit.ini ,
Also when I remove "Nuke" from the special ability template it works but I want a reload time.
What can I do to have a reload time without affecting the normal TNT attack, What did I miss ?
Sponsor
mr_hymn_
8 years ago
As I see your commandbutton must not use from normal TNT attack. I see that you did not mentioned about it so maybe you forgot.

The normal tank hunter have it's own command button which refer to SpecialAbilityTankHunterTNTAttack (Without "Nuke")
You've stated it works without "Nuke" So yeah I think you might forgot this one.


CommandButton Command_ChinaInfantryTankHunterTNTAttack
  Command                 = SPECIAL_POWER
  SpecialPower            = SpecialAbilityTankHunterTNTAttack
  Options                 = NEED_SPECIAL_POWER_SCIENCE OK_FOR_MULTI_SELECT NEED_TARGET_ENEMY_OBJECT NEED_TARGET_NEUTRAL_OBJECT
  TextLabel               = CONTROLBAR:TNTAttack
  ButtonImage             = SSTNT
  CursorName              = TankHunterTNTAttack
  InvalidCursorName       = PlaceChargeInvalid
  ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:ToolTipChinaFireTankHunterTNTAttack
End

CommandSet ChinaInfantryTankHunterCommandSet
  1 = Command_ChinaInfantryTankHunterTNTAttack
  11 = Command_AttackMove
  13 = Command_Guard
  14 = Command_Stop
End

You see? an original specialpower code is refer to SpecialAbilityTankHunterTNTAttack.

You have to clone a button and make your own commandbutton and commandset otherwise it will effect the normal unit.
Resist
  • Resist
  • 50.25% (Neutral)
  • Private Topic Starter
8 years ago
Lol, How stupid I can be.
yeah I forgot it. Thank Mr Hymn it works perfectly now
mr_hymn_
8 years ago
When I was new to modding. I forgot this one too.