Decorate Question #426 - Melee Attack Related

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
Aquashark
Posts: 21
Joined: Thu Mar 24, 2005 4:43 pm
Location: Wisconsin, US

Decorate Question #426 - Melee Attack Related

Post by Aquashark »

Hello!

I've recently discovered the joys of DECORATE, and I've had a lot of fun making armies of monsters to do my bidding. However, whenever I'm making a monster with both a Missile and a Melee attack, I'm finding that the monster never uses the melee attack anymore. It always opts to use the projectile--even when I continually stand right next to it!

Does this have anything to do with the fact that the monster I'm making is using A_SkullAttack in his Missile state? I've tried doing lots of things, such as attempting to use an A_JumpIfCloser function to make it jump to the melee attack if the player was closer than 16 units, but that didn't seem to work at all. Any help would be much appreciated; I'm glad to learn more about the mysteries and common-sense applications within the DECORATE lump!

Here is the code, just in case...
Spoiler:
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

Try this

Code: Select all

ACTOR Fiend 3269 
{              
   Health 300 
   PainChance 77 
   Speed 15 
   Radius 56 
   Height 64 
   Mass 400 
   Damage 8 
   MeleeDamage 8 
   MONSTER 
   +DROPOFF 
   +FLOORCLIP 
   SeeSound "fiend/sight" 
   AttackSound "fiend/melee" 
   PainSound "fiend/pain" 
   DeathSound "fiend/death" 
   ActiveSound "fiend/active" 
   Obituary "%o was hacked apart by a Fiend." 
   States 
   { 
   Spawn: 
      DEMI A 0 A_Jump(179, 3) 
      DEMI A 10 A_Look 
      DEMI A 10 A_PlaySound("fiend/active") 
      DEMI AAAAAAAAAA 10 A_Look 
      Loop 
   See: 
      DEMW A 0 A_SetShootable 
      DEMW AABBCCDD 4 A_Chase 
      Loop 
   Missile: 
      DEMJ A 10 A_FaceTarget 
      DEMJ A 0 A_JumpIfCloser(32, 255, 7)
      DEMJ A 0 A_UnsetShootable 
      DEMJ A 0 A_PlaySound("fiend/jump") 
      DEMJ B 6 A_SkullAttack 
      DEMJ C 20 
      DEMJ D 4 A_PlaySound("fiend/thump") 
      DEMJ D 0 A_SetShootable 
      Goto See  
      DEMS B 8 A_MeleeAttack 
      DEMS C 8 A_FaceTarget 
      DEMS D 8 A_MeleeAttack 
      Goto See 
   Pain: 
      DEMP A 2 
      DEMP A 2 A_Pain 
      Goto See 
   Death: 
      DEMD A 4 
      DEMD B 4 A_Scream 
      DEMD C 4 
      DEMD D 4 A_Fall 
      DEMD EFG 4 
      DEMD H -1 
      Stop 
   XDeath: 
      DEMH A 4 A_Fall 
      DEMH A 0 A_PlaySound("quake/gib") 
      DEMH A 4 A_CustomMissile("ChestGib", 32, 0, 0) 
      DEMH A 0 A_CustomMissile("ArmGib", 32, 0, 90) 
      DEMH A 0 A_CustomMissile("ArmGib", 32, 0, 270) 
      DEMH A 0 A_CustomMissile("ChunkGib", 32, 0, 45) 
      DEMH A 0 A_CustomMissile("ChunkGib", 32, 0, 180) 
      DEMH A 0 A_CustomMissile("ChunkGib", 32, 0, 225) 
      DEMH A 4 A_CustomMissile("ChunkGib", 32, 0, 315) 
      DEMH A -1 
      Stop 
   Raise: 
      DEMD HGFEDCBA 4 
      Goto See 
   } 
} 
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Post by Deathsong12 »

Cool! Can you post this as a wad, or at least a screenshot?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

The problem here is that the radius of the monster is too large. Unless you are using the latest .96x version only small monsters can use melee attacks. In the latest unofficial build there's the 'meleerange' property to overcome this problem.
User avatar
Aquashark
Posts: 21
Joined: Thu Mar 24, 2005 4:43 pm
Location: Wisconsin, US

Post by Aquashark »

Thank you, Graf Zahl and chaoscentral! I had never known that the radius had any bearing on the melee attack. I need to go back and read the wiki until my eyes fall out...

And Deathsong12, I'm unable to post it to a WAD, sadly. I obtained all the graphics and information from the QDOOM wad... in its text file, it explicitly states that one is not allowed to use portions of the wad in other projects.

You're not missing anything, though. It's just a Fiend from Quake... nothing incredibly exciting. (And incredibly easy to make yourself with QDOOM.wad... barring this little radius problem!) Heh, if you really want a screenshot I could take one and post it..
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Post by Deathsong12 »

It's not too important. Just as long as you are learing decorate. While I'm posting, is there any way to set an X-offset for melee attacks? Or for cutstom punching parameters in weapons?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

No.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Why would you need an X offset for punching? The only thing missing really is how far the melee attack can reach.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

And that's not missing. (You seem to be missing a lot, OTOH :P)
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Oh for...
Locked

Return to “Editing (Archive)”