Camera and general debug problems
by Ralf Mengwasser · in Torque Game Engine · 01/10/2004 (7:04 pm) · 3 replies
Ok, I was reading lots of source code the whole day but still didnt get anywhere.
What I need is this:
1. A 3rd person camera that floats a certain distance with a set angle over the terrain. It shouldnt be hooked up to any object normally, but if a player clicks an object, it should hover above it looking down. The mouse should scroll, not rotate it. Mousewheel zooms in and out.
Problems I had:
Where in the code is the 3rd person camera info stored? I was able to zoom it in and out, but not via scripts. Where do I take away (or alter) mouse control? Where can I switch camera control to other objects?
The advanced 3rd person camera resource is broke if you apply it to the new HEAD. Why? (Spend a few hours on that one, to no avail :P)
2. Have a cursor on screen to click on objects.
Well, thats my next task after task 1). As I failed to do anything with cameras, i wasnt able to pursue this one. :P
3. Just like to vent my frustration.. I hate scripting. Cant debug nicely through it. Any pointers how to effectively program using Torque? I see how the vars and funcs are exported to script, but how do I debug it? For example I cant debug why my camera isnt responding from script code, cause, HOW? ;)
Any help is really appreciated....
P.S: Pls dont point me to code snip resources, I tried them all... None work with the current Torque CVS. Pls send info what changed in the CVS that broke them all or link to docs about the flow of the camera system. Thx!
What I need is this:
1. A 3rd person camera that floats a certain distance with a set angle over the terrain. It shouldnt be hooked up to any object normally, but if a player clicks an object, it should hover above it looking down. The mouse should scroll, not rotate it. Mousewheel zooms in and out.
Problems I had:
Where in the code is the 3rd person camera info stored? I was able to zoom it in and out, but not via scripts. Where do I take away (or alter) mouse control? Where can I switch camera control to other objects?
The advanced 3rd person camera resource is broke if you apply it to the new HEAD. Why? (Spend a few hours on that one, to no avail :P)
2. Have a cursor on screen to click on objects.
Well, thats my next task after task 1). As I failed to do anything with cameras, i wasnt able to pursue this one. :P
3. Just like to vent my frustration.. I hate scripting. Cant debug nicely through it. Any pointers how to effectively program using Torque? I see how the vars and funcs are exported to script, but how do I debug it? For example I cant debug why my camera isnt responding from script code, cause, HOW? ;)
Any help is really appreciated....
P.S: Pls dont point me to code snip resources, I tried them all... None work with the current Torque CVS. Pls send info what changed in the CVS that broke them all or link to docs about the flow of the camera system. Thx!
#2
I had the same idea, copy some code from the editor, but first I need to solve my camera problems... ;)
Any more suggestions for my camera problem, anyone???
01/11/2004 (5:22 am)
No thats actually a good suggestion. I use Tribal, I just wasnt able to debug with it. I may have missed something with that console command. I will read back up on it.I had the same idea, copy some code from the editor, but first I need to solve my camera problems... ;)
Any more suggestions for my camera problem, anyone???
#3
You've read my resource which could give you a starting point if you're wanting to control one object and view the screen from another. The camera class I attached could be a starting point for your own custom camera.
To get the controls you're wanting, just start editing away at default.bind.cs to change how the mouse creates moves for the control object. I'm not sure if there are events for the mousewheel, perhaps it'll corresponding to the "slider" control when binding commands.
01/11/2004 (8:33 am)
Well out of the box, the third-person camera for a player object is just taking the player's eye point/forward vector and telling the engine to render behind it. You can trace through that by looking at GameConnection::getControlCameraTransform - set a breakpoint and step through the code . If you plug in the Camera class (or alt+c in game) as the control object you can float around.You've read my resource which could give you a starting point if you're wanting to control one object and view the screen from another. The camera class I attached could be a starting point for your own custom camera.
To get the controls you're wanting, just start editing away at default.bind.cs to change how the mouse creates moves for the control object. I'm not sure if there are events for the mousewheel, perhaps it'll corresponding to the "slider" control when binding commands.
Torque Owner Dan -
#2 - Have a cursor on screen to click on objects.
The "editor" with torque (hitting the F11 key) allows you to "select" objects while clicking on them. Chances are that code would work for you.
#3 - ...Scripting...Cant debug nicely through it
Have you tried useing:
Tribal IDE
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4240
or
Cross-platform JEdit Java Editor for working with TGE scripts?
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2981
For debug?
I use Tribal IDE and although it isn't the best debugger I have ever used I can compile/update scripts while the game is running, setup break points, look at vars, step through code, etc. Not too bad.
Hope that helps. If not, sorry I wasted your time.