"Stunning" Enemies?

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.
Locked
User avatar
Tormentor667
Posts: 13533
Joined: Wed Jul 16, 2003 3:52 am
Contact:

"Stunning" Enemies?

Post by Tormentor667 »

Is it possible to create a weapon that doesn't do any damage but stun enemies so that they move slower OR stop moving? Custom pain states? Custom states? Please an example if possible :) Are other propertychanges possible with weapons?
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Re: "Stunning" Enemies?

Post by Risen »

It's possible while doing one damage point... not sure if it's yet possible with 0. Not too long ago it was not possible, but I haven't been keeping up with the recent additions.
User avatar
corysykes
Posts: 329
Joined: Mon May 07, 2007 6:03 pm
Location: Location i have no Location

Re: "Stunning" Enemies?

Post by corysykes »

the freeze gun in the weapon res wad that freezes the emeny but maby just maby if you play around with it you probly could get an effect that you want
User avatar
Jimmy
 
 
Posts: 4720
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: "Stunning" Enemies?

Post by Jimmy »

He wants to "stun" the monsters, not freeze them into ice. :?

Have a damagetype called "Stun" and then have a custom pain state that goes like this:

Code: Select all

Pain.Stun
  TROO H 2
  TROO H 25 A_Pain
  TROO H 2
  Goto See    //replace this with Wait to make them stop moving completely
Or somesuch. Untested of course, since I've never used damagetypes before, but modify until it works flawlessly or to your content.

To make them move slower, have them execute a script in this state to reduce their speed.

Code: Select all

Pain.Stun
  TROO H 2 ACS_Execute(539,0)
  TROO H 2 A_Pain
  Goto See

Code: Select all

script 539 ( void )
{
  SetActorProperty(0,AProp_Speed,0.5); //I believe this will reduce them to half-speed, but this may be wrong
}
Hope that helps - I'm double-guessing here, of course - soooo... don't hurt me if it doesn't work. :x
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: "Stunning" Enemies?

Post by CaptainToenail »

Enjay made some stun grenades using non damaging ripping projectiles.
User avatar
Tormentor667
Posts: 13533
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: "Stunning" Enemies?

Post by Tormentor667 »

Okay, thx first at all jimmy, that helped. Here is what I have tried:

Code: Select all

///////////////////////////////
// ALTERED ORIGINAL MONSTERS //
///////////////////////////////

actor MyZombie : ZombieMan replaces Zombieman

{
    painchance "Freeze", 255

    States {
         Pain.Freeze:
              POSS G 3
    	      POSS G 300 A_Pain
              goto See
     }
}

///////////////////
// FREEZE WEAPON //
///////////////////

actor FreezeBall : DoomImpBall
{
    DamageType Freeze
    Damage 1
}

actor Freezer : Weapon replaces RocketLauncher
{
  radius 20 
  height 16
  inventory.pickupmessage "You got the Freezer!"
  weapon.selectionorder 2500
  weapon.kickback 100
  weapon.ammotype "RocketAmmo"
  weapon.ammouse 1
  weapon.ammogive 2
  +WEAPON.NOAUTOFIRE
  +WEAPON.EXPLOSIVE
  states
  {
  Ready:
    MISG A 1 A_WeaponReady
    loop
  Deselect:
    MISG A 1 A_Lower
    loop
  Select:
    MISG A 1 A_Raise
    loop
  Fire:
    MISG B 8 A_GunFlash
    MISG B 12 A_FireCustomMissile ("FreezeBall")
    MISG B 0 A_ReFire
    goto Ready
  Flash:
    MISF A 3 bright A_Light1
    MISF B 4 bright
    MISF CD 4 bright A_Light2
    MISF D 0 bright A_Light0
    stop
  Spawn:
    LAUN A -1
    stop
  }
}
It is a weapon now (with dummy graphics) that uses a new projectile with the damage type "Freeze" doing exactly 1 damage as suggested by Risen. I can now easily stun the altered Zombieman with that attack. The only problem now is, when I hit it with a different weapon, the stun effect stops and the normal pain state is displayed. Is there anything I can do to make sure that the stun lasts the "frames / duration" that I have set in its state without getting into the normal pain state?
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: "Stunning" Enemies?

