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:

Legacy Status:
Image Image

QZDoom Status:
User avatar
Shiny Metagross
Posts: 175
Joined: Wed Apr 02, 2014 10:00 pm
Location: USA

Modeldef Inheritance

Post by Shiny Metagross »

Pull Request

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.

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:
You do not have the required permissions to view the files attached to this post.
User avatar
Posts: 1315
Joined: Tue Dec 06, 2016 11:25 am

Re: Modeldef Inheritance

Post by Cherno »

I approve of this feature!
User avatar
Major Cooke
Posts: 8190
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Modeldef Inheritance

Post by Major Cooke »

Something that everyone has been asking for, for a long... long time. Excellent!
User avatar
Posts: 152
Joined: Fri May 06, 2022 9:39 pm
Location: Germany

Re: Modeldef Inheritance

Post by lulle »

Dreams came true!

Return to “Code Submissions”