Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
der_einzige

Doom sprite loop

Recommended Posts

I was trying to make a decoration of a burning corpse that is burning, and with lopping sprites, so it would it would look like the fire is actually moving (like it would in real life).

 

However, I had a problem while testing this.

 

Instead of looping sprites, I noticed something, the sprites only change when I am walking around the corpse in-game.

 

My code

 

  States
  {
  Spawn:
    BODY A 1
	BODY A 2
	BODY A 3
    Loop
  }

BODY A 1, BODY A 2, and BODY A 3 are all just sprites with slightly textures.

 

I was hoping that the way it would work is that it automatically loops, but instead, I can view the different sprites by walking around the corpse.

Share this post


Link to post

Looking at this piece of code, It looks like you're only using 1 frame, so it doesn't animate and is only stuck at that frame, to make it animate, you need to insert more frame letters, so that it would look something like this:

States
{
  Spawn:
    BODY A 1
	BODY B 2
	BODY C 3
    Loop
}

This will make the actor display A, B and C frames then loop back to the first, 1,2 and 3 are actually the duration between each state, and not the frame numbers, looks like you got some things mixed up, Read more about state definitions here.

Share this post


Link to post
1 hour ago, tempdecal.wad said:

Looking at this piece of code, It looks like you're only using 1 frame, so it doesn't animate and is only stuck at that frame, to make it animate, you need to insert more frame letters, so that it would look something like this:


States
{
  Spawn:
    BODY A 1
	BODY B 2
	BODY C 3
    Loop
}

This will make the actor display A, B and C frames then loop back to the first, 1,2 and 3 are actually the duration between each state, and not the frame numbers, looks like you got some things mixed up, Read more about state definitions here.

I have in the past only made maps and I'm new to spriting, I've been wondering about the sprite names, is there any difference between "NAME A 1" and "NAME E 1", why would that code work, but not my code?

Share this post


Link to post
Posted (edited)

The difference between NAME A 1 and NAME E 1 is, obviously, the frame letter, the first one displays the A frame, wheras the second displays the E frame.

 

Your code works, but not properly, because it's basically stuck in 1 frame (which is A), so it doesn't animate ingame.

Share this post


Link to post

The letter denotes which frame (image) will be displayed. This corresponds with the lumpname:

 

Lump "NAMEA1": The sprite name is the first four characters "NAME", and this is frame "A", and 1 = the angle, as follows:

1 = 6 o'clock (looking right at you)

2 = 7:30 (looking to the right of you)

3 = 9:00 (turned to the left)

4 = 10:30

5 = 12:00 (looking away from you)

6 = 1:30

7 = 3:00

8 = 4:30

 

Use 0 for a sprite that does not rotate, like Doom's blue +1 health bottle. It has the following lumps:

BON1A0

BON1B0

BON1C0

BON1D0

 

(forget the 1 here, that's part of the sprite name). So you have 4 frames of animation here (A thru D), for a sprite that does not rotate (hence "0").

 

Lump names come in 2 different formats:

Format #1:

NNNNFR, where "NNNN" = sprite name, F = frame letter, and R = rotation (0, or 1 thru 8. Some ports also support 8 more rotations using "A" thru "H").

 

Format #2:

NNNNFRfr, same as above, with the addition of another frame letter ("f") and another rotation ("r"). This allows a single image to be used for 2 different frames/rotations. When the alternate frame/rotation is used, the image is drawn inverted along the vertical axis.

Example:

BOS2A2C8: This image is drawn normally for frame A when the monster is looking towards 7:30. This image is also drawn inverted during frame C, if the monster is looking towards 4:30.

 

Basically, when the engine is rendering the sprites, and realizes that it needs to draw frame C of BOS2, looking towards 4:30, it looks for a lump that can satisfy this need. If there was a BOS2C8 lump, it would draw that image un-inverted. But, that lump doesn't exist. However, the engine does find BOS2A2C8, so it uses that. And, because the "C8" is in the alternate position in the lump name, the engine inverts the image.

 

If none of those lumps existed, but a BOS2C0 lump did exist, the engine would use that lump to draw frame C of BOS2. And, because the rotation is defined as "0" in the lump name, this image would be used regardless of which way Doom thinks the monster is looking.

 

Hope that helps.

 

Share this post


Link to post
6 hours ago, Space Marinara said:

Just to be sure- your filenames end with a zero?

Not when I wrote this, however, I changed them to NAMEA0, NAMEB0 and NAMEC0, and now they don't work at all. I changed the names also from the DECORATE, so that can't be the issue either.

Share this post


Link to post
3 hours ago, kb1 said:

Use 0 for a sprite that does not rotate, like Doom's blue +1 health bottle. It has the following lumps:

BON1A0

BON1B0

BON1C0

BON1D0

This is exactly what I have now, yet only the yellow exclamation mark shows in game.

 

See my reply to Space Marinara

Share this post


Link to post
3 hours ago, der_einzige said:

This is exactly what I have now, yet only the yellow exclamation mark shows in game.

 

See my reply to Space Marinara

You know, I checked your profile: 15 posts, and most were about, or related to custom sprites. And, in your last thread, you claimed that you were getting the yellow "Sprite not found" exclamation point when you try to test your maps.

 

I replied, stating that you could get a quick answer to your problems by posting your WAD, and that this would avoid a lot of back-and-forth posting, and "try-this, try-that" stuff.

 

You didn't reply, and you didn't post your map, and as a result, you've spawned a lot of back-and-forth posting, and "try-this, try-that" stuff :)

 

Post an example my friend! The experts here will be able to identify what's wrong immediately, I assure you. (And, if you're worried someone will see your super-duper secretive stuff... don't be: we've seen it all).

 

Or, you know, try this, try that.

 

Share this post


Link to post
6 hours ago, der_einzige said:

Not when I wrote this, however, I changed them to NAMEA0, NAMEB0 and NAMEC0, and now they don't work at all. I changed the names also from the DECORATE, so that can't be the issue either.

That looks right, does the decorate looks like this?:

States
{
Spawn:
	NAME A 1
	NAME B 1
	NAME C 1
	Loop
}

Those 1s can be increased (try equally at first) for slower animation. 35 = 1 second delay between frames.

 

Posting the file would be a great help as well...

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
×