Detonate projectiles while in air(SOLVED)
Detonate projectiles while in air(SOLVED)
Is there anyway that a player can detonate a projectile while its in the air with a weapon?
(Example: A projectile is flying, I use the ALTFIRE and the projectile is sent to death state)
(Example: A projectile is flying, I use the ALTFIRE and the projectile is sent to death state)
Last edited by Faad3e_ on Sat Jan 04, 2014 6:27 pm, edited 1 time in total.
-
Catastrophe
- Retired Staff / Community Team Member
- Posts: 2571
- Joined: Sat Jun 02, 2012 2:44 am
RE: Detonate projectiles while in air
Yeah, look at the ghostbuster traps in GvH
RE: Detonate projectiles while in air
Or Ragnarok DM, which has an example that works exactly the way OP describes.Catastrophe wrote: Yeah, look at the ghostbuster traps in GvH
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
RE: Detonate projectiles while in air
Alright, i downloaded it, which gun haves the behavior i described?Ivan wrote:
Or Ragnarok DM, which has an example that works exactly the way OP describes.
RE: Detonate projectiles while in air
The plasma cannon, found in 3rd or 4th map. Although you might need to define a new key to detonate it, still, it's the same for altfire really. (With enabling A_Weaponready and necessary flags to allow alt fire to pass)
Last edited by Ivan on Sat Jan 04, 2014 4:16 am, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
RE: Detonate projectiles while in air
Alright, thanks a lot sirIvan wrote: The plasma cannon, found in 3rd or 4th map. Although you might need to define a new key to detonate it, still, it's the same for altfire really. (With enabling A_Weaponready and necessary flags to allow alt fire to pass)
-
Ijon Tichy
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Detonate projectiles while in air
It's simple, really. Have the projectile constantly check for an item in the player's inventory. If it's there, jump to a state where it does an A_Stop (to stop in midair), then do some explosion shit and disappear. Alternately, have it call A_Die, which would drop its health to 0 and put it in the Death state, and have the A_Stop there.
This grenade lays on the ground and does not detonate until the player gets the DakkaDetonateGrenades item.
This grenade lays on the ground and does not detonate until the player gets the DakkaDetonateGrenades item.
Code: Select all
// This is the inventory item that will be placed in the player's inventory
// to detonate it; give it through whatever method, take it immediately after
actor DakkaDetonateGrenades: Inventory { Inventory.MaxAmount 1 +UNDROPPABLE }
// The grenade itself
actor DakkaRemoteGrenade
{
// irrelevant
States
{
Spawn:
SGRN A 1 bright
SGRN A 0 A_JumpIfInTargetInventory("DakkaDetonateGrenades", 1, "Detonate")
loop
Detonate:
SGRN A 0 A_Die
goto Death2 // should never be reached
Death:
SGRN A 0 A_Stop
SGRN A 0 A_ChangeFlag("NOGRAVITY", 1)
SGRN A 0 A_JumpIfInTargetInventory("DakkaDetonateGrenades", 1, "Death2")
goto OnGround
OnGround:
SGRN A 1 bright
loop
Death2:
SGRN A 0 A_Stop
SGRN A 0 A_ChangeFlag("NOGRAVITY", 1)
MISL B 0 A_SetTranslucent(1, 1)
MISL B 0 bright A_PlaySound("dakka/explode")
MISL B 0 bright A_Explode(96, 144, 0)
MISL B 0 bright A_Explode(64, 144)
MISL B 8 bright
MISL C 6 bright
MISL D 4 bright
stop
}
}
Last edited by Ijon Tichy on Sat Jan 04, 2014 4:50 am, edited 1 time in total.
RE: Detonate projectiles while in air
whoa, you made it so simple, thanks even more sir!Ijon Tichy wrote: It's simple, really. Have the projectile constantly check for an item in the player's inventory. If it's there, jump to a state where it does an A_Stop (to stop in midair), then do some explosion shit and disappear. Alternately, have it call A_Die, which would drop its health to 0 and put it in the Death state, and have the A_Stop there.
This grenade lays on the ground and does not detonate until the player gets the DakkaDetonateGrenades item.
Code: Select all
// This is the inventory item that will be placed in the player's inventory // to detonate it; give it through whatever method, take it immediately after actor DakkaDetonateGrenades: Inventory { Inventory.MaxAmount 1 +UNDROPPABLE } // The grenade itself actor DakkaRemoteGrenade { // irrelevant States { Spawn: SGRN A 1 bright SGRN A 0 A_JumpIfInTargetInventory("DakkaDetonateGrenades", 1, "Detonate") loop Detonate: SGRN A 0 A_Die goto Death2 // should never be reached Death: SGRN A 0 A_Stop SGRN A 0 A_ChangeFlag("NOGRAVITY", 1) SGRN A 0 A_JumpIfInTargetInventory("DakkaDetonateGrenades", 1, "Death2") goto OnGround OnGround: SGRN A 1 bright loop Death2: SGRN A 0 A_Stop SGRN A 0 A_ChangeFlag("NOGRAVITY", 1) MISL B 0 A_SetTranslucent(1, 1) MISL B 0 bright A_PlaySound("dakka/explode") MISL B 0 bright A_Explode(96, 144, 0) MISL B 0 bright A_Explode(64, 144) MISL B 8 bright MISL C 6 bright MISL D 4 bright stop } }
guess im just too dumb at this :(
EDIT: one question, projectiles always take as target the thing that shot them?
Last edited by Faad3e_ on Sat Jan 04, 2014 5:28 am, edited 1 time in total.
-
Ijon Tichy
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Detonate projectiles while in air
Yeah, a projectile's target is its firer. Change the target of the projectile, that target is now considered the firer. Kinda backwards, but welcome to hacks.