A getting started question CH5
by David Horn · in Torque Game Engine · 11/15/2007 (2:00 pm) · 3 replies
Sorry if this is a stupid question.
in chapter 5 in the player.cs file, they talk about the onCollision method. Is "onCollision" Torque thing that's automatically called when the referenced model collides with something? same question with the onImpact method.
In general, as a noob to torquescript, I'm having a lot of trouble going through this book - or any tutorials - and determining what is a torque-defined method and what is a user-defined method.
thanks for any help.
in chapter 5 in the player.cs file, they talk about the onCollision method. Is "onCollision" Torque thing that's automatically called when the referenced model collides with something? same question with the onImpact method.
In general, as a noob to torquescript, I'm having a lot of trouble going through this book - or any tutorials - and determining what is a torque-defined method and what is a user-defined method.
thanks for any help.
About the author
#2
also, determining which functions are defined in script, and which are engine functions is the main problem I always had with the torque scriptbase. the thing is, if it's defined in script, then you should be able to do a directory search for the name of the function to find where it's defined. the best advice I can give you is to take a chunk of time one day and go through the code and search for function names. rather than just finding them, make notes in the script indicating where each function is defined so you never have to think about it again.
11/28/2007 (7:16 am)
David chapter 5 is a bitch. I think that's the first chapter where I started getting confused and frustrated. The good news is that it only gets easier after chapter 5.also, determining which functions are defined in script, and which are engine functions is the main problem I always had with the torque scriptbase. the thing is, if it's defined in script, then you should be able to do a directory search for the name of the function to find where it's defined. the best advice I can give you is to take a chunk of time one day and go through the code and search for function names. rather than just finding them, make notes in the script indicating where each function is defined so you never have to think about it again.
#3
11/28/2007 (7:37 am)
That's definitely good advice
Torque Owner Rex
BrokeAss Games
That method is called every time there is a 'collision'[has a fair list of parameters]...it's a 'callback' to engine C++ code...for certain classes of objects.
I, too, struggle with just the difference you note...scoping to either class, datablock, className[object], etc...and why.