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

ZDoom hates me: Models don't work

Question

So first I tried making an MD3 format model for a simple 3D thing I want to use in my map. 

 

MODELDEF looked like this:

Model Fence2
{
   Path "models/"
   Model 0 "fence2.md3"
   Skin 0 "fence.png"
   Scale 1.0 1.0 1.2
   FrameIndex FNC2 A 0 0
}

DECORATE looked like this:

actor Fence2 10242
{
    Height 48
    Radius 32
    +SOLID
    States
    {
        Spawn:
            FNC2 A 0
            Loop
    }
}

When I tried to run a map with the thing in Zandronum or GZDoom, it sort of froze. The map would seem to load fine and music would play, but the screen was black and the game didn't accept any inputs. On clicking the "x" to exit, Windows said the program wasn't responsive.

 

Well, then I tried voxels. I got me a KVX file of pretty much the same thing. SLAB6 seems convinced that the file is valid, I can see the thing I made in Magicavoxel just fine.

 

VOXELDEF looked like this:

FNC2 = "voxels/fence2.kvx" {
    scale = 1.0
}

GZDoom has the same freezing issue. Zandronum just shows those vile red diamonds with exclamation marks in them apparently saying there's something missing. Zandronum's log says "Fence2 at (x, y) has no frames".

 

Somebody please help me to at least get one of these things working

 

Share this post


Link to post

26 answers to this question

Recommended Posts

  • 0

Wait. Wait what? It seems to be working now.

 

@R4L your test pk3 held the answer in its DECORATE script.

 

actor Fence2 10242
{
    Height 48
    Radius 32
    +SOLID
	States
	{
	    Spawn:
		    BAR1 A -1
			Stop
	}
}

 

Will somebody please tell me what the heck the -1 is doing there and why it doesn't work with any other numbers and why nobody spotted this before now

Share this post


Link to post
  • 0

Only thing I can think of is that you're ending Spawn states with Loop. Try Stop instead. Also, your frame is 0 duration, which if the wiki is correct then it will crash because its looping endlessly.

 

Turn this:

Spawn:
      FNC2 A 0
      Loop

Into this:

 

Spawn:
      FNC2 A -1
      Stop

 

Edited by R4L

Share this post


Link to post
  • 0
7 minutes ago, R4L said:

Only thing I can think of is that you're ending Spawn states with Loop. Try Stop instead. You only have 1 frame anyway so Loop shouldn't be used.

 

Oh hey, that fixed the freezing problem. It didn't fix the models or voxels problems. Models are red error signs, and the voxels just don't show up at all.

 

GZDoom Builder says, "Unable to find sprite lump "FNC2A" used by actor "Fence2":10242. Forgot to include required resources?".

Share this post


Link to post
  • 0
10 minutes ago, meapineapple said:

 

Oh hey, that fixed the freezing problem. It didn't fix the models or voxels problems. Models are red error signs, and the voxels just don't show up at all.

 

Then your path to your model's textures are wrong, or you don't have the texture file inside your models folder. If your texture is inside another folder inside the models folder, make sure it says so in your Skin definition.

 

EDIT: Actually, are you getting the red error signs in your map editor or in-game? If it's in the editor, then you need a TEXTURES lump:

 

sprite FNC2A0, 1, 1 { Patch TNT1A0, 0, 0 }

 

Share this post


Link to post
  • 0

For your viewing pleasure:

 

The DECORATE lump

 

6XNWcW5.png

 

The MODELDEF lump

 

DumU2S7.png

 

The "models/" directory within the pk3

 

QZVzCJr.png

 

The file "fence2.md3", 16 units to each side and 48 units tall, as viewed in Misfit Model 3D:

 

YdiAfou.png

 

Where I put the "Fence2" things, in GZDoom Builder bugfix

 

sBPBuNu.png

 

Where the "Fence2" things ought to be, but are not appearing, in GZDoom 3.6.0

 

hCTidBd.png

Share this post


Link to post
  • 0

When you look a little more closely you can see that GZDoom Builder at least isn't having big problems loading the model. It shows a wireframe within the thing bounding boxes:

 

SthLDIJ.png

Share this post


Link to post
  • 0
11 minutes ago, meapineapple said:

When you look a little more closely you can see that GZDoom Builder at least isn't having big problems loading the model. It shows a wireframe within the thing bounding boxes:

 

SthLDIJ.png

 

Okay, but where is the model? If it isn't showing up in-game or in GZDB, then you have a paths issue. Does Misfit Model 3D have a material editor? In Blender, I just name my materials so they match the path in my .pk3 and they show up fine:

 

Blender3.PNG

Share this post


Link to post
  • 0

Here's the voxels, showing up just fine in GZDoom Builder bugfix:

 

