Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline sub4gman  
#1 Posted : Friday, August 9, 2024 7:26:10 PM(UTC)
sub4gman
Private
Joined: 4/8/2020(UTC)
Posts: 21

Thanks: 4 times
How to add suic*de skill to a unit? (Like GLA Terrorist's Detonate Now skill).
Sponsor
Offline Nooboi  
#2 Posted : Saturday, August 10, 2024 10:57:38 AM(UTC)
Nooboi
Private
Joined: 10/22/2021(UTC)
Posts: 31

Thanks: 6 times
First of all, you will need the weapon for the damage that you unit does in weapon.ini
ex. (terrorist's damage weapon)
Quote:
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
Quote:

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
Quote:
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

Edited by user Saturday, August 10, 2024 10:58:40 AM(UTC)  | Reason: fixing quotations

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.