That… is the best way I think I can frame my question. Basically, I understand how subclassing works normally, you pass in the controller to the constructor, then mutate the owner to your subclass. However, for my project I will be needing to subclass a large number of objects, and I would rather do it all at load time in one script. So, passing in just cont will only get me the owner back.
I have tried a number of tricks, from passing in a reference to the object itself, to a list of objects to try and grab the one I want. The second method works internally (proven through assertions), but when I try to use the reference I discover the object remains the base KX_GameObject class.
Here is an example of the mutating method from my current setup:
def makeCustom(customList): for x in range(0, len(customList)-1): old_object = customList[x] mutated = customGameObject(customList[x]) assert(old_object is not mutated) assert(old_object.invalid) assert(mutated is customList[x]) customList[x] = mutated
I’ll keep trying new stuff, but has anyone done this before?