DECORATE Tutorial?

Trying to find one. I basically want to know how to make a basic actor/decoration (a hanging light).

Do any such tutorials exist? Step by step ones?

Share this post


Link to post

I assume with DECORATE I can write this all out in notepad? I don't need any additional programs other than XWE?

Share this post


Link to post

You can create a new lump in your wad in XWE called DECORATE and write it all out there. Or, if you're insistent on using Notepad you can write it out with that and import it.

Share this post


Link to post
Starke Von Oben said:

I assume with DECORATE I can write this all out in notepad? I don't need any additional programs other than XWE?


While both have their little quirks, SlumpEd 0.7 is an attractive alternative to XWE.
For text lumps, like DECORATE, it presents text with coloured highlighting.

Share this post


Link to post

So much info, and it's hard to navigate all the way through it!

Could someone provide me with a basic step by step guide what I would need to do to make a simple decorative object (e.g. hanging object decoration)? I'm pretty sure once I know exactly what to do all that info above will fall seamlessly into place.

Share this post


Link to post

Okay. Take a look at this:
http://zdoom.org/wiki/Classes:Chandelier

It's a pre-existing hanging decoration.

ACTOR Chandelier 28
{
  Game Heretic
  Radius 20
  Height 60
  +SPAWNCEILING
  +NOGRAVITY
  States
  {
  Spawn:
    CHDL ABC 4
    Loop
  }
}
ACTOR: signals the decorate parser that we're beginning a new actor declaration.

Chandelier: name of the class.

28: map editor number. To use this chandelier on a map, use thing number 28.

{: open the list of properties.

Game Heretic: signal that this actor is specific to Heretic. This is here only to prevent number conflicts with doom editor numbers and spawn ID (but this actor does not have a spawn ID anyway). Here we have a conflict because 28 is used as the map editor number for heads on a stick in Doom, a burned tree stump in Hexen, and a light in a cage in Strife. See the list of standard map editor numbers to prevent conflicts from happening.

The actor could still be used in Doom, Hexen, Strife or Chex Quest, but you'd need to use a script or another decorate item to make it appear.

Radius 20: this decoration has a radius of 20 map units. Despite what "radius" means, collision boxes are not cylindrical but square; the misnomer is from id's part.

Height 60: this decoration has a height of 60. So now you know it's a block that's 40x40x60 in dimension.

+SPAWNCEILING: gives it the SPAWNCEILING flag, which makes the game place it on the ceiling when spawned. It starts with a + because you add this flag. You could remove it with a -SPAWNCEILING flag as well.

+NOGRAVITY: gives it the NOGRAVITY flag, which means the object will not fall down (and therefore, remain on the ceiling).
States: Signals that we're going to list the states for the actor.

{: open the list of states

Spawn: create the spawn state for the actor.

CHDL ABC 4: A short way of saying that the actor will go through the CHDLA*, CHDLB*, CHDL* frames each for a duration of 4 tics.

Loop: Tell to go back to the last state label (here, Spawn:) once the last frame is finished. So it'll be an endless ABCABCABCABCA dance, which makes our chandelier animated.

}: close the list of states

}: close the list of properties.

This one is pretty simple. Only way you could make it simpler would be with a decoration that isn't even animated. Say, for example, you have a CHDLD0 sprite that corresponds to an unlit chandelier. You could have simply:
  States
  {
  Spawn:
    CHDL D -1
    Stop
  }
-1 means "forever" and Stop means the object ceases existing when it leaves the previous state. Which will never happen since it lasts forever.

And now here comes the wonderful part of DECORATE: inheritance. You can base an actor on one that already exists. The new actor will inherit everything from the old except for its class name (obviously), its editor number, its spawn ID, and its "game" selector. Note that an actor does not need to have a map editor number, a spawn ID, or a game selector anyway. The game selector is only needed to avoid conflicts with the two above numbers.

So, you're making an unlit chandelier. You'll want to give it map editor number 1337, as an example. You can inherit from the existing chandelier:
ACTOR UnlitChandelier : Chandelier 1337
{
  States
  {
  Spawn:
    CHDL D -1
    Stop
  }
}
The flags, height and radius will be the same as the parent actor, so that's less thing you need to declare.

Share this post


Link to post

Ok I am encountering problems yet again.

I have my image. I understand how the code works, but how do I tell the code to use a specific image in my wad as the sprite in question?

Share this post


Link to post
Starke Von Oben said:

Ok I am encountering problems yet again.

I have my image. I understand how the code works, but how do I tell the code to use a specific image in my wad as the sprite in question?


I don't know what you have named your image in your wad. But eg: if you have named it MYLAMPA0, you would just use

spawn:
    MYLAMP A -1
    loop


just like in the example.

Share this post


Link to post

edit: ninjaed

A Doom lump may have up to 8 characters. For a sprite, it's spread up in this way:

IDEN F A [M A]
IDEN: identifier (always exactly four letters, never more, never less)
F: frame, must be in the range A-Z or one of these three characters: [\]
A: angle for rotation. Either 0 if the sprite has no rotation (like a decoration item) or a number between 1 and 8. 1 is front, 2 is 45°, 3 is 90°, and so on until 8 which is 315°.
M: Mirrored frame. This is optional. It allows to define two frames with just one picture: the first will be normal, and the second will be mirrored horizontally.
A: angle for the mirrored frame.

E.g., BOSSA2B8 corresponds to BOSS A2 and BOSS B8 at the same time, with the latter a mirrored version of the former.

The angle does not matter in DECORATE, since it only concerns the renderer. So you'll just say "BOSS A" to say "frame A of the BOSS sprite" and the game will pick the angle itself as appropriate.

