Guide me
by Tim Elliott · in Torque Game Engine · 08/20/2005 (11:55 pm) · 8 replies
Sorry, two posts in one day asking for help. I have completed all the beginner tutorials I could find and am now stumped. There seems to be a large gap between beginner and intermediate. Basically what I want to do is make a simple underwater shooter. I have alread planned the game and made a version in 2D, but now I want to move onto 3D and don't know where to start.
If anyone could help me please add me to your msn: darkorca AT hotmail DOT com or email me on the same address. Thanks
If anyone could help me please add me to your msn: darkorca AT hotmail DOT com or email me on the same address. Thanks
About the author
#2
Thanks again
08/21/2005 (1:06 am)
I already have the book, I am about three quaters of the way through and it has done all the programming. I also don't want to use Milkshape, because I aready use anim8or. I just need someone who has msn who I can refer to for help every now and then and a push in the right direction. Basically I need help right now in making a flying vehicle (floating really) and importing my .3ds model that I exported from Anim8or.Thanks again
#3
08/21/2005 (6:47 pm)
@Tim: Is anyone helping you with this yet?
#4
08/22/2005 (5:21 am)
Nope, your help would be greatly appreciated.
#5
There are two steps in getting your model into the game.
1. Configuring the model to conform to the DTS format so it can be loaded by Torque
2. Modding your game code to spawn a flying vehicle at a spawn point.
CONFIGURE MESH AND EXPORT TO DTS:
I understand it's not possible to export from Anim8or to DTS directly, but there is an obj2dts.exe converter you can use, but you must export your model from Anim8or in Wavefront (obj) format.
SIMPLE SHAPES : Here's a resource to convert from obj to dts.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7541
however there are some shortcoming of this format...
-No animation features are available as they are not supported in the obj format.
-No auto details (multires) are generated, although obj2dts completely supports mesh details set up by hand.
-IFL materials currently not supported.
-No hierarchies nor nodes are currently supported at the moment due to the many differing implementations of the .obj format. ( so you can't set mount points, eye or camera pos - this is restrictive)
-No Mac version, yet.
BEST BET : The 3ds version may be the best but you will need to add the nulls such as eye, camera, mount0, mount1 etc to add the important nulls required for your game. Unfortunately it requires a dedicated DTS exporter and Anima8or doesn't appear to have one. So what you want to do is model in Anim8or, export to 3ds or something that Milkshape will load ( I know you don't want to use it - but think of it as a minor annoyance ) and in Milkshape you can rig the ship correctly with nulls etc, then export from there using the dedicated DTS exporter. To test it works download the ShowToolPro shareware version from here...
www.garagegames.com/pg/demo.php?id=59
SAVE FOR LATER : For future use (NOTE requires Torque engine to be modded - don't use right now) Shapes3DS importer.will import 3ds file directly into Torque but just file this away for later.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5502
MOD GAME CODE AND SPAWN A FLYING VEHICLE
Here's what I did to learn -
1. Make a copy of starter.racing (mod your main.cs in the root folder to load your default game as whatever you copy the starter.racing folder to.
2. Add Drone.cs and Vehicle.cs to your server/scripts folder. (grab mine here - note Drone.cs defined an overridden Flying Vehicle Class - which means it inherits all the cool things about the basic Flying Vehicle and then add some functionality to make it work like a drone) In the Drone.cs look for the line...
3. Open game.cs in the same folder and add...
with all the other exec(); commands.
4. change your car spawn code to like this is game.cs (strips out all the shocky stuff)
Notice the datablock command
Now you will have a start. Run TorqueDemo.exe and you should have the drone to fly. Use the WASD and mouse to fly it.
There's more but see how you go with this.
08/22/2005 (7:24 am)
Tim,There are two steps in getting your model into the game.
1. Configuring the model to conform to the DTS format so it can be loaded by Torque
2. Modding your game code to spawn a flying vehicle at a spawn point.
CONFIGURE MESH AND EXPORT TO DTS:
I understand it's not possible to export from Anim8or to DTS directly, but there is an obj2dts.exe converter you can use, but you must export your model from Anim8or in Wavefront (obj) format.
SIMPLE SHAPES : Here's a resource to convert from obj to dts.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7541
however there are some shortcoming of this format...
-No animation features are available as they are not supported in the obj format.
-No auto details (multires) are generated, although obj2dts completely supports mesh details set up by hand.
-IFL materials currently not supported.
-No hierarchies nor nodes are currently supported at the moment due to the many differing implementations of the .obj format. ( so you can't set mount points, eye or camera pos - this is restrictive)
-No Mac version, yet.
BEST BET : The 3ds version may be the best but you will need to add the nulls such as eye, camera, mount0, mount1 etc to add the important nulls required for your game. Unfortunately it requires a dedicated DTS exporter and Anima8or doesn't appear to have one. So what you want to do is model in Anim8or, export to 3ds or something that Milkshape will load ( I know you don't want to use it - but think of it as a minor annoyance ) and in Milkshape you can rig the ship correctly with nulls etc, then export from there using the dedicated DTS exporter. To test it works download the ShowToolPro shareware version from here...
www.garagegames.com/pg/demo.php?id=59
SAVE FOR LATER : For future use (NOTE requires Torque engine to be modded - don't use right now) Shapes3DS importer.will import 3ds file directly into Torque but just file this away for later.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5502
MOD GAME CODE AND SPAWN A FLYING VEHICLE
Here's what I did to learn -
1. Make a copy of starter.racing (mod your main.cs in the root folder to load your default game as whatever you copy the starter.racing folder to.
2. Add Drone.cs and Vehicle.cs to your server/scripts folder. (grab mine here - note Drone.cs defined an overridden Flying Vehicle Class - which means it inherits all the cool things about the basic Flying Vehicle and then add some functionality to make it work like a drone) In the Drone.cs look for the line...
shapeFile = "~/data/shapes/vehicles/Drone/Drone.dts";...and replace the dts file with your own dts.
3. Open game.cs in the same folder and add...
exec("./vehicles/Vehicles.cs");
exec("./vehicles/Drone.cs");with all the other exec(); commands.
4. change your car spawn code to like this is game.cs (strips out all the shocky stuff)
function GameConnection::createCar(%this, %spawnPoint)
{
if (%this.car > 0) {
// The client should not have a player currently
// assigned. Assigning a new one could result in
// a player ghost.
error( "Attempting to create an angus ghost!" );
}
// Create the player object
%car = new FlyingVehicle() {
dataBlock = Drone;
client = %this;
};
MissionCleanup.add(%car);
// Player setup...
%car.setTransform(%spawnPoint);
%car.setShapeName(%this.name);
// Update the camera to start with the player
%this.camera.setTransform(%car.getEyeTransform());
// Give the client control of the player
%this.car = %car;
}Notice the datablock command
datablock = Drone;this name is the same as in Drone.cs
Now you will have a start. Run TorqueDemo.exe and you should have the drone to fly. Use the WASD and mouse to fly it.
There's more but see how you go with this.
#6
08/22/2005 (12:16 pm)
Extremely helpful post Andy, thank you for taking the time to work on the answer!
#7
@Tim - you may get stuck on these two steps so email me personally and I'll compile the answers back to this thread. You will most probably get to the next stage which will be cleaning up the code to make the collisions and physics work a bit better for the flying vehicles, so let me know when you are ready for the next bit.
08/22/2005 (3:51 pm)
@Stephen - no problem. Just returning the favour :)@Tim - you may get stuck on these two steps so email me personally and I'll compile the answers back to this thread. You will most probably get to the next stage which will be cleaning up the code to make the collisions and physics work a bit better for the flying vehicles, so let me know when you are ready for the next bit.
#8
Tim
08/22/2005 (7:46 pm)
Thankyou so so much. That has been very useful. As soon as I have completed an aissngment I will get straight to work on the game. Thankyou again for all your help.Tim
Torque Owner Jim Evans