by Blue Shadow » Tue Jan 21, 2014 5:18 am
Calling [wiki]Thing_Destroy[/wiki] from DECORATE doesn't appear to work (at least not with the case the I've got here) starting with ZDoom 2.7.0 onwards. 2.6.1 was the last official release this worked on.
In the linked file below, is a weapon that fires "sticky" projectiles with the primary fire key, and detonates said projectiles with the secondary fire key. The detonation code uses Thing_Destroy to do so. Here is the code:
Spoiler:
Code: Select all
// --------------------------------------------------------------------------
//
// Bio Pipebomb Launcher, sprites from Xaser's p0wer_x.wad
//
// --------------------------------------------------------------------------
Actor BioPipebombLauncher : Weapon
{
Weapon.Kickback 100
Weapon.AmmoUse 1
Weapon.AmmoGive 12
Weapon.AmmoType "BioContainer"
Inventory.PickupMessage "Bio Pipebomb Launcher!"
Weapon.UpSound "Weapons/BioReady"
States
{
Spawn:
BPBL M -1
Loop
Ready:
BPBL ABCD 5 A_WeaponReady
Loop
Deselect:
BPBL A 1 A_Lower
Loop
Select:
BPBL A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySoundEx("Weapons/BioFire","Weapon")
BPBL E 7 A_FireCustomMissile("BioProj")
BPBL F 8
BPBL G 7
BPBL H 8
Goto Ready
Flash:
BPBL I 2 A_Light(2)
BPBL J 2
BPBL K 2
BPBL L 2
Stop
AltFire:
BPBL A 2 Thing_Destroy(2648) //Sets off projectiles.
BPBL B 2
BPBL C 2
BPBL D 2
Goto Ready
}
}
// --------------------------------------------------------------------------
//
// Bio Proj, sprites from Captain Toenail and Daniel's NeoDoom.wad
//
// --------------------------------------------------------------------------
Actor BioProj
{
Radius 5
Height 5
RenderStyle Translucent
Alpha .7
Decal "BioDecal"
Speed 30
DamageType Poison
Projectile
+Shootable //So alt fire works.
+DontSplash
+SeekerMissile //So A_Fire works.
+ForceRadiusDmg
+DontFall //Stops it from falling after sticking to targets.
States
{
Spawn:
BPBP ABC 3 Bright A_SpawnItemEx("BioPuff",0,0,0,0,0,0,0,128)
Loop
TNT1 A 0 A_Stop
TNT1 A 0 Thing_ChangeTID(0,2648)
BPBP AAABBBCCC 1 Bright A_Fire(35)
Goto Spawn+5
Death:
TNT1 A 0 A_JumpIf(tid == 2648,1)
Goto Spawn+3
TNT1 A 0 A_PlaySoundEx("Weapons/BioProj","Weapons")
TNT1 A 0 A_Explode(100,192)
TNT1 A 0 A_SpawnItemEx("BioPuff",0,0,0,0,0,0,0,128)
BPBP DEF 6 Bright
Stop
XDeath:
TNT1 A 0 A_Stop
Goto Spawn+4
}
}
// --------------------------------------------------------------------------
//
// Bio Puff, sprites from Raven Software
//
// --------------------------------------------------------------------------
Actor BioPuff
{
Radius 0
Height 0
+NoBlockMap
+NoGravity
+Randomize
+PuffOnActors
RenderStyle Translucent
Scale .5
Alpha .25
VSpeed 1
Mass 5
States
{
Spawn:
BPBP GHIJKLMIHG 2 Bright
Stop
}
}
// --------------------------------------------------------------------------
//
// Bio Pipebomb Launcher ammo, sprites from Daniel's ARSENAL.WAD
//
// --------------------------------------------------------------------------
Actor BioContainer : Ammo
{
Inventory.Amount 6
Inventory.MaxAmount 60
Ammo.BackpackAmount 12
Ammo.BackpackMaxAmount 120
Inventory.PickupMessage "Bio Container"
Inventory.Icon BIOCA0
States
{
Spawn:
BIOC A -1
Loop
}
}
Actor BioContainerHefty : BioContainer
{
Inventory.Amount 30
Inventory.PickupMessage "Bio Container Hefty"
States
{
Spawn:
BIOC B -1
Stop
}
}
And here is the file:
http://www.realm667.com/index.php/repos ... doom-style (Before running it, you need to extract it first, as it's a pk3 inside a zip)
Calling [wiki]Thing_Destroy[/wiki] from DECORATE doesn't appear to work (at least not with the case the I've got here) starting with ZDoom 2.7.0 onwards. 2.6.1 was the last official release this worked on.
In the linked file below, is a weapon that fires "sticky" projectiles with the primary fire key, and detonates said projectiles with the secondary fire key. The detonation code uses Thing_Destroy to do so. Here is the code:
[spoiler][code]
// --------------------------------------------------------------------------
//
// Bio Pipebomb Launcher, sprites from Xaser's p0wer_x.wad
//
// --------------------------------------------------------------------------
Actor BioPipebombLauncher : Weapon
{
Weapon.Kickback 100
Weapon.AmmoUse 1
Weapon.AmmoGive 12
Weapon.AmmoType "BioContainer"
Inventory.PickupMessage "Bio Pipebomb Launcher!"
Weapon.UpSound "Weapons/BioReady"
States
{
Spawn:
BPBL M -1
Loop
Ready:
BPBL ABCD 5 A_WeaponReady
Loop
Deselect:
BPBL A 1 A_Lower
Loop
Select:
BPBL A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySoundEx("Weapons/BioFire","Weapon")
BPBL E 7 A_FireCustomMissile("BioProj")
BPBL F 8
BPBL G 7
BPBL H 8
Goto Ready
Flash:
BPBL I 2 A_Light(2)
BPBL J 2
BPBL K 2
BPBL L 2
Stop
AltFire:
BPBL A 2 Thing_Destroy(2648) //Sets off projectiles.
BPBL B 2
BPBL C 2
BPBL D 2
Goto Ready
}
}
// --------------------------------------------------------------------------
//
// Bio Proj, sprites from Captain Toenail and Daniel's NeoDoom.wad
//
// --------------------------------------------------------------------------
Actor BioProj
{
Radius 5
Height 5
RenderStyle Translucent
Alpha .7
Decal "BioDecal"
Speed 30
DamageType Poison
Projectile
+Shootable //So alt fire works.
+DontSplash
+SeekerMissile //So A_Fire works.
+ForceRadiusDmg
+DontFall //Stops it from falling after sticking to targets.
States
{
Spawn:
BPBP ABC 3 Bright A_SpawnItemEx("BioPuff",0,0,0,0,0,0,0,128)
Loop
TNT1 A 0 A_Stop
TNT1 A 0 Thing_ChangeTID(0,2648)
BPBP AAABBBCCC 1 Bright A_Fire(35)
Goto Spawn+5
Death:
TNT1 A 0 A_JumpIf(tid == 2648,1)
Goto Spawn+3
TNT1 A 0 A_PlaySoundEx("Weapons/BioProj","Weapons")
TNT1 A 0 A_Explode(100,192)
TNT1 A 0 A_SpawnItemEx("BioPuff",0,0,0,0,0,0,0,128)
BPBP DEF 6 Bright
Stop
XDeath:
TNT1 A 0 A_Stop
Goto Spawn+4
}
}
// --------------------------------------------------------------------------
//
// Bio Puff, sprites from Raven Software
//
// --------------------------------------------------------------------------
Actor BioPuff
{
Radius 0
Height 0
+NoBlockMap
+NoGravity
+Randomize
+PuffOnActors
RenderStyle Translucent
Scale .5
Alpha .25
VSpeed 1
Mass 5
States
{
Spawn:
BPBP GHIJKLMIHG 2 Bright
Stop
}
}
// --------------------------------------------------------------------------
//
// Bio Pipebomb Launcher ammo, sprites from Daniel's ARSENAL.WAD
//
// --------------------------------------------------------------------------
Actor BioContainer : Ammo
{
Inventory.Amount 6
Inventory.MaxAmount 60
Ammo.BackpackAmount 12
Ammo.BackpackMaxAmount 120
Inventory.PickupMessage "Bio Container"
Inventory.Icon BIOCA0
States
{
Spawn:
BIOC A -1
Loop
}
}
Actor BioContainerHefty : BioContainer
{
Inventory.Amount 30
Inventory.PickupMessage "Bio Container Hefty"
States
{
Spawn:
BIOC B -1
Stop
}
}
[/code][/spoiler]
And here is the file: http://www.realm667.com/index.php/repository/armory-mainmenu-157/704-bio-pipebomb-launcher?catid=59%3Adoom-style (Before running it, you need to extract it first, as it's a pk3 inside a zip)