Share this post


Link to post

Just renamed the sprite to HAW6A10 and it's crashed the game!

Got the error "Bad frame characters in lump HAW6C10".

Obviously naming my sprites wrongly.

Can someone upload an example wad with a series of static sprites in it for me to look at?

Share this post


Link to post
Starke Von Oben said:

HAW6.bmp

VADE RETRO SATANAS!

Okay, there are two problems here. The first and most immediately apparent was, indeed, that your sprite does not have a frame nor a rotation number. HAW6A0 is a valid name.

The second problem is that you are using a BMP file. This format is not supported by ZDoom because it is too cumbersome. Using BMP pictures is like using uncompressed .wav files for music. It is something that should never be done and therefore, in their infinite wisdom, Graf and Randy purposefully did not implement support for this format. So unless you converted it to a supported format (Doom's native graphic format, PNG, or even TGA) it will not work.

Note that XWE converts stuff automatically unless you go to great pains to tell it not too. Slumped, on the other hand, does not convert anything unless you tell it too. So make sure that it's not in BMP in the wad.

Starke Von Oben said:

HAW6A10


This can not work. Let's analyze:
HAW6: sprite name - valid
A: frame name - valid
1: rotation number - valid
0: mirrored frame name - INVALID!
: mirrored frame rotation number - MISSING!

Starke Von Oben said:

HAW6C10

What, it's HAW6A10 or HAW6C10?

Either way, what you want is HAW6A0 or HAW6C0. Not 10, 0.

Share this post


Link to post

[WH]-Wilou84 said:
Try to rename your HAW6.bmp into HAW6A0.bmp, this may work.


Yes, that worked!

Break that down for me - I am finding this naming of sprites somewhat confusing.

Share this post


Link to post

So this is how one makes a standard static sprite in Zdoom?

actor Eagle 10242
{
height 128
radius 24
+SOLID
states
{
Spawn:
EAGL A 10
loop
}
}


The name of the sprite is EAGLA0. It appears in the game, but as I said I'm still somewhat confused with sprite naming.

Share this post


Link to post
Starke Von Oben said:

So this is how one makes a standard static sprite in Zdoom?

actor Eagle 10242
{
height 128
radius 24
+SOLID
states
{
Spawn:
EAGL A 10
loop
}
}

Since it's not animated and it doesn't do anything (no codepointer), instead of "EAGL A 10" you should use "EAGL A -1". -1 means "forever" so the game won't bother running the tick counter for this actor and going back to the same state. Sure, it's doubtful it'll make even one FPS of difference, but well...

Starke Von Oben said:

as I said I'm still somewhat confused with sprite naming.


If only someone had posted a detailed explanation above... Maybe something that would have read like this:

Gez said:

A Doom lump may have up to 8 characters. For a sprite, it's spread up in this way:

IDEN F A [M A]
IDEN: identifier (always exactly four letters, never more, never less)
F: frame, must be in the range A-Z or one of these three characters: [\]
A: angle for rotation. Either 0 if the sprite has no rotation (like a decoration item) or a number between 1 and 8. 1 is front, 2 is 45°, 3 is 90°, and so on until 8 which is 315°.
M: Mirrored frame. This is optional. It allows to define two frames with just one picture: the first will be normal, and the second will be mirrored horizontally.
A: angle for the mirrored frame.

E.g., BOSSA2B8 corresponds to BOSS A2 and BOSS B8 at the same time, with the latter a mirrored version of the former.

The angle does not matter in DECORATE, since it only concerns the renderer. So you'll just say "BOSS A" to say "frame A of the BOSS sprite" and the game will pick the angle itself as appropriate.

Share this post


Link to post

Gez you are a genius!

Yes it's slowly starting to make a lot of sense now. I've just made a series of Static Trees and an animated camp fire :D

Is it also possible with Decorate to scale down images? Let's say I have a massive sprite that's 256 pixles high, but I want to scale it down in the game engine (similar to Blood).

Is that possible with Decorate/Zdoom?

Share this post


Link to post

You should really read more into the wiki instead...

Share this post


Link to post
Torn said:

You should really read more into the wiki instead...


Reading the wiki is now far easier and worthwhile for myself as a result of this thread. Consider it a "Decorate for Dummies" that I'm using to get to grips with it.

Share this post


Link to post

How would one go about giving an object a sound?

Let's say I want to give my campfire the sound of crackling fire. How would I go about that? Are there particular names you need to give .wav files similar to sprites?

Share this post


Link to post

Hi!
I had similar troubles with the simplest sprites. But the Doom Builder 1 does not know the dimensions or the looks of the sprites in the editor.
My code looks like this:
----------------------
actor TMS1 10242
{
Height 40
Radius 20
+SOLID
States
{
Spawn:
TMS1 A -1
stop
}
}
-----------------------

The editor still doesn't show the sprite, dimensions, ect. It doesn't even show in the 3d-mode. But it shows in the game. Why's this?

Share this post


Link to post
Starke Von Oben said:

How would one go about giving an object a sound?

Let's say I want to give my campfire the sound of crackling fire. How would I go about that? Are there particular names you need to give .wav files similar to sprites?


I did something like that in this way:

1. Add this line (or similar) to the SNDINFO-lump
$AMBIENT 3 vile/firecrkl POINT 4 CONTINUOUS .55 (3 is the ambient sound thing no., vile/firecrkl is the archvile fire-sound, 4 is the falloff distance (the smaller, the shorter distance IIRC) and .55 is the volume.

2. Add the Ambient sound thing to the fireplace.

That'll propably take care of it :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now