Camera Pathing
by DMT · in Torque 3D Beginner · 06/18/2010 (1:52 pm) · 10 replies
Hey guys,
I want to take a camera and move along a predetermined path. Maybe even pause it along it's path and at a later point let it continue moving.
So, I figured out how create the path. I have NOT figured out how to properly create a camera and attach it to said path. I have also not fully grasped how to switch a player's view to the new camera, I have seen some good example but since I have trouble making a camera to start with those examples are kinda hard to test.
Thanks,
Dmitry
I want to take a camera and move along a predetermined path. Maybe even pause it along it's path and at a later point let it continue moving.
So, I figured out how create the path. I have NOT figured out how to properly create a camera and attach it to said path. I have also not fully grasped how to switch a player's view to the new camera, I have seen some good example but since I have trouble making a camera to start with those examples are kinda hard to test.
Thanks,
Dmitry
About the author
#2
I am trying to use this but somehow, after copying all the scripts from the blog, when I load the mission, nothing happens.
Does anybody know what i am doing wrong?
Thanks
11/05/2010 (4:21 am)
Hello,I am trying to use this but somehow, after copying all the scripts from the blog, when I load the mission, nothing happens.
Does anybody know what i am doing wrong?
Thanks
#3
After some trial and error using Tim´s code, I found that if I type
on the console it returns the following:
"scripts/server/gameCore.cs (457): Unable to find function findMissionObject"
Also, I think that I may be copying the scripts in the wrong place since the OP says to modify the server/scripts game.cs
Is this what I'm doing wrong?
Where do I paste the onClientEnterGame funcion?
Thanks for the help.
11/07/2010 (9:33 pm)
Hi, me again,After some trial and error using Tim´s code, I found that if I type
%this.PathCamera.followPath("MissionGroup/Paths/followCam"); on the console it returns the following:
"scripts/server/gameCore.cs (457): Unable to find function findMissionObject"
Also, I think that I may be copying the scripts in the wrong place since the OP says to modify the server/scripts game.cs
function GameConnection::onClientEnterGame(%this)but this doesn't exist in T3D's server/scripts/game.cs so I placed it in the core/scripts/server/gameCore.cs where it actually exists.
Is this what I'm doing wrong?
Where do I paste the onClientEnterGame funcion?
Thanks for the help.
#4
11/10/2010 (5:53 am)
bump
#5
With your first error, is that function (findMissionObject) something you added, or something that was already in the file?
11/13/2010 (2:20 pm)
In T3D the code should be placed in GameCore::onClientEnterGame in game\scripts\server\gameCore.cs.With your first error, is that function (findMissionObject) something you added, or something that was already in the file?
#6
The problem was the place of script.
One curious question though, if those scripts (core/scripts/server/gameCore.cs)are never called, why do they exist in the first place?
Thanks again for the help.
11/15/2010 (3:06 am)
Thanks a lot!!!The problem was the place of script.
One curious question though, if those scripts (core/scripts/server/gameCore.cs)are never called, why do they exist in the first place?
Thanks again for the help.
#7
gameCore.cs does not reside in the "core" directory. The package is started on it's own when the script is exec'd. It is exec'd from "scripts/server/scriptInit.cs"...
... unless you're using the Empty Template as a foundation - it retains the old generic GameConnection class methods instead of the multi-package multi-gametype system in place in the Full Template and FPS Example.
11/15/2010 (5:47 am)
I'm confused by this:Quote:?
if those scripts (core/scripts/server/gameCore.cs)are never called
gameCore.cs does not reside in the "core" directory. The package is started on it's own when the script is exec'd. It is exec'd from "scripts/server/scriptInit.cs"...
... unless you're using the Empty Template as a foundation - it retains the old generic GameConnection class methods instead of the multi-package multi-gametype system in place in the Full Template and FPS Example.
#8
11/15/2010 (10:51 pm)
You're welcome. I don't think it's that the script isn't being exec'ed, I think it's that the onClientEnterGame function in that script isn't being called, but in the file I gave it is.
#9
11/16/2010 (5:32 am)
I think I see where the confusion is coming from. The generic onClientEnterGame() function is indeed being called, however the gametype package implementation overrides the core method with it's own onClientEnterGame(). That is why placement matters. If the addition was placed in the core (which generic/common code suitable for all games) then what happens is that when the level is loaded and the package is kickstarted the gametype version of onClientEnterGame() is the one that takes control -- which is totally expected behavior.
#10
This really helps me understand the engine better.
I really hope torque´s future be safe. I really like the engine.
Cheers.
11/29/2010 (4:03 pm)
Thank you all,This really helps me understand the engine better.
I really hope torque´s future be safe. I really like the engine.
Cheers.
DMT
I managed to get start with a camera following a set path.
What I want to know now is this :
1. Can I move the camera around from node to node manually? Pushnode() ,from the code in the link, perhaps? (Related to my third question)
2. What can I do with the PathCameraData datablock?
3. I am still have issues grasping the use of %this in it's various contexts. So when I see this :
I get confused as how I can call something similar to this from elsewhere. Can some one elaborate on this?
Thanks.