Modeldef Inheritance

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image

Modeldef Inheritance

Postby S_Andrew_S » Fri Oct 15, 2021 11:54 am

Pull Request

Intro
Ever find yourself having to copy hundreds, or even thousands of lines for a silly thing such as a skin or model swap? This is a keyword you can use in modeldef. It specifies an actor's modeldef that you can inherit for this new actor's. I created this keyword for model def because my work process on my latest tinkering has been incredibly hampered by the lack of being able to just use a keyword to simply copy the frames I need. If you're creating enemy variants that use models, but also use trivial changes such as a skin or a model, then this is the feature you need.

Usage:
When using this keyword, all properties defined before the keyword will be transfered to each of the inherited frames. As such, this is most useful for models that do not change any properties after defining the first frameindex. In other words, you must first specify the properties you want to replace for the inherited frames, then specify Inherits.

You can use Inherits as many times as you want.

Inheriting flags works by combining the added flags to the inherited frameindices.

Here is a sample wad file of it's usage. Very rudimentary:
modeltest.pk3
You do not have the required permissions to view the files attached to this post.
User avatar
S_Andrew_S
 
Joined: 02 Apr 2014
Location: USA

Re: Modeldef Inheritance

Postby Cherno » Fri Oct 15, 2021 4:40 pm

I approve of this feature!
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Modeldef Inheritance

Postby Major Cooke » Wed Oct 27, 2021 7:41 pm

Something that everyone has been asking for, for a long... long time. Excellent!
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 0 guests