#  ![](https://www.realm667.com/media/kunena/topic_icons/realm667/user/weapon.png) Weapon Improvement

##

- **cmw1986**
- ![cmw1986's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg) Topic Author
- Wraith
- ![Wraith](https://www.realm667.com/media/kunena/ranks/rank_41_wraith.png)

 Less More- Posts: 17
-
-

   9 years 6 months ago - 9 years 6 months ago [\#5403](#5403) by cmw1986  *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5403 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")* was created by *cmw1986*

 Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:

 Warning: Spoiler!

Code:

ACTOR DaffyDuck { Health 20 Radius 20 Height 56 Mass 100 Speed 8 PainChance 200 PainChance "Fireball", 255 PainChance "Fireworks", 255 PainChance "Disintegrate", 200 PainChance "VacuumSuction", 255 DamageFactor "VacuumSuction", 1 DamageFactor "VacuumCannon", 99 DamageFactor "DaffyDuck", 0.0 DamageFactor "Fireworks", 1 DropItem "Pistol", 255 Obituary "?" Monster +DONTHARMCLASS +DONTHARMSPECIES +FLOORCLIP SeeSound "daffy/sight" ActiveSound "daffy/active" AttackSound "daffy/attack" PainSound "daffy/pain" DeathSound "daffy/death" States { Spawn: DFFY AB 10 A_Look Loop See: DFFY AABBCCDD 4 A_Chase Loop Missile: DFFY E 0 A_Jump (128, "LeftMissile") DFFY E 10 A_FaceTarget DFFY E 0 BRIGHT A_PlaySound ("daffy/attack") DFFY F 8 BRIGHT A_CustomBulletAttack (22.5, 0, 1, random(1, 5) *3, "DaffyDuckBullet", 0, CBAF_NORANDOM) DFFY E 8 GoTo See LeftMissile: DFFY G 10 A_FaceTarget DFFY G 0 BRIGHT A_PlaySound ("daffy/attack") DFFY H 8 BRIGHT A_CustomBulletAttack (22.5, 0, 1, random(1, 5) *3, "DaffyDuckBullet", 0, CBAF_NORANDOM) DFFY G 8 GoTo See Pain: DFFY I 3 DFFY I 3 A_PlaySound ("daffy/pain1") GoTo See Pain.Fireball: DFFY I 3 DFFY I 3 A_PlaySound ("daffy/pain2") GoTo See Pain.Fireworks: DFFY I 3 DFFY I 3 Loop Pain.VacuumSuction: DFFY I 0 HealThing (1) DFFY I 3 A_FaceTarget DFFY I 0 A_Recoil (-10) DFFY I 3 GoTo See Death: DFFY J 5 A_Scream DFFY K 5 A_NoBlocking DFFY L 5 DFFY M 5 DFFY N 5 DFFY O -1 Stop Death.Fireball: NULL A 1 A_GiveToTarget ("Points", 20) DFFY J 0 A_HideThing DFFY J 0 A_Fall DFFY J 0 A_SpawnItem ("DaffyBurnDeath", 1, 0, 0) NULL A -1 Stop Death.Disintegrate: ASH0 A 5 ASH0 B 5 A_Scream ASH0 C 5 A_NoBlocking ASH0 D 5 ASH0 E 5 ASH0 F 5 ASH0 G 5 ASH0 H 5 ASH0 I -1 Stop Death.VacuumCannon: TNT1 A 0 A_GiveToTarget ("VacCanAmmo", 1) TNT1 A 0 A_GiveToTarget ("VacDaffy", 1) DFFY I 3 DFFY I 3 A_Pain Stop Crush: FLT0 A -1 A_ChangeFlag ("FLATSPRITE", TRUE) Stop Raise: DFFY ONM 5 DFFY LKJA 5 DFFY A 0 A_PlaySound ("daffy/raised") DFFY A 0 A_LookEx (LOF_NOSEESOUND) GoTo See } }

Code:

ACTOR Fireworks : Weapon { Scale 0.75 Obituary "?" AttackSound "" Inventory.InterHubAmount 0 Inventory.PickupMessage "Fireworks!" Inventory.PickupSound "misc/w_pkup" Weapon.SelectionOrder 100 Weapon.AmmoType "FireworksAmmo" Weapon.AmmoGive 100 Weapon.AmmoUse 1 +WEAPON.CHEATNOTWEAPON States { Spawn: BFWK A -1 Loop Select: TNT1 A 1 A_Raise Loop Ready: TNT1 A 1 A_WeaponReady Loop Fire: TNT1 A 0 A_TakeInventory ("FireworksAmmo", 1) TNT1 A 1 A_SpawnItemEx ("FireworksLighting") Hold: TNT1 A 1 TNT1 A 1 A_ReFire GoTo Ready Deselect: TNT1 A 1 A_Lower Loop } } ACTOR FireworksLighting { Radius 8 Height 8 Damage (1) DamageType "Fireworks" Activation THINGSPEC_Activate Projectile +BUMPSPECIAL +DONTSQUASH +FORCEPAIN +NOBLOCKMAP +NOEXPLODEFLOOR +NOGRAVITY +NOLIFTDROP +NOTELEOTHER +RANDOMIZE States { Spawn: TNT1 A 0 FWRK AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT Wait Active: FFX1 D 1 TNT1 A 0 A_GiveInventory ("Cwr1", 1) TNT1 A 0 A_JumpIfInventory ("Cwr1", random(10, 350), 1) Loop TNT1 A 0 A_SpawnItemEx ("FFX2") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 A 0 A_SpawnItemEx ("FireworksBall1", 0, 0, 0, 0, 0, random(8, 10)) Stop } } ACTOR FireworksBall1 : FireworksLighting { Scale 0.080 States { Spawn: TNT1 A 0 TNT1 A 0 A_Jump (128, "SpawnCB1") TNT1 A 0 A_Jump (128, "SpawnCB2") GoTo Spawn2 SpawnCB1: TNT1 A 0 A_GiveInventory ("Cwr3", 0) TNT1 A 0 A_Jump (128, "SpawnCB2") GoTo Spawn2 SpawnCB1S: TNT1 A 0 A_SpawnItemEx ("FFX3", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0)) TNT1 A 0 A_JumpIfInventory ("Cwr1", random(130, 200), "SpawnCB1E") GoTo Spawn2S SpawnCB1E: TNT1 A 0 A_TakeInventory ("Cwr3", 0) GoTo Spawn2 SpawnCB2: TNT1 A 0 A_GiveInventory ("Cwr2", random(1, 5)) GoTo Spawn2 Spawn2: TNT1 A 0 A_JumpIfInventory ("Cwr3", 1, "SpawnCB1S") Spawn2S: TNT1 A 0 A_JumpIfInventory ("Cwr2", 5, "Spawn2C5") TNT1 A 0 A_JumpIfInventory ("Cwr2", 4, "Spawn2C4") TNT1 A 0 A_JumpIfInventory ("Cwr2", 3, "Spawn2C3") TNT1 A 0 A_JumpIfInventory ("Cwr2", 2, "Spawn2C2") TNT1 A 0 A_JumpIfInventory ("Cwr2", 1, "Spawn2C1") GoTo Spawn2C6 Spawn2C1: PENT A 1 BRIGHT GoTo Spawn3 Spawn2C2: PENT B 1 BRIGHT GoTo Spawn3 Spawn2C3: PENT C 1 BRIGHT GoTo Spawn3 Spawn2C4: PENT D 1 BRIGHT GoTo Spawn3 Spawn2C5: PENT E 1 BRIGHT GoTo Spawn3 Spawn2C6: FFX1 D 1 GoTo Spawn3 Spawn3: TNT1 A 0 A_GiveInventory ("Cwr1", 1) TNT1 A 0 A_JumpIfInventory ("Cwr1", random(200, 400), "Spawn5") TNT1 A 0 A_GiveInventory ("Cwr4", 1) TNT1 A 0 A_JumpIfInventory ("Cwr4", 0, "Spawn4") GoTo Spawn2 Spawn4: TNT1 A 0 ThrustThingZ (0, -1, 0, 1) TNT1 A 0 A_TakeInventory ("Cwr4", 0) GoTo Spawn2 Spawn5: TNT1 A 0 A_SpawnItemEx ("FFX1") TNT1 A 0 A_SpawnItemEx ("FlashFX") GoTo Spawn6 Spawn6: TNT1 A 0 A_JumpIfInventory ("Cwr2", 7, "S6") TNT1 A 0 A_JumpIfInventory ("Cwr2", 6, "C6") TNT1 A 0 A_JumpIfInventory ("Cwr2", 5, "C5") TNT1 A 0 A_JumpIfInventory ("Cwr2", 4, "C4") TNT1 A 0 A_JumpIfInventory ("Cwr2", 3, "C3") TNT1 A 0 A_JumpIfInventory ("Cwr2", 2, "C2") TNT1 A 0 A_JumpIfInventory ("Cwr2", 1, "C1") TNT1 A 0 A_GiveInventory ("Cwr2", random(1, 7)) Loop S1: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS1", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop S2: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS2", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop S3: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS3", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop S4: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS4", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop S5: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS5", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop S6: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExpS6", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C1: TNT1 A 0 A_Jump (128, "S1") TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp1", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C2: TNT1 A 0 A_Jump (128, "S2") TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp2", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C3: TNT1 A 0 A_Jump (128, "S3") TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp3", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C4: TNT1 A 0 A_Jump (128, "S4") TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp4", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C5: TNT1 A 0 A_Jump (128, "S5") TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp5", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C6: TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp6", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop } } ACTOR FireworksExpS1 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX1 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp1", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExpS2 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX2 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp2", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExpS3 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX3 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp3", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExpS4 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX4 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp4", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExpS5 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX5 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp5", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExpS6 { Radius 2 Height 2 Speed 0 Scale 1.10 Projectile States { Spawn: TNT1 A 0 BRIGHT TNT1 A 1 GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_GiveInventory ("Cwr2", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr2", random(120, 450), "Spawn4") TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Spawn4: TNT1 A 0 A_SpawnItemEx ("FFX1S") TNT1 A 0 A_SpawnItemEx ("FlashFX") TNT1 A 0 A_TakeInventory ("Cwr2", 0) TNT1 A 0 A_GiveInventory ("Cwr2", random(1, 5)) TNT1 A 0 A_JumpIfInventory ("Cwr2", 5, "C5") TNT1 A 0 A_JumpIfInventory ("Cwr2", 4, "C4") TNT1 A 0 A_JumpIfInventory ("Cwr2", 3, "C3") TNT1 A 0 A_JumpIfInventory ("Cwr2", 2, "C2") TNT1 A 0 A_JumpIfInventory ("Cwr2", 1, "C1") C1: TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp1", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C2: TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp2", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C3: TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp3", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C4: TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp4", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop C5: TNT1 AAAAAAAAAAA 0 A_SpawnItemEx ("FireworksExp5", 0, 0, 0, random(-2.0, 2.0), random(-2.0, 2.0), random(-2.0, 2.0)) Stop Death: TNT1 A 10 Stop } } ACTOR FireworksExp1 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX1 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Death: TNT1 A 10 Stop } } ACTOR FireworksExp2 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX2 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Death: TNT1 A 10 Stop } } ACTOR FireworksExp3 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX3 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Death: TNT1 A 10 Stop } } ACTOR FireworksExp4 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX4 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Death: TNT1 A 10 Stop } } ACTOR FireworksExp5 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT FWX5 A 1 BRIGHT GoTo Spawn2 Spawn2: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn3") GoTo Spawn Spawn3: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn Death: TNT1 A 10 Stop } } ACTOR FireworksExp6 { Radius 2 Height 2 Speed 0 Scale 0.70 Projectile States { Spawn: TNT1 A 0 BRIGHT TNT1 A 0 A_GiveInventory ("Cwr2", random(1, 5)) Spawn2: TNT1 A 0 A_JumpIfInventory ("Cwr2", 5, "C5") TNT1 A 0 A_JumpIfInventory ("Cwr2", 4, "C4") TNT1 A 0 A_JumpIfInventory ("Cwr2", 3, "C3") TNT1 A 0 A_JumpIfInventory ("Cwr2", 2, "C2") TNT1 A 0 A_JumpIfInventory ("Cwr2", 1, "C1") C1: TNT1 A 0 BRIGHT FWX1 A 1 BRIGHT GoTo Spawn3 C2: TNT1 A 0 BRIGHT FWX2 A 1 BRIGHT GoTo Spawn3 C3: TNT1 A 0 BRIGHT FWX3 A 1 BRIGHT GoTo Spawn3 C4: TNT1 A 0 BRIGHT FWX4 A 1 BRIGHT GoTo Spawn3 C5: TNT1 A 0 BRIGHT FWX5 A 1 BRIGHT GoTo Spawn3 Spawn3: TNT1 A 0 BRIGHT A_GiveInventory ("Cwr1", 1) TNT1 A 0 BRIGHT A_JumpIfInventory ("Cwr1", random(30, 50), "Spawn4") GoTo Spawn2 Spawn4: TNT1 A 0 BRIGHT ThrustThingZ (0, -2, 0, 1) TNT1 A 0 BRIGHT A_TakeInventory ("Cwr1", 0) GoTo Spawn2 Death: TNT1 A 10 Stop } } ACTOR FFX1 { Radius 2 Height 2 Speed 0 Scale 1.80 +DONTSQUASH +NOBLOCKMAP +NOGRAVITY +NOLIFTDROP +NONSHOOTABLE +NOTARGET +NOTELEOTHER States { Spawn: FFX1 A 0 BRIGHT FFX1 A 2 BRIGHT A_FadeOut Wait } } ACTOR FFX1S : FFX1 { Scale 0.80 States { Spawn: TNT1 A 0 BRIGHT FFX1 A 2 BRIGHT A_FadeOut Wait } } ACTOR FFX2 : FFX1 { Scale 1.50 States { Spawn: TNT1 A 0 BRIGHT FFX1 B 2 BRIGHT A_FadeOut Wait } } ACTOR FFX3 : FFX1 { Scale 0.60 States { Spawn: TNT1 A 0 BRIGHT FFX1 C 2 BRIGHT A_FadeOut Wait } } ACTOR FlashFX : FFX1 { States { Spawn: TNT1 A 0 BRIGHT TNT1 A 1 BRIGHT Light_ChangeToValue (5, 180) TNT1 A 0 BRIGHT Light_ChangeToValue (5, 66) Stop } } ACTOR Cwr1 : Inventory { Inventory.MaxAmount 1000 } ACTOR Cwr2 : Inventory { Inventory.MaxAmount 1000 } ACTOR Cwr3 : Inventory { Inventory.MaxAmount 1 } ACTOR Cwr4 : Inventory { Inventory.MaxAmount 7 } ACTOR FireworksAmmo : Ammo { Scale 0.25 Inventory.Amount 100 Inventory.PickupMessage "You picked up some Paintball, don't eat it." Inventory.PickupSound "misc/i_pkup" Inventory.Icon "FWRKA0" States { Spawn: TNT1 A 1 Loop } }

 Last edit: 9 years 6 months ago by Blue Shadow. Reason: Spoilered the code.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **MagicWazard**
