• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Proper way to Extend w/ Mutator?

PoPoWanObi

Active member
Jan 27, 2016
29
0
I just want to be sure I understand this fully, before I begin to encounter errors I could've avoided by educating myself prior.

If I want to extend the KFMutator class, I would

Code:
Class MyCustomClass extends KFMutator

and then proceed to write my code?

Or am I required to incorporate the entire functions of KFMutator in order to proceed? (I.e., call on the vars/functions).

If there's a coding guide that I missed, I would greatly appreciate a link to that as well.
 
You are correct.

Personally, I would suggest also naming your mutator something like MutClassName so an example of this, MutMyMutOwns! It's like a prefix with Mut = mutator, Char = character etc etc.It's a good thing to get into the habit of early, then doing it later.

Once you extend a class, it will use ALL code it uses.

Awesome, thanks for the info.

I've already started using ClassnameMut, since that seemed to be the trend.
 
Upvote 0
Just to further clarify:
class myclassname extends someotherclass

myclassname has to be exactly the same as the the file name you are using. IE: BonjoMut.uc. "myclassname" would have to be "BonjoMut".

Any time you extend a class, your class inherits all the code of the extended class. And all the classes that are extended thereon.

IE: KFMutator extends Mutator which extends Info which extends Actor which extends Object.

KFMutator inherits all the code from everyone of those classes.
 
Upvote 0
Awesome, thanks for the info.

I've already started using ClassnameMut, since that seemed to be the trend.

Yeah I noticed this was a trend. I guess I prefer to type "mut" when looking for my mutator files as then it points instantly to this file instead of searching with the find and having it in the name. Little things I find helps with huge projects :p

Only an opinion though but glad you're getting there.
 
Last edited:
Upvote 0