Jump to content
  • 0

How do I fix my monster's lunge attack?


asd1994

Question

So I've been trying to figure out how to give my Urge a lunch attack with his sword. I have something that kinda works, but it's very buggy and I'm not sure why. Can anyone help me fix this or suggest a different method? Below is the code for my Urge as well as a video demonstration of his buggy lunge attack. 

 

 

Actor Urge 1996
{
    Scale 0.7
    Health 500
    Speed 30
    Radius 20
    Height 64
    Mass 320 
    Painchance 50
    MeleeRange 256
    +FLOORCLIP
    +DONTHURTSPECIES
    +GHOST
    +MISSILEMORE
    MONSTER
    SeeSound "urge/see"
    PainSound "urge/pain"
    DeathSound "urge/death"
    DropItem RocketAmmo
    Obituary "An Urge dynamited %o to bits!"
    HitObituary "%o was gutted by an Urge!"
    States
    {
    Spawn:
        TNT1 A 1 A_Look
        Loop
    See:
        URSP A 3 
        URSP BCDEFGHIJK 3 
        Goto Chase
    Chase:
        URGE A 0 A_PlaySound ("urge/walk")
        URGE AB 5 A_Chase
        URGE C 0 A_PlaySound ("urge/walk")
        URGE CD 5 A_Chase
        Loop
    Melee:
        UAT2 A 3 A_FaceTarget
        UAT2 B 3 A_SkullAttack
        UAT2 C 3 A_SkelWhoosh
        UAT2 DE 3 A_FaceTarget
        UAT2 F 3 A_CustomMeleeAttack(random(1, 10) * 6, "urge/hit")
        Goto Chase
    Missile:
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 5)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing")
        UAT1 DEF 2 
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 5)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing")
        UAT1 DEF 2 
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 5)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing") 
        UAT1 DEF 2 
        Goto Chase
    Pain:
        URGP A 15 A_Pain
        Goto Chase
    Death:
        UDED A 4 A_ScreamAndUnblock 
        UDED BCDEFGHIJKLMN 3 
        UDED O -1
    Idle:
        URSP K 3 A_PlaySound ("urge/see")
        URSP JIHGFEDCBA 3 
        Goto Spawn
    Raise:
        UDED NMLKJIHGFEDCB 3
        UDED A 4
        Goto Chase
        }
}

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

IIRC A_SkullAttack goes back to the See state (or Spawn state?) after it collides with something. Not sure how you can work around that, if you can't figure it out maybe try using A_MinotaurCharge (your monster would need to inherit from Minotaur) or ThrustThing (which I think works in Decorate these days even though it's an Action Special?). There might be other options too, those are just what I can think of right now.

 

edit: A_MinotaurCharge goes back to the See state too.

Edited by plums

Share this post


Link to post
  • 0
13 hours ago, plums said:

IIRC A_SkullAttack goes back to the See state (or Spawn state?) after it collides with something. Not sure how you can work around that, if you can't figure it out maybe try using A_MinotaurCharge (your monster would need to inherit from Minotaur) or ThrustThing (which I think works in Decorate these days even though it's an Action Special?). There might be other options too, those are just what I can think of right now.

 

edit: A_MinotaurCharge goes back to the See state too.

ThrustThing works, thanks for the suggestion! Had to rearrange a few things to get it working how I want it to. It's now a secondary missile state instead of melee because using a high MeleeRange value (now set down to 96 for the normal melee attack) to choose when to activate it made it practically unavoidable. Here's a vid of the result and the new code: 

 

 

    Missile:
        TNT1 A 0 A_Jump(256,"Missile.Lunge","Missile.TNT")
    Missile.Lunge:
        UAT2 A 3 A_FaceTarget
        UAT2 B 0 ThrustThing(angle * 256 / 360, 50, 1, 0)
        UAT2 B 10 A_PlaySound("urge/lunge")
        UAT2 C 3 A_SkelWhoosh
        UAT2 DE 3 A_FaceTarget
        UAT2 F 3 A_CustomMeleeAttack(20, "urge/hit")
        Goto Chase
    Missile.TNT:
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 3)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing")
        UAT1 DEF 2 
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 3)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing")
        UAT1 DEF 2 
        UAT1 ABC 2  A_FaceTarget
        TNT1 A 0 A_ThrowGrenade("UrgeTNT", 15, 15, 3)
        TNT1 A 0 A_StopSound
        TNT1 A 0 A_PlaySound("skeleton/swing")
        UAT1 DEF 2 
        Goto Chase
    Melee:
        UAT2 A 3 A_FaceTarget
        UAT2 B 3 
        UAT2 C 3 A_SkelWhoosh
        UAT2 DE 3 A_FaceTarget
        UAT2 F 3 A_CustomMeleeAttack(20, "urge/hit")
        Goto Chase

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...