Multple models per frame

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Multple models per frame

Post by Enjay »

I thought this was possible, and I'm sure I have seen it described how to do it, but I can't find the info ATM.

What I am trying to do is make an actor use more than one model per frame. In this case, it's a simple test where what I want to appear on screen is made from two separate models that combine to form the complete appearance that I want. Here's what I have been trying:

Code: Select all

Model Test01
{ 
    Path "Models" 
    Model 0 "part1.md2" 
    Skin 0 "part1.png"
    Scale 1.0 1.0 1.0
    
    Frame POSS A 0 "frame01"
}


Model Test01
{ 
    Path "Models" 
    Model 1 "part2.md2" 
    Skin 1 "part2.png"
    Scale 1.0 1.0 1.0
    
    Frame POSS A 1 "frame01"
}
However, when I look at the actor test01 in game, all I get is whichever model is allocated to it last. If I apply the models on their own, both work, but either it isn't possible to combine them, or I'm doing it wrong.

So, help me Obi-wan Kenobi, you're my only hope. ;)
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

Aha! got it.

Code: Select all

Model Test01
{ 
    Path "Models" 
    Model 0 "part1.md2" 
    Skin 0 "part1.png"
    Scale 1.0 1.0 1.0
    
    Model 1 "part2.md2" 
    Skin 1 "part2.png"
    Scale 1.0 1.0 1.0
    
    Frame POSS A 0 "frame01"
    Frame POSS A 1 "frame01"
}
I'm not sure if that's the best way to set it out, but it works. :)
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

And it seems that if you want to do something a little more complex (in this case, I'm changing the skin on only the second model between the A and B frames) it needs to be something like this:

Code: Select all

Model Test01
{ 
    Path "Models" 
    Model 0 "part1.md2" 
    Skin 0 "part1.png"
       
    Model 1 "part2.md2" 
    Skin 1 "part2a.png"
    
    Scale 1.0 1.0 1.0
    
    Frame POSS A 0 "frame01"
    Frame POSS A 1 "frame01"
}


Model Test01
{ 
    Path "Models" 
    Model 0 "part1.md2" 
    Skin 0 "part1.png"
       
    Model 1 "part2.md2" 
    Skin 1 "part2b.png"
    
    Scale 1.0 1.0 1.0
    
    Frame POSS B 0 "frame01"
    Frame POSS B 1 "frame01"
}
If this is correct, I'll add it to the docs thread. It certainly works as I want it to anyway, so here's hoping that it's right. :)


For info, one of my abortive attempts to get it to work was this, which does not work:

Code: Select all

Model Test01 
{ 
    Path "Models" 
    Model 0 "part1.md2" 
    Skin 0 "part1.png" 
        
    Model 1 "part2.md2" 
    Skin 1 "part2a.png" 
        
    Model 2 "part2.md2" 
    Skin 2 "part2b.png" 

    Scale 1.0 1.0 1.0 
    
    Frame POSS A 0 "frame01" 
    Frame POSS B 0 "frame01" 
    Frame POSS A 1 "frame01" 
    Frame POSS B 2 "frame01" 
} 
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Argh. There's no reason other than a bug that the last example does not work.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

Kind of related... kind of. If I wanted one of the models attached to an object to be bright, but the other one not to be, is that possible? (I suspect not.)

The method that I have used for such a setup in the past has been to create a decorate object that has one model attached, and which also spawns a second decorate object which has the model that forms the other part of the composite appearance attached. One decorate object has bright frames, the other does not.

That works fine for everything I have needed it for (which has only ever been static decorations - or ones with limited movement (e.g. for a couple of decorations, on model was rotating but the other wasn't)) but I guess that it would be limited and almost no use for monsters etc.
User avatar
Tormentor667
Stronghold Team
Posts: 3555
Joined: Sun Nov 13, 2005 23:15
Location: Germany
Contact:

Post by Tormentor667 »

Someone should add this to the wiki, I find this quite useful
User avatar
Tormentor667
Stronghold Team
Posts: 3555
Joined: Sun Nov 13, 2005 23:15
Location: Germany
Contact:

Post by Tormentor667 »

*push*
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Post by Rachael »

If I understood it, I would. I'd have to apply it myself, though, and right now I don't have much motivation to really get into it and try to understand it.
Locked

Return to “GZDoom”