Author Topic: Getting the object created from a default/different function  (Read 3798 times)

wasn't sure if it returned something useful or not, just the concept of not using the flags though

Tbh, you should always return the parent, even if it doesn't return anything in the original code.

Tbh, you should always return the parent, even if it doesn't return anything in the original code.
No, not really.

Just to give you a general idea of what you should and shouldn't.

Shouldn't:
ServerCmds
ClientCmds
Callback functions such as onAdd, onRemove, onTrigger, onClientEnterGame, etc.

Should:
Anything else


Why? Because anything you shouldn't is typically not called through script, and isn't expecting any return value on the engine side.
The only exception I can think of is that it's nice to return the projectile from onFire. But with so many people lazily copy and pasting the entire ephi shotgun code for any given moment they need to create a projectile, that's a lost cause.

I don't really want to waste time debating on why you should be returning parents, yes even in serverCmds when packaging them. You'll eventually figure out why, if you haven't yet..

I figure return the parent instead of just calling it
that way if there was something, it gets passed up the chain
if there wasn't something, that nothing still gets passed up the chain

since torque isn't really as well defined as to what things return, it's easier to just return whatever the parent was doing to mimic the behaviour