Page 2 of 2

Re: Multiple extends

PostPosted: Thu Jan 03, 2019 12:10 pm
by Gez
But things like, say, giving cacodemons blue blood without replacing them will be possible? Or changing the maxamount property of an ammo type?

Re: Multiple extends

PostPosted: Thu Jan 03, 2019 12:34 pm
by Graf Zahl
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.

Re: Multiple extends

PostPosted: Thu Jan 03, 2019 12:47 pm
by Matt
So basically something like this would work?
Code: Select allExpand view
extend class Actor{
   virtual void A_CustomChase(vector3 goalpos,statelabel meleestate,...
      ...
}
class CustomZed:Zombieman replaces Zombieman{
   ...
   see:
      POSS ABCD 5 A_CustomChase(...
}

Re: Multiple extends

PostPosted: Thu Jan 03, 2019 12:54 pm
by Major Cooke
@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.

Re: Multiple extends

PostPosted: Thu Jan 03, 2019 1:02 pm
by Graf Zahl
Yes, that would work.

Re: Multiple extends

PostPosted: Sat Jan 05, 2019 4:10 pm
by Major Cooke
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.

Re: Multiple extends

PostPosted: Sat Jan 05, 2019 5:34 pm
by Graf Zahl
It is called 'extension', not 'modification'. I think that says it all.