QGRjKIU.png

 

Here's the voxels, not showing up at all in GZDoom 3.6.0:

 

NyGGtXS.png

 

I am annoyed.

 

Share this post


Link to post
  • 0

@R4L I don't understand what you're talking about. Clearly the model is showing up in GZDoom Builder. If you look in the thing boxes, you can see the wireframe of the same model shown in Misfit. I showed where the texture PNG is in the screenshots of SLADE, right alongside the MD3 file.

Share this post


Link to post
  • 0

This is the first MD3 model I've tried, and the first KVX voxel I've tried, and the only ones I have on hand. Any others I made would necessarily go through the same process. Specifically:

 

Geometry + UVs in Blender -> export OBJ -> Load in Misfit -> export MD3 -> Point MODELDEF to texture PNG and model MD3

 

Voxels in Magicavoxel -> export slab -> Load in SLAB6 -> Set pivot -> export KVX -> Point VOXELDEF to that KVX

Share this post


Link to post
  • 0
13 minutes ago, meapineapple said:

This is the first MD3 model I've tried, and the first KVX voxel I've tried, and the only ones I have on hand. Any others I made would necessarily go through the same process. Specifically:

 

Geometry + UVs in Blender -> export OBJ -> Load in Misfit -> export MD3 -> Point MODELDEF to texture PNG and model MD3

 

Voxels in Magicavoxel -> export slab -> Load in SLAB6 -> Set pivot -> export KVX -> Point VOXELDEF to that KVX

Why use Misfit to export to .md3? Just export it to .md3 in Blender with Nash's exporter: https://forum.zdoom.org/viewtopic.php?f=37&t=35790

 

 

Then you won't need misfit at all, and you can do what I suggested earlier: naming the materials so they match the paths in your .pk3. Even though it shows up in GZDB, it sounds like UVmaps are getting lost when you export the .obj to .md3.

Share this post


Link to post
  • 0

@R4L Because I couldn't get the Blender exporter to work - the installation just wasn't installing, with no error messages, no success messages, nothing - and the Blender community is impenetrable when trying to figure out why something doesn't work. 

 

And I very much seriously doubt that the problem is that I exported to OBJ first, or that this issue has to do with materials. My Blender model file has one texture and one material, and it's only in there so I can see what I'm doing when I set UV coords. 

Share this post


Link to post
  • 0

Installer? There isn't an installer for Nash's plugin. You simply extract it to your plugins directory. Then in File - User Preferences, you can add it as a plugin. After that, you just select your model, and export as GZDoom .MD3. This is what I use and my models work fine.

Share this post


Link to post
  • 0
21 minutes ago, Kappes Buur said:

@meapineapple R4L made an excellent tutorial, did you read that.

 

@R4L Part II ?  :-)

 

Someday!

 

Also, wanted to say @meapineapple that going from .obj to .md3 could be the entire problem... There's no reason to export to .obj just so you can export to .md3. You already do everything in Blender, might as well export to .md3 too.

Share this post


Link to post
  • 0

Few questions:

 

1) Are you running Hardware Mode or the Softpoly Mode?  Models only show up in the Hardware Mode

2) Does the Thing exist in the game ok?  If you IDDT it, are they present?  That tells you if it's the Thing that's an issue or the model

3) Make sure you're on the latest version of GZDoom to ensure it's not a bug that was fixed

4) My MODELDEFs look a little different to yours, perhaps try rewriting yours like this:

Model Fence2
{
   Model 0 "models/fence2.md3"
   Skin 0 "models/fence.png"
   Scale 1.0 1.0 1.2
   FrameIndex FNC2 A 0 0
}

5) Perhaps try changing the referenced sprite to something that actually exists, like TNT1 or even a real sprite like BAR1.  FNC2 not existing might be confusing it.

Share this post


Link to post
  • 0
11 hours ago, Bauul said:

1) Are you running Hardware Mode or the Softpoly Mode?  Models only show up in the Hardware Mode

 

I was using the "OpenGL-Accelerated" mode. I tried switching through all of the rendering options and it didn't make a difference for either the MD3 model or the KVX model.

 

Quote

2) Does the Thing exist in the game ok?  If you IDDT it, are they present?  That tells you if it's the Thing that's an issue or the model

 

This has been weird. Currently, no, the things don't show up with IDDT. But in the past, even without changes to DECORATE, sometimes the things have been invisible but still block me, sometimes they don't seem to be there at all. Sometimes they've been red exclamation marks that block me, sometimes they don't.

 

Just to reiterate, the things show up 100% fine in GZDoom Builder using the both the MD3 and KVX models. Wireframes show up in the normal editor view within the thing bounding boxes, and the models themselves show up exactly as I expect them to look in the 3D map view.

 

