sub4gman
  • sub4gman
  • 51% (Neutral)
  • Private Topic Starter
a year ago
How to add suic*de skill to a unit? (Like GLA Terrorist's Detonate Now skill).
Sponsor
Nooboi
  • Nooboi
  • 58.5% (Neutral)
  • Private
a year ago
First of all, you will need the weapon for the damage that you unit does in weapon.ini
ex. (terrorist's damage weapon)

Weapon SuicideDynamitePack
PrimaryDamage = 150.0
PrimaryDamageRadius = 6.0
SecondaryDamage = 30.0
SecondaryDamageRadius = 25.0
AttackRange = 5.0 ; must be very close to use this weapon!
DamageType = EXPLOSION
DeathType = SUICIDED
WeaponSpeed = 99999.0
ProjectileObject = NONE
DamageDealtAtSelfPosition = Yes ; this is a suicide bomber... remember?
RadiusDamageAffects = SELF SUICIDE ALLIES ENEMIES NEUTRALS NOT_SIMILAR
DelayBetweenShots = 0
ClipSize = 1
ClipReloadTime = 0
AutoReloadsClip = No
FireFX = WeaponFX_SuicideDynamitePackDetonation
FireSound = CarBomberDie
End

;------------------------------------------------
Weapon TerroristSuicideWeapon ; this weapon is the weapon that the terrorist unit uses to kill itself
LeechRangeWeapon = Yes
AttackRange = 1.0 ; increase this if you want to increase its distance from the enemy to explode
PrimaryDamage = 999999.0
PrimaryDamageRadius = 1.0
DamageDealtAtSelfPosition = Yes ; deals damage at its position
RadiusDamageAffects = SELF SUICIDE ; deals damage only to itself
DamageType = EXPLOSION
DeathType = SUICIDED ;type of death
WeaponSpeed = 99999.0
DelayBetweenShots = 0
ClipSize = 1 ; so he can only use it once
ClipReloadTime = 0
AutoReloadsClip = No ;so he can only use it once
End



there are also key factors in the code of the terrorist code it self


WeaponSet ; this weapon is what he uses to kill himself NOTE: THE DAMAGE MUST BE ENOUGH TO ONE SHOT THE UNIT
Conditions = None
;Kill himself so we can use FireWeaponWhenDead to fire the real weapon -- and use UNRESISTABLE
;damage to do ini logic for type of death to play -- unresistable for success.
Weapon = PRIMARY TerroristSuicideWeapon
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag_ExplodeOnDeath
; ^^this is the moduletag / code that triggers when terrorist dies, just paste it at the end of unit's code / object before End line
DeathWeapon = SuicideDynamitePack ; what type of weapon will fire when the unit dies (from weapon.ini)
StartsActive = Yes ; automatically turned on
DeathTypes = NONE +SUICIDED +CRUSHED +SPLATTED +LASERED +BURNED +EXPLODED ; what kind of DeathType weapon that triggers when you die (again, found in the weapon.ini), or if you want it to trigger in any type of him dying, just put ALL
End


^^^
if i wanna make a terrorist that explodes anytime

Behavior = FireWeaponWhenDeadBehavior ModuleTag_ExplodeOnDeath
; ^^this is the moduletag / code that triggers when terrorist dies, just paste it at the end of unit's code / object before End line
DeathWeapon = SuicideDynamitePack ; what type of weapon will fire when the unit dies (from weapon.ini)
StartsActive = Yes ; automatically turned on
DeathTypes = ALL ;just put ALL
End




you can ask me questions if you are still confused