How do I even create a path in the t3d 2009 editors?!
by JamesAndresakis · in Torque 3D Beginner · 05/31/2010 (12:45 pm) · 7 replies
Ok,
I have a copy of torque 3d 2009 that I am using and I cant figure out for the life of me how to create a path to assign bots to in the world editor. I tried using all the reference materials, books, tutorials, and just about everything else but I cant figure it out. Id really like to be able to use torque to its fullest potential but Im just kinda stuck. I am not a programmer but Im trying to learn multiple languages at once and its a little overwhelming so if someone can be kind enough to point me in the right direction or just show me how to manipulate the aiplayer.cs file so bots just spawn on your map when you start it that would be awesome. Id like to have them chase the player around by using some steering behaviors if possible to.
PS.
Ive been using the UDK for not to long and have been able to do the same thing Im talking about with ease :P and Ive been messing with torque on and off for about 2 years so you can just imagine my frustration.
I have a copy of torque 3d 2009 that I am using and I cant figure out for the life of me how to create a path to assign bots to in the world editor. I tried using all the reference materials, books, tutorials, and just about everything else but I cant figure it out. Id really like to be able to use torque to its fullest potential but Im just kinda stuck. I am not a programmer but Im trying to learn multiple languages at once and its a little overwhelming so if someone can be kind enough to point me in the right direction or just show me how to manipulate the aiplayer.cs file so bots just spawn on your map when you start it that would be awesome. Id like to have them chase the player around by using some steering behaviors if possible to.
PS.
Ive been using the UDK for not to long and have been able to do the same thing Im talking about with ease :P and Ive been messing with torque on and off for about 2 years so you can just imagine my frustration.
#2
-First add a new SimGroup (Library->Level->System) to your scene called Paths, this will help keep things organized later on.
-Next right-click on your newly created SimGroup and select Add New Objects Here
-Now add the Path Object (Library->Level->Level), call it anything you like but for this I'll call it Path1. Now you should see a folder called Path1 within the Paths SimGroup.
-Right-click on Path1 in the scene tree and select Add New Objects here, next we'll start adding nodes to the path
-Now just add your nodes to the path by adding marker objects (Library->Level->Level). Name them something simple, I usually do something like an initial or acronym of the path name along with what number the node is, for instance p1. This helps me keep them organized later and I can quickly sort them out if I accidentally change the node order.
After you've added a couple markers you should be seeing green arrows drawing the path between the nodes. You can move the nodes around to where you need them to be and the path will change along with the move. When objects are following a path they face the direction the arrows are pointing. To change that simply rotates the nodes until the arrows face along the path as desired.
I'll pass along a helpful tip. I've had to lay down a lot of paths over the years and a trick I've learned to make things go a little smoother and quicker is to set the drop location of objects to the Camera w/Rotation (Object->Drop Location->at Camera w/Rotation). This allows you to move the camera around the world to where you want your nodes and when you add a node it uses the camera's position and rotation. I've found creating paths this way has greatly cut down on having to fine tune them later.
Thread title edited (that was just way too long) =)
Moved to T3D Public
05/31/2010 (1:53 pm)
Adding a path is pretty simple, though there were a couple minor changes in how it works so the documentation on how to do it with the previous engines.-First add a new SimGroup (Library->Level->System) to your scene called Paths, this will help keep things organized later on.
-Next right-click on your newly created SimGroup and select Add New Objects Here
-Now add the Path Object (Library->Level->Level), call it anything you like but for this I'll call it Path1. Now you should see a folder called Path1 within the Paths SimGroup.
-Right-click on Path1 in the scene tree and select Add New Objects here, next we'll start adding nodes to the path
-Now just add your nodes to the path by adding marker objects (Library->Level->Level). Name them something simple, I usually do something like an initial or acronym of the path name along with what number the node is, for instance p1. This helps me keep them organized later and I can quickly sort them out if I accidentally change the node order.
After you've added a couple markers you should be seeing green arrows drawing the path between the nodes. You can move the nodes around to where you need them to be and the path will change along with the move. When objects are following a path they face the direction the arrows are pointing. To change that simply rotates the nodes until the arrows face along the path as desired.
I'll pass along a helpful tip. I've had to lay down a lot of paths over the years and a trick I've learned to make things go a little smoother and quicker is to set the drop location of objects to the Camera w/Rotation (Object->Drop Location->at Camera w/Rotation). This allows you to move the camera around the world to where you want your nodes and when you add a node it uses the camera's position and rotation. I've found creating paths this way has greatly cut down on having to fine tune them later.
Thread title edited (that was just way too long) =)
Moved to T3D Public
#3
Just so you know I go to devry university and I attend online and at campus. Most of the students that I talk with have had major problems in one form or another dealing with torque in its many versions. Some of the students that have used it for a senior project had a super hard time getting any support from GG and had to look else where for support to finish their game.
Im not complaining but its really hard to implement stuff you have little grasp of just by looking at some code. Ive tried using the 3d programming all in one book but I couldnt get half the stuff in there to work at all. I even sat in class with a whole group of other students and a professor and none of us could make the thing do what we wanted it to.
I can see from some of the links what to use in the way of code but Ive tried all that before and nothing happens. The level just loads like normal and I get no bots because......I cant freaking add a path.
05/31/2010 (1:58 pm)
Thanks for the info and links but I have a really hard time figuring out exactly if just manipulating the file info is all i have to do to get enemies to spawn. Is there some default character model that just appears when you implement the code? How are you supposed to lay paths in the editor for ai to follow? Is there some kind of recent tutorial that deals with the 2009 3d version I have that would show me from start to finish how to implement that stuff? Just so you know I go to devry university and I attend online and at campus. Most of the students that I talk with have had major problems in one form or another dealing with torque in its many versions. Some of the students that have used it for a senior project had a super hard time getting any support from GG and had to look else where for support to finish their game.
Im not complaining but its really hard to implement stuff you have little grasp of just by looking at some code. Ive tried using the 3d programming all in one book but I couldnt get half the stuff in there to work at all. I even sat in class with a whole group of other students and a professor and none of us could make the thing do what we wanted it to.
I can see from some of the links what to use in the way of code but Ive tried all that before and nothing happens. The level just loads like normal and I get no bots because......I cant freaking add a path.
#4
05/31/2010 (2:00 pm)
Im not gonna give up but Ill try anything you guys suggest.......its just that I started using torque again and forgot I was so frustrated with it in the first place :P I WILL GET IT TO WORK!!!!!!!
#5
Then in scripts/server/gameCore.cs in GameCore::startGame(%game){} look for a section that talks about AIManager -- it's currently commented out so that it doesn't work.
You should probably also uncomment the line in function GameCore::endGame(%game, %client) that deletes the AIManager at mission end.
The AIManager was disabled in one of the betas for debugging purposes. It was annoying when running a trace since the AI routines were being called every think interval - even if there were no AI present.
The stock behavior is for the bot to simply follow the path in an endless loop. However there are many examples in the Forums and/or Resources on how to further extend it's capabilities.
05/31/2010 (4:23 pm)
Quote:Use the path creation outline as given by Scott - the default pathed AI looks for that Path/Path1/node# nomenclature for it to work.
...so bots just spawn on your map when you start it that would be awesome. Id like to have them chase the player around by using some steering behaviors if possible to.
Then in scripts/server/gameCore.cs in GameCore::startGame(%game){} look for a section that talks about AIManager -- it's currently commented out so that it doesn't work.
// // Start the AIManager
// new ScriptObject(AIManager) {};
// MissionCleanup.add(AIManager);
// AIManager.think();Simply uncomment these lines, and if you've set up your path and pathmarkers as stated then the next time you start your level/mission a default AI (as defined in art/datablocks/aiPlayer.cs) will spawn on the path and begin following it. You should probably also uncomment the line in function GameCore::endGame(%game, %client) that deletes the AIManager at mission end.
AIManager.delete();
The AIManager was disabled in one of the betas for debugging purposes. It was annoying when running a trace since the AI routines were being called every think interval - even if there were no AI present.
The stock behavior is for the bot to simply follow the path in an endless loop. However there are many examples in the Forums and/or Resources on how to further extend it's capabilities.
#6
06/04/2010 (11:00 pm)
Hey guys thank you for the info.....I'm going to be sharing it with some of my classmates and Im sure theyll all appreciate it. I have some other questions about certain behaviors and stuff but Id really like to know about getting enemies to spawn at different triggering events like going past certain boundries or getting so many points and things like that too.
#7
www.torquepowered.com/community/resources/view/15320
06/05/2010 (12:58 am)
Here are some more advanced AI scripts.www.torquepowered.com/community/resources/view/15320
Torque 3D Owner Caylo Gypsyblood
Without knowing in better detail what, "I tried using all the reference materials, books, tutorials, and just about everything else"; entails it is hard to know what level of Torque knowledge you have. And without an approximate idea of what you do know and what you have tried to solve your problem, it is difficult for anyone to be very detailed with a helpful reply.
So, if you can start at stage one and pose a question about specific detailed problems, im 99.98% sure many of the Torque community members could be able and willing to help you.
Here are some links that you may find helpful:
www.torquepowered.com/community/forums/viewthread/22145
www.torquepowered.com/community/forums/viewthread/14675
www.torquepowered.com/community/forums/viewthread/30426
www.torquepowered.com/community/forums/viewthread/28460
www.torquepowered.com/community/resources/view/12784
Allot of code examples from above links, in what you may discover exactly what your seeking.
EDIT: Your edit clarify your problem immensely, I hope the above links set you in the right direction. You should also be able to find volumes of information by using the website search and keywords such as AI PATH, AI SPAWN, AI SPAWN ON PATH... That type of thing.
Also www.torquepowered.com/community/forums/73 is the Torque 3D Public Discussion area.