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

Custom sprites do not work properly in-game

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

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.

 

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

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
×