Multiple extends
Moderator: GZDoom Developers
Re: Multiple extends
But things like, say, giving cacodemons blue blood without replacing them will be possible? Or changing the maxamount property of an ammo type?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Multiple extends
No. There can only be one defaults block. This isn't for altering actors but for injecting common code and related data into the base class.
Like, you want some special death state that requires common data and functions. You can now place that stuff in Actor and then inherit from the single monsters and add the new state using that common stuff.
Like, you want some special death state that requires common data and functions. You can now place that stuff in Actor and then inherit from the single monsters and add the new state using that common stuff.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Multiple extends
So basically something like this would work?
Code: Select all
extend class Actor{
virtual void A_CustomChase(vector3 goalpos,statelabel meleestate,...
...
}
class CustomZed:Zombieman replaces Zombieman{
...
see:
POSS ABCD 5 A_CustomChase(...
}
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Multiple extends
@Graf: Ah well. Thanks to CheckReplacement in event handlers, it somewhat makes state label overrides a novelty idea at any rate that's entirely unneeded.
@Matt: Yep, pretty much. Also variables.
@Matt: Yep, pretty much. Also variables.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Multiple extends
Yes, that would work.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Multiple extends
Is it safe to assume that that same restrictions will apply, i.e. you cannot perform an override on the actor functions in the base class when extending it? Just making sure, I figured it would be.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Multiple extends
It is called 'extension', not 'modification'. I think that says it all.