Game Development Community

Player::initPersistFields() in TSE

by Wayne Russell · in Torque Game Engine Advanced · 08/17/2006 (3:43 pm) · 5 replies

Apologies if this is a well-covered subject - I *have* looked through the forums, but with no luck...

Just bought TSE and I'm trying to port a very small mod I made to TGE a while ago. This mod involves an extra toggleable state variable in the Player class.

The problem I'm having is that the TSE version of Player does not define the method initPersistFields(). A hunt through the source shows that this method is fundamental, and is implemented in every parent class all the way back to ConsoleObject. It *is* defined in the TGE version of the Player class.

Presumably this was removed in TSE for a reason, but there are no comments in the source to indicate what that reason might be. Does anybody know why TGE Player implements this method but TSE Player does not?

Thanks,

Wayne

#1
08/17/2006 (4:03 pm)
Just add it yourself. If you call Parent::initPersistantFields(); as the first line it will work exactly the same as it is now.
#2
08/17/2006 (4:26 pm)
OK, fair enough, and in fact that's what I've done (for now). But surely there's a reason why GG removed the definition? It seems unlikely that they would remove it for no reason, and since they know their codebase about 1000 times better than I do, it seems a little rash to just say "the hell with it" and put it back in...
#3
08/18/2006 (5:28 pm)
I wouldn't sweat it. The initPersistFields method comes from wayyyy up the heirarchy tree. Essentially every object has and does that step no matter what it is, so saying it was "removed" from the player isn't quite accurate, it's more like there wasn't anything for the Player class to add. Why was it removed? Probably to make room in one of the more lengthy and cluttered files in the codebase ;)
#4
08/21/2006 (12:00 pm)
It's not in TGE either (at least 1.4). Not sure when / why it was removed from codebases. Probably was just clutter.
#5
08/21/2006 (2:24 pm)
OK, I'll just put it back in and stop worrying about it! Thanks to all.