Jump to content
  • 0

Subclassing a monster?


smeghammer

Question

I'm taking my first foray into DECORATE (yes, I know I should be using ZSCRIPT, but baby steps...) and I want to subclass an existing monster (BoH) and alter its attack. As far as I can tell so far, the way to do this is as described here and then overriding those properties and behaviours you want to.


Essentially for my first test, I want the default baron, but alter its attack to be the flamethrower defined for the flamerzombie.

 

So I came up with this (so far), but the monster does not render, though I get a console message saying that the FlamerBaron has no frames - so the engine sees that there *should* be a monster there called a FlamerBaron... 

 

It was my understanding that all the sprite frames should be inherited from the superclass?

 

 

Spoiler

 


/*
First attempt at DECORATE hacking!
A baron that uses flamethrower instead of fireballs...
*/

actor FlamerBaron : BaronOfHell 31004
{
    MeleeRange 384
    states
    {
        Spawn:
            FBRN AB 10 A_Look    
            loop
        Melee:
            FBRN E 10 A_FaceTarget
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
            FBRN E 10 A_FaceTarget
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
            FBRN E 10 A_FaceTarget
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
            FBRN E 10 A_FaceTarget
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
                  FBRN F 1 A_CustomMissile("ZombieFire",32,0,random(-4,4),0)
            Goto See
    }
}

 

 

 

 

 

Any suggestions most welcome. .. 

Edited by smeghammer

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

It sounds as if doom can't find the FBRN sprites; how do they differ from the sprites of the regular baron? If you just want to use the baron's existing sprites, you can just use BOSS as usual; no need to change the sprite names if you're using the same graphics.

Share this post


Link to post
  • 1
58 minutes ago, Martin Howe said:

It sounds as if doom can't find the FBRN sprites;

 

Right - I think I get it:

 

BOSS, (or ZBAM) is a sprite name prefix, NOT a flag for the monster in the code. The sprite name suffix indicates which animation frame (or frames) the given sprite should be used for. The DECORATE interpreter works out which sprite to use by combining the prefix and the appropriate suffix for the frame being rendered.

Share this post


Link to post
  • 0

It's using the same sprites (though the attack arm is wrong of course). I didn't know whether using the same name (BOSS) would conflict with the existing one.

 

Weird... I tried with BOSS before (still had the find/replace in the editor dialogue).

 

It works now! Cool...

 

It looks like he's shooting at you with his groin :-)

groinshot.png.6ee94175b4a940963d9be19ae35b55f6.png

 

 

Share this post


Link to post
  • 0
1 hour ago, smeghammer said:

 

Right - I think I get it:

 

BOSS, (or ZBAM) is a sprite name prefix, NOT a flag for the monster in the code. The sprite name suffix indicates which animation frame (or frames) the given sprite should be used for. The DECORATE interpreter works out which sprite to use by combining the prefix and the appropriate suffix for the frame being rendered.

uh huh

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...