One of the limitations of ZScript's `extend` functionality is that it can only extend classes defined in the same mod. Unfortunately, this makes it significantly less useful when working with classes that share a superclass in gzdoom.pk3. Often, you will need to either include the same code in multiple places, or replicate code that already exists in gzdoom.pk3.
I believe this feature suggestion would help to somewhat alleviate that. Class extensions should be able to be used on multiple classes at once, separated with commas. This would just be a bit of syntactic sugar added to the compiler.
would be exactly equivalent to
Code: Select all
extend class foo {
//...
}
extend class bar {
//...
}
This would help to reduce code duplication when inheriting from actor classes in gzdoom.pk3. For example, if you were to define custom classes inheriting from Hexen's three playable classes, you could then add behavior to all three of them without having to copy/paste code.