Posted by: Resist - Tuesday, May 16, 2017 1:05:23 PM
So I added this to a unit :
[code=plain] 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[/code]
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 ?
Posted by: mr_hymn_ - Tuesday, May 16, 2017 1:31:24 PM
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.
[code=plain]
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
[/code]
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.
Posted by: Resist - Tuesday, May 16, 2017 2:49:36 PM
Lol, How stupid I can be.
yeah I forgot it. Thank Mr Hymn it works perfectly now
Posted by: mr_hymn_ - Tuesday, May 16, 2017 10:08:26 PM