Jump to content
  • 0

Custom sprites do not work properly in-game


ChrisVR

Question

I created a simple sprite with palm tree top and wooden barrel. Both textures are in /sprites/ folder in the zip file, in PNG format.

I made a decorate file inside the zip with this:


actor DNPalm 12600
{
    //$Category Duke3D
    //$Title "Palm"
  Height 5
  Radius 5
  Scale 0.8
  -SOLID
  States
  {
  Spawn:
    PALM A -1
    Loop
  }
}

actor DGPB 12601
{
    //$Category Duke3D
    //$Title "Gun pwdr"
  Height 10
  Radius 10
  Scale 0.8
  +SOLID
  States
  {
  Spawn:
    DGPB A -1
    Loop
  }
}

 

In gzDoom Builder I can see these sprites properly,

however the in-game palm tree is shifted, and the barrel does not display at all. It does have solid properties, I can walk over it.

 

Before I made the switch from another thread, my palm tree was working properly, but wooden barrel was not displayed at all.

 

gzdoom_2018-08-10_18-35-51.png

Builder_2018-08-10_18-30-41.jpg

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 0

I have fixed the loop in DECORATE.

 

For those who really do not want to use sprites in WAD file, use SLADE.

 

1. Import PNG file into slide.

2. Apply sprite properties and choose your offset (I choose monster gz - as it places the sprite exactly on the bottom, right in the middle.

3. Save, export changed PNG file into your zip/pk3

4. Use DECORATE code

 

 

gzdoom_2018-08-12_18-59-12.jpg

Edited by ChrisVR

Share this post


Link to post
  • 0

Clearly the problem is that GZDoom ignores both sprite's offsets. They both display as if having offsets (0,0). That is, below the ground they're supposed to stand on. I don't know how to fix this other than putting the sprites into a wad instead of a pk3 and setting the offsets there.

Share this post


Link to post
  • 0

Oh that is disappointing. However I guarantee that for some minutes everything worked just fine, then I realized my sprite was not in square resolution so I edited the canvas, saved the PNG, and then it stopped working in game. I tried to revert it, but the bug remained. Strange.

Share this post


Link to post
  • 0

Some graphic editors automatically zero PNG offsets when editing PNGs. That's apparently what happened to you. Surely it's possible to set the offsets again. By the way, sprites do not need to be in square resolution.

 

Edited by scifista42

Share this post


Link to post
  • 0

I would prefer to keep my graphic files in separate file outside of wad for easier editing.

Are you aware of any PNG editors? I found Slumped/Slade/Setpng but I don't see a straight way to fix the file.

Share this post


Link to post
  • 0

I tried Zandronum with my map and the offset is wrong in that engine as well, while in editor everything shows up properly

Share this post


Link to post
  • 0

First thing, and this is minor, but in your DECORATE code, when you give a state a duration of -1, you should write stop afterward instead of loop.

If you want a solid image editor, you should check out GIMP. It's what I use to manipulate images, and with a little ingenuity, you can make anything you need to.

I agree with what scifista said, that you should move the PNG's into a wad and manually set the offsets there and just fix them as needed.

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