3D model not showing up in game.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

3D model not showing up in game.

Post by Hidden Hands »

In my PK3, I have a model of some curtains that blow about in the wind, generously created by HAL9000 on here. It's an amazing effect that I'm trying to implement but when I enter the builder, the model isnt there. What I have is the following:

AnimDefs.Curtains
Modeldef.Curtains
ZScipt.curtains
Mapinfo.curtains

in the root of the PK3.

In the "models" directory I have the curtain directory, which includes 3 different curtain types directories and the MD3 file.

Is this all I need or do I need a DECORATE file? Because as it stands, I have no way of using it.

Thanks in advance.
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: 3D model not showing up in game.

Post by Cherno »

The actor needs to be defined in either ZScript or DECORATE.

Also make sure it has a Spawn state defined with the model replacing the sprite of the first frame.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: 3D model not showing up in game.

Post by Hidden Hands »

Cherno wrote:The actor needs to be defined in either ZScript or DECORATE.

Also make sure it has a Spawn state defined with the model replacing the sprite of the first frame.
Could you explain what you mean please? I'm not sure exactly what you mean by replacing a sprite. (I've never used 3d Models before, sorry).
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: 3D model not showing up in game.

Post by Cherno »

Code: Select all

ZScript Actor:

class MyActor : Actor
{
     States
     {
          Spawn:
          PLAY A 1;
          Loop;
     }
}

MODELDEF entry:

Model MyActor
{
	Model 0 "models/MyModel.md3"
	SurfaceSkin 0 0 "models/MyModel.png"
	FrameIndex PLAY A 0 0
It would help if you could explain what you mean by "the model is not there". Are there any errors? Have you made sure that the scale is not too small, or large, or the offsets wrong so the model is hidden by level geometry?
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: 3D model not showing up in game.

Post by Hidden Hands »

Ok well this is my ZScript, but in the GZDOOM Builder, there is no object to choose. I tried to add it to its own category called 3d models, but that didn't work either. If I place the DOOMEd number it just shows a red question mark in the editor and in the game it shows up as an exclamation mark in a diamond.

Code: Select all

class Curtain_destroyed : Actor 
{
//$Category 3D Models
//$Title Curtain Destroyed
    Default
    {
        Radius 26;
        Height 30;
        Health 5;
        Mass 1000;
        +NOBLOOD
        +ACTLIKEBRIDGE
        +NOGRAVITY
        }
    States
    {
    Spawn:
        CU00 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
        CU01 ABCDEFGHIJKLMNOPQRS 1;
                LOOP;
    }
}

class Curtain_damaged : Actor 
{
//$Category 3D Models
//$Title Curtain Damaged
    Default
    {
        Radius 26;
        Height 30;
        Health 5;
        Mass 1000;
        +NOBLOOD
        +ACTLIKEBRIDGE
        +NOGRAVITY
        }
    States
    {
    Spawn:
        CU02 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
        CU03 ABCDEFGHIJKLMNOPQRS 1;
                LOOP;
    }
}

class Curtain_new : Actor 
{
//$Category 3D Models
//$Title Curtain New
    Default
    {
        Radius 26;
        Height 30;
        Health 5;
        Mass 1000;
        +NOBLOOD
        +ACTLIKEBRIDGE
        +NOGRAVITY
        }
    States
    {
    Spawn:
        CU04 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
        CU05 ABCDEFGHIJKLMNOPQRS 1;
                LOOP;
    }
}
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: 3D model not showing up in game.

Post by Cherno »

What happens if you summon the actor in the game?
Also, these lines:

Code: Select all

//$Category 3D Models
//$Title Curtain Destroyed
have to be inside the Default block.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: 3D model not showing up in game.

Post by Hidden Hands »

Cherno wrote:What happens if you summon the actor in the game?
Also, these lines:

Code: Select all

//$Category 3D Models
//$Title Curtain Destroyed
have to be inside the Default block.
When I summon the actor in game, it acts like it worked but nothing actually happens. It doesn't appear. ?
Moving the other bits to the default block now.

EDIT, just did that butu they still dont show up in the builder.

Also, when I boot the game it has an error. It cannot understand the flag +NOFRICTIONBOUNCE
Any idea why?
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: 3D model not showing up in game.

Post by Cherno »

Post your pk3 please.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: 3D model not showing up in game.

Post by Hidden Hands »

I can post it if absolutely necessary. But it will take time to upload. This is driving me nuts.
Post Reply

Return to “Scripting”