Game Development Community

Where are the script events?

by Trent · in Torque Game Engine · 08/16/2006 (4:49 pm) · 5 replies

I just bought TGE & TSE last week, and I've been reading loads and loads of tutorials and the documentation. I've found all the descriptions of ShapeBaseData etc and their fields and methods... but what about the events?

I'm just a little lost on this one. I know there are events. I've seen onCollision, onAdd, onWake and onSleep. I don't really know what the last 3 are for, but I've seen them in passing. Is there a nice list somewhere like there is with the datablocks? For example, ok I know onCollision exists, but what about if I click on an object with the mouse? Do I get a notification? I'd assume it's called onClick(), but I can't seem to find any info on events using the search.

Is there any docs on events?

#1
08/16/2006 (6:34 pm)
Get a reference to an object (through script or the mission editor) and call .dump(); on it. The simplest way is to go in the mission editor, place any object you want to see it's methods, and then call dump on numerical ID it shows you in the editor from the console (i.e. 1678.dump();) This will output all of the objects script exposed methods to the console. Sadly there is nothing so simple as onClick, and adding this functionality can be somewhat tricky depending on how exactly you need it.
#2
08/16/2006 (6:47 pm)
Thanks Paul, I'll give it a shot soon (I'm at work currently).
#3
08/16/2006 (9:28 pm)
Hmmm ok I did that but it only shows fields and methods, not events.

I think I posted this in the wrong forum too...
#4
08/16/2006 (10:47 pm)
Trent, you will need to look at the C++ code for that.

Look around for Con::executef calls. Those are how the C++ code activates script events.
#5
08/16/2006 (11:01 pm)
Thanks Peter!

Oh and to Paul, the onClick that I would want would be a ray test on all objects in the world, pretty much like the world editor does.... hmm... *runs off to look at the editor source*