Post by Ghastly »

I'm 99% sure that 0 damage can't activate a pain state. +AlwaysPain flag for projectiles and bulletpuffs, anyone?

A_ChangeFlag("NoPain", 1) should fix that problem, Tormentor.
User avatar
Tormentor667
Posts: 13533
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: "Stunning" Enemies?

Post by Tormentor667 »

Awesome, that worked :)
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: "Stunning" Enemies?

Post by Enjay »

CaptainToenail wrote:Enjay made some stun grenades using non damaging ripping projectiles.
Yup, specifically the "sonic grenades" in my Burghead thingy. The thrown grenade sits on the floor spewing out short life, zero damage, invisible ripping projectiles in all directions for a few seconds. Any enemy that comes close has a high chance of being put into their pain state. With custom pain states and damage susceptibility, it could certainly be tailored further.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"
Contact:

Re: "Stunning" Enemies?

Post by DBThanatos »

@ghastlyd: I think enjay just said it, but Ill say it myself ( :P ): Zero damage attacks still makes monsters enter in it's pain states.

@torm: The only way that comes to my mind for the last thing you said, is a check in the main pain state (if you are not using more than the PAIN and Pain.Freeze).

Code: Select all

actor MyZombie : ZombieMan replaces Zombieman

{
    painchance "Freeze", 255
    Health 1500

    States {
         Pain:
              TNT1 A 0 A_JumpIfInventory("StunCheck",1,"Pain.Freeze")
              POSS G 3
             POSS G 4
              goto See
         Pain.Freeze:
              TNT1 A 0 A_JumpIfInventory("StunCheck",1,1)    //if it have at least one, jump the next state so it wont get more infinitely
              TNT1 A 0 A_GiveInventory("StunCheck",10)    //as many as you want the effect lenght
              POSS G 3
              POSS G 3 A_Pain
		  TNT1 A 0 A_TakeInventory("StunCheck",1)
		  Goto Pain
     }
}

Actor StunCheck : Inventory
{
	Inventory.MaxAmount 30
	Inventory.Amount 1
}
In theory this should work, I dont have ZDoom to test in this PC, but I really think it'll work. If not, I think you'll get my idea anyway ;)
Onslaught Six
Posts: 572
Joined: Sun Dec 11, 2005 9:17 pm
Location: Hell.
Contact:

Re: "Stunning" Enemies?

Post by Onslaught Six »

Wouldn't giving an enemy (all enemies?) a Damagefactor "Freeze" 0.5 tag reduce the damage enough to get rid of the 1 point of damage, also?
User avatar
Unknown_Assassin
Posts: 2468
Joined: Wed Apr 12, 2006 5:17 pm
Location: Where dead carcasses lie
Contact:

Re: "Stunning" Enemies?

Post by Unknown_Assassin »

Ghastly_dragon wrote:I'm 99% sure that 0 damage can't activate a pain state. +AlwaysPain flag for projectiles and bulletpuffs, anyone?
Add +RIPPER to projectile, and you can make a monster go into its pain state. Of course, with a damage of 0, it will still have the same health.
User avatar
Tormentor667
Posts: 13533
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: "Stunning" Enemies?

Post by Tormentor667 »

Unknown_Assassin wrote:
Ghastly_dragon wrote:I'm 99% sure that 0 damage can't activate a pain state. +AlwaysPain flag for projectiles and bulletpuffs, anyone?
Add +RIPPER to projectile, and you can make a monster go into its pain state. Of course, with a damage of 0, it will still have the same health.
With tje +RIPPER flag, the projectile goes through enemies and I don't want this to happen
Locked

Return to “Editing (Archive)”