- ![MagicWazard's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar517.png)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 808
-
-
-
-

   9 years 6 months ago [\#5404](#5404) by MagicWazard  Replied by *MagicWazard* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5404 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Ooooh...that's tricky. Offhand, I don't really have a good solution for this. It's kind of an odd function, as simple as it may seem. I'll let you know if I come up with any suggestions. Maybe Blue Shadow will have an idea; he's very good at coding complex behaviors. Don't be afraid to ask on the ZDoom forums, too; there's a lot more traffic there, so a larger number of technically-inclined folks may see your question.

Also, for real long posts like this, you may want to spoiler out the contents, so as to prevent the need to perform lots of scrolling. ![:)](https://www.realm667.com/media/kunena/emoticons/cacsmi.gif ":)")

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **cmw1986**
- ![cmw1986's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg) Topic Author
- Wraith
- ![Wraith](https://www.realm667.com/media/kunena/ranks/rank_41_wraith.png)

 Less More- Posts: 17
-
-

   9 years 6 months ago - 9 years 6 months ago [\#5406](#5406) by cmw1986  Replied by *cmw1986* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5406 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Okay then, I'll ask him here since he's also a moderator on this forum.

@Blue Shadow: do you know what to do about my request/problem here?...

Peace!
-cmw1986

 Last edit: 9 years 6 months ago by cmw1986.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **MagicWazard**
- ![MagicWazard's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar517.png)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 808
-
-
-
-

   9 years 6 months ago - 9 years 6 months ago [\#5407](#5407) by MagicWazard  Replied by *MagicWazard* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5407 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 In the meanwhile, I came up with an idea:
*Right before the firework projectile "dies" and spawns its pyrotechnic effects, set its damage type to a new type (e.g. "FireworkDeath") using A_SetDamageType. Ensure it deals at least 1 point of damage using this new type.
*Give your monster a pain chance of 256 for the new damage type "FireworkDeath". Also give it a new pain state; Pain.FireworkDeath.
*In the monster's Pain.FireworkDeath state, set the monster's mass to 0 using A_SetMass; give the monster the NOGRAVITY flag using A_ChangeFlag; then, use ThrustThingZ to launch it into the air. Once it reaches an appropriate height (matching the firework pyrotechnics' height), you can then have the monster kill itself somehow.

 Last edit: 9 years 6 months ago by MagicWazard.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **cmw1986**
- ![cmw1986's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg) Topic Author
- Wraith
- ![Wraith](https://www.realm667.com/media/kunena/ranks/rank_41_wraith.png)

 Less More- Posts: 17
-
-

   9 years 6 months ago [\#5409](#5409) by cmw1986  Replied by *cmw1986* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5409 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Sure I'll try that, but to make it easier can you show me an updated example of the character's and weapon's DECORATE codes?.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **cmw1986**
- ![cmw1986's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg) Topic Author
- Wraith
- ![Wraith](https://www.realm667.com/media/kunena/ranks/rank_41_wraith.png)

 Less More- Posts: 17
-
-

   9 years 6 months ago [\#5429](#5429) by cmw1986  Replied by *cmw1986* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5429 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Hmm... Since Magic Wazard hasn't responded yet, maybe Blue Shadow has a better solution perhaps?...

@Blue Shadow: with your skill at coding, I'm hoping you can help me solve my problem with my situation here. Do you have any ideas how to fix this issue I'm having?.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **Blue Shadow**
- ![Blue Shadow's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg)
- Administrator
- ![Administrator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1131
-
-
-

   9 years 6 months ago [\#5431](#5431) by Blue Shadow  Replied by *Blue Shadow* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5431 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Sorry, I don't have an answer. I'm not currently in the mood to figure out or solve editing problems. ![:(](https://www.realm667.com/frown.gif ":(")

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **MagicWazard**
- ![MagicWazard's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar517.png)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 808
-
-
-
-

   9 years 6 months ago [\#5433](#5433) by MagicWazard  Replied by *MagicWazard* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5433 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

 Sorry, I meant to ask if you could post a "functioning" version of the firework and monster, with whatever sprites they need--even if they don't work "right" just yet. It'll be a little easier to experiment with it if all the sprites are provided.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **cmw1986**
- ![cmw1986's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg) Topic Author
- Wraith
- ![Wraith](https://www.realm667.com/media/kunena/ranks/rank_41_wraith.png)

 Less More- Posts: 17
-
-

   9 years 5 months ago - 9 years 5 months ago [\#5518](#5518) by cmw1986  Replied by *cmw1986* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5518 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

> MagicWazard wrote: In the meanwhile, I came up with an idea:
> \*Right before the firework projectile "dies" and spawns its pyrotechnic effects, set its damage type to a new type (e.g. "FireworkDeath") using A\_SetDamageType. Ensure it deals at least 1 point of damage using this new type.
> \*Give your monster a pain chance of 256 for the new damage type "FireworkDeath". Also give it a new pain state; Pain.FireworkDeath.
> \*In the monster's Pain.FireworkDeath state, set the monster's mass to 0 using A\_SetMass; give the monster the NOGRAVITY flag using A\_ChangeFlag; then, use ThrustThingZ to launch it into the air. Once it reaches an appropriate height (matching the firework pyrotechnics' height), you can then have the monster kill itself somehow.

With this being said, can you show me an updated example of the DECORATE codes in my first post?. After that, I'll test it out and let you know the results sometime later on... ![:|](https://www.realm667.com/neutral.gif ":|")

-cmw1986

 Last edit: 9 years 5 months ago by cmw1986.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **MagicWazard**
- ![MagicWazard's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar517.png)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 808
-
-
-
-

   9 years 5 months ago - 9 years 5 months ago [\#5521](#5521) by MagicWazard  Replied by *MagicWazard* on topic *[Weapon Improvement](https://www.realm667.com/forum/the-workshop/877-weapon-improvement#5521 "Hey MagicWazard,

I have a weapon that needs fixing to behave how I want for it to do.

My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.

How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:")*

> cmw1986 wrote: With this being said, can you show me an updated example of the DECORATE codes in my first post?. After that, I'll test it out and let you know the results sometime later on... ![:|](https://www.realm667.com/neutral.gif ":|")
>
> -cmw1986

Maybe I wasn't clear--when I said a "working" version, I didn't mean one that "worked correctly"; just something that ran that I could play with to see what happened. Barring that, may you at least post the sprites you're using for the fireworks? That would make it much easier to try ideas out, especially if the rest of the DECORATE hasn't changed yet.

 Last edit: 9 years 5 months ago by MagicWazard.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC84Nzctd2VhcG9uLWltcHJvdmVtZW50P3N0YXJ0PTA=&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

[Powered by](https://www.realm667.com/forum/credits) [Kunena Forum](https://www.kunena.org)