Quote

3) Make sure you're on the latest version of GZDoom to ensure it's not a bug that was fixed

 

I downloaded GZDoom 3.7.2 and tried doing the same testing steps with that version instead for both the MD3 and the KVX. There wasn't any difference.

 

Quote

4) My MODELDEFs look a little different to yours, perhaps try rewriting yours like this:

 

No change in GZDoom's behavior.

 

Quote

5) Perhaps try changing the referenced sprite to something that actually exists, like TNT1 or even a real sprite like BAR1.  FNC2 not existing might be confusing it.

 

Changing all instances of "FNC2" to "BAR1" didn't fix either the MD3 or the KVX.

 

 

 

I'm attaching two versions of the resource pk3 I've been using. (With *.zip extension because of forum uploader limits.) To test for yourself, make a map with GZDoom Builder and add one pk3 as a resource, add at least one "Fence2" thing, and then run with GZDoom. The only difference between these two pk3 files is that one has "MODELDEF" and "models" with my "VOXELDEF" and "voxels" renamed to something else, and the other has "VOXELDEF" and "voxels" with "MODELDEF" and "models" renamed to something else.

 

resource-md3.zip

 

resource-kvx.zip

 

Share this post


Link to post
  • 0
15 hours ago, meapineapple said:

And I very much seriously doubt that the problem is that I exported to OBJ first, or that this issue has to do with materials. My Blender model file has one texture and one material, and it's only in there so I can see what I'm doing when I set UV coords. 

 

I just imported your .md3 into Blender, and lo and behold:

 

hmmmmmm.PNG.69be9b8ba1e86b8304cac532b5d99fb8.PNG

 

You have fence.png in your .pk3 as your texture, but GZDoom will never find it because in Blender you've textured it with fence-texture.png. Furthermore, this won't work even if you rename fence.png to fence-texture.png because it has a .001 file extension now thanks to how Blender appends numbers to duplicate textures. Please rename your materials like this:

 

hmmmmmm.PNG.6824c92a7a1a113ec4de8f8c77e6ec2c.PNG

 

Then export with Nash's MD3 Exporter. If you use Misfit it should be okay too I guess. Here's a test .pk3 so you can see:

test.rar

 

Share this post


Link to post
  • 0

I suggest just using MODELDEF's skin property to assign the correct texture file name and directory. This way, you don't have to deal with correct filenames.

Share this post


Link to post
  • 0

That's what I've been doing @Cherno. The model displays just fine in GZDoom Builder. I don't get any error messages in GZDoom, no weirdly-textured models. They just don't show up.

 

@R4L Okay, I tried using the test pk3 you sent and the model did in fact show up in GZDoom. I have not got the faintest idea why the material texture path would have anything to do with anything given I told MODELDEF exactly where to find it, but alright.

 

Any chance now of fixing the voxels, too?

 

Share this post


Link to post
  • 0
15 minutes ago, meapineapple said:

That's what I've been doing @Cherno. The model displays just fine in GZDoom Builder. I don't get any error messages in GZDoom, no weirdly-textured models. They just don't show up.

 

@R4L Okay, I tried using the test pk3 you sent and the model did in fact show up in GZDoom. I have not got the faintest idea why the material texture path would have anything to do with anything given I told MODELDEF exactly where to find it, but alright.

 

Any chance now of fixing the voxels, too?

 

¯\_(ツ)_/¯

 

You are talking about something that's hacky to begin with (MODELDEF) so it's not surprising that it doesn't work as intended.

 

Voxels aren't my thing, but you could try asking@Ermin. Solace Dreams uses voxels quite well.

Share this post


Link to post
  • 0

So I was able to replace an existing thing's frame with a voxel model and it displayed in GZDoom as I expected it to. Whatever is going on, it apparently is not a failure to load and display voxel models. However, two days later, trying every freaking thing I can think of, I still have not managed to get one of my own voxel things in DECORATE to show up in GZDoom.

Share this post


Link to post
  • 0

The -1 is the time in ticks this frame will show. If it is 0, it will immediately go to the next line, which in this case is Stop, meaning that the actor stops existing right after spawning. I assume that it needs at least a duration of 1 if the State is looped. If it's -1, it will go on forever so the Stop is never reached.

Share this post


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

Will somebody please tell me what the heck the -1 is doing there and why it doesn't work with any other numbers and why nobody spotted this before now

 

EDIT: Cherno is correct!

Edited by R4L

Share this post


Link to post
  • 0

To display voxels in a pk3 pwad you need 3 entries: 

 

1. the map in wad form in a folder named maps

2. the voxels in KVX format  in a folder named voxels

3. a voxeldef text lump

 

Spoiler

 

 

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
×