Stun Grenade?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Enjay
 
 
Posts: 27267
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Stun Grenade?

Post by Enjay »

If you've played "Rogue Trooper", you'll know the kind of effect I'm looking for... You toss your grenade, it explodes and any enemies within the radius of the explosion stand around screaming and holding their ears. They are not damaged by the grenade (I don't think) but they are effectively immobilized for the duration of the effect, allowing you to kill them with little or no resistance.

Now, to Zdoom - can it be done? I think the answer is no, or at least not until custom states are implemented. Some way of forcing any enemy within a defined radius of the grenade to go into his pain state every few seconds would probably have the desired effect - but how to force this to happen or how to make it happen without causing damage to the enemy, yet leaving him vulnerable to you shooting him (ie simply deactivating him won't do it because he becomes invulnerable when deactivated)?

Any thoughts?
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

I could see how this could be done in DCR with custom states, but not readily apparent with the current technology.


I'm sure someone will post a super-hacky thing that will work untill the next ZDoom comes out though.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

Bio Hazard wrote:I could see how this could be done in DCR with custom states, but not readily apparent with the current technology.


I'm sure someone will post a super-hacky thing that will work untill the next ZDoom comes out though.
Mainly LWM, knowing her slightly. :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Re: Stun Grenade?

Post by solarsnowfall »

Enjay wrote:Now, to Zdoom - can it be done?
The whole detecting if a monster is within a certain range could be done using scripts.
(ie simply deactivating him won't do it because he becomes invulnerable when deactivated)
I'm pretty sure you could still damage an actor if it inherrits from the SwitchableDecoration class and is deactivated. But, I would have no idea if a monster would behave properly with inherriting form that class. I'd have to assume it wouldn't.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

I think you could reasonly do the desired effect by giving a marker item to the stunned monsters, and having the stun behavior right in the DECORATE. With that method, the real issue becomes actually giving all the monsters in the appropriate range the marker item. Maybe could have the grenade shoot out invisible rippers in all directions which use A_GiveToTarget (or whatever it's called). They only go a certain distance, making up the area of effect of the weapon. If that works it should be pretty straight forward from there. They get supplied with your clearly named marker item such as "OhMyIAmStunnedWhateverWillIDo". In the See state (and anywhere else appropriate) for your monsters, there is a jump if they have the item. The jump goes to some spot in the frames that can only be reached via that jump, and just make sure to remove the item when you are done.

Code: Select all

      SPRT A 0 A_JumpIfInventory("OhMyIAmStunnedWhateverWillIDo",1,#)
...
      SPRT BCBCB 20 A_Pain
      SPRT A 0 A_TakeInventory("OhMyIAmStunnedWhateverWillIDo",1)
      Goto See
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

Blade Nightflame wrote:Mainly LWM, knowing her slightly. :P
Closest I have is my M114 smoke grenade in Power DoLLS, but that works opposite from what he wants. Instead of making enemies dazed, it makes the player hard to see and near impossible to shoot while they remain near the smoke.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

I'm too tired to post an actual example today, but isn't there an ACS special called TeleportToPainState or something like that? Would that happen to work combined with some scripting?

I envision a weapon that fires a non-damaging projectile with a TID assigned. The projectile detonates and executes a script that uses pythagorean theorem to detect the distance from an enemy to the projectile's point of detonation. If the monster is in range, use the TeleportToPainState function repeatedly to keep the monster saying ouch over and over. This method would require no DECORATE changes to existing monsters, although it would be rather map specific and require TIDs for the stunnable monsters. Now if anyone here is un-lazy enough to put this into practice... :P

Custom states would be way easier, though. :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Yes, that sounds pretty much like my suggestion. Even so, "hacky hacky hacky!".
Last edited by solarsnowfall on Sat Jul 29, 2006 12:42 am, edited 1 time in total.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Whoops, I'm repeating everyone again, aren't I? >_< :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Heh, well I didn't go into specifics, so don't worry about it. Have you seen my distance function? It's amazingly simple....
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

I just now spotted it in another thread, and I have to say that it's the best implementation I've seen yet. Even the mathly-impaired out there (ie, me in the mornings) can use it without any trouble. :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Xaser wrote:Even the mathly-impaired out there (ie, me in the mornings) can use it without any trouble. :P
LOL! That's pretty much why I sat down and let the stone gears grind out in my head until that appeared on the screen.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

*reads back* Wow... "mathly-impaired"? Well, apparently, my lack of sleep has rendered my "speakingly-impaired" or something. :P

You know, I should patent these sayings or something. I could make a fortune. :P
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Yes you could! :P
User avatar
Wills
Posts: 1446
Joined: Mon Jan 10, 2005 7:01 pm
Location: The Well of Wishes

Post by Wills »

Or start a new term. Xaserisms. Another X word for the fledgling ranks of the aforementioned letter would be superb.
Locked

Return to “Editing (Archive)”