How to get the Buggy into 'Shapes', not 'Static Shapes'?
by Shane09 · in General Discussion · 10/18/2008 (1:18 pm) · 19 replies
EDIT: THE THREAD NAME WAS RECENTLY CHANGED. SORRY ABOUT CAP LOCKS, I JUST NEED IT TO BE OBVIOUS. LOL :) The part of getting the Buggy into 'Shapes', not 'Static Shapes' is near the bottom (posts 11 to 15). I would appreciate it if you read the whole thread, as it contains a few other questions that I have asked. Thank you for taking your time to read my thread.
Hello. Sorry about all my many posts. You are probably getting tired of me. But anyways. I am trying to create a simple racing game. Get a prototype going. What files do I put in my game folder? I keep trying to get 'starter.racing', 'main.cs' from 'example' and 'Torque Demo Debug OSX', but I keep getting fatal errors. Even though I virtually went through every file searching for 'tutorial.base' because that is what most of them are set up for. I changed the 'main.cs' to look for 'starter.racing', but it still doesn't work. What are the certain folders? I can't seem to find them. But another problem is, I want the main player to be the Orc, but he has to get into the car to start racing. I don't really care about opening/closing door animations right now. I just want to make a command that when you hit a certain key, the Orc mounts in the (Torque demo buggy). You have to be within a certain distance of the car though. Would I be able to script this so the Orc goes in the 'black space' of the buggy? Does anyone know the mount points of this? It would be greatly appreciated if someone could provide me with what folders to edit and some script for some of these problems. Like I said, I just want a prototype running, so everything doesn't have to be perfect. "It just has to work" - Duracel. lol.
What basically needs to be done is:
1) Get it so the actual player is the Orc and he can mount himself into the Buggy (must be within a few feet of the buggy to beable to mount)
2) What folders I need to get this set up. And what folders I need to edit to do this
3) OPTIONAL: I can probably figure this out real soon, but how do you make it so there is checkpoint/laps? Anyways, I'll check the starter.racing for this so you can ignore this if you want
Thanks for taking your time to read this. Thank you x2 for answering this.
EDIT: Would I use 'tutorial.base' instead of 'starter.racing' and then add the Buggy in Data>Shapes>Buggy? And then edit then copy and paste the 'car.cs' from 'starter.racing' into 'tutorial.base' and edit that and add a mount command into it? But how would I add a mount command if I were to do this? And what is the position for the Orc to mount into the Buggy?
Hello. Sorry about all my many posts. You are probably getting tired of me. But anyways. I am trying to create a simple racing game. Get a prototype going. What files do I put in my game folder? I keep trying to get 'starter.racing', 'main.cs' from 'example' and 'Torque Demo Debug OSX', but I keep getting fatal errors. Even though I virtually went through every file searching for 'tutorial.base' because that is what most of them are set up for. I changed the 'main.cs' to look for 'starter.racing', but it still doesn't work. What are the certain folders? I can't seem to find them. But another problem is, I want the main player to be the Orc, but he has to get into the car to start racing. I don't really care about opening/closing door animations right now. I just want to make a command that when you hit a certain key, the Orc mounts in the (Torque demo buggy). You have to be within a certain distance of the car though. Would I be able to script this so the Orc goes in the 'black space' of the buggy? Does anyone know the mount points of this? It would be greatly appreciated if someone could provide me with what folders to edit and some script for some of these problems. Like I said, I just want a prototype running, so everything doesn't have to be perfect. "It just has to work" - Duracel. lol.
What basically needs to be done is:
1) Get it so the actual player is the Orc and he can mount himself into the Buggy (must be within a few feet of the buggy to beable to mount)
2) What folders I need to get this set up. And what folders I need to edit to do this
3) OPTIONAL: I can probably figure this out real soon, but how do you make it so there is checkpoint/laps? Anyways, I'll check the starter.racing for this so you can ignore this if you want
Thanks for taking your time to read this. Thank you x2 for answering this.
EDIT: Would I use 'tutorial.base' instead of 'starter.racing' and then add the Buggy in Data>Shapes>Buggy? And then edit then copy and paste the 'car.cs' from 'starter.racing' into 'tutorial.base' and edit that and add a mount command into it? But how would I add a mount command if I were to do this? And what is the position for the Orc to mount into the Buggy?
#2
Sorry, I don't want to download files like that as they could have a copyright thing in them. Also, you included the Torque application in it. That's kinda dangerous. What if I wasn't a Torque owner? Then that would be a torrent.
@Anyone
Isn't there a resource out there or something? Or does anyone know how to do this?
10/18/2008 (2:06 pm)
@ MikeSorry, I don't want to download files like that as they could have a copyright thing in them. Also, you included the Torque application in it. That's kinda dangerous. What if I wasn't a Torque owner? Then that would be a torrent.
@Anyone
Isn't there a resource out there or something? Or does anyone know how to do this?
#3
10/18/2008 (3:29 pm)
Would I just add a Buggy to the world and then add a command -that mounts the Orc in the Buggy and able to drive it- in 'car.cs' after I pasted it into Server>Scripts in my 'tutorial.base'
#4
You would have to add:
server/scripts/player.cs
data/shapes/player/
Then, in server/scripts/game.cs, you would have to exec player.cs and change:
That will spawn you as Kork. You would have to place the car in game.
There is other code needed to make the car mountable but I can't find it at the moment.
10/18/2008 (3:58 pm)
Actually, you don't have to own the torque sdk to download torque games. Also, this is a pack I put together using starter.fps and starter.racing, so it's all good.You would have to add:
server/scripts/player.cs
data/shapes/player/
Then, in server/scripts/game.cs, you would have to exec player.cs and change:
function GameConnection::createPlayer(%this, %spawnPoint)
{
if (%this.player > 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!" );
}
// *******Change this part***********************************
%player = new WheeledVehicle() {
dataBlock = DefaultCar;
client = %this;
};to read:// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};That will spawn you as Kork. You would have to place the car in game.
There is other code needed to make the car mountable but I can't find it at the moment.
#5
Ok, thank you :))))))))))))))))))))))) This helps me ALOT. I'm looking forward to the mountable stuff at the moment. But for the changes you stated, do I use 'starter.racing', 'tutorial.base', or 'starter.fps' as my main folder for my game?
10/18/2008 (4:05 pm)
@ MikeOk, thank you :))))))))))))))))))))))) This helps me ALOT. I'm looking forward to the mountable stuff at the moment. But for the changes you stated, do I use 'starter.racing', 'tutorial.base', or 'starter.fps' as my main folder for my game?
#6
Using starter.racing will give you a pure racing game where the player is a car. The leRace example game is pretty much the same as starter.racing.
From tutorial.base and from starter.fps you can add a vehicle to the world but you will have to add to your existing scripts in order to mount and control it, and you'll need a means of dismounting also.
Take a look at these resources to see how to have controllable vehicles in a fps type game:
Torque Vehicle Resource
Vehicle Tutorial with Custom Vehicle
Key Press to Mount Vehicle
Vehicles Galore
Bear in mind that most, if not all, of these are written for the starter.fps in mind. You will have to read through the resource instructions and possible the comments posted for each in order to use them. But it should get you started on understanding what you need. There are also other resources that may be more up to date - I stopped looking after those four.
10/18/2008 (4:12 pm)
You should be able to use the starter.racing scripts even though you are on a Mac. All of the examples that come with the SDK use the same compiled executable. But you will need the common folders also in your project. The executable, main.cs, and the various dll's will be needed also. Using starter.racing will give you a pure racing game where the player is a car. The leRace example game is pretty much the same as starter.racing.
From tutorial.base and from starter.fps you can add a vehicle to the world but you will have to add to your existing scripts in order to mount and control it, and you'll need a means of dismounting also.
Take a look at these resources to see how to have controllable vehicles in a fps type game:
Torque Vehicle Resource
Vehicle Tutorial with Custom Vehicle
Key Press to Mount Vehicle
Vehicles Galore
Bear in mind that most, if not all, of these are written for the starter.fps in mind. You will have to read through the resource instructions and possible the comments posted for each in order to use them. But it should get you started on understanding what you need. There are also other resources that may be more up to date - I stopped looking after those four.
#7
EDIT: I noticed when I placed the buggy into the mission editor, it has no wheels. If I place the wheels where they should go, and when I save, and actually test the game, will they still move with the buggy? Even if I copy the 'wheeledvehicle.cs' and 'car.cs' into the Server>Scripts? Or will I have to do some more editing? What is going on wrong? How are you supposed to add the car into the mission editor so it actually works come beta testing?
Thanks.
10/18/2008 (4:24 pm)
Ok, thank you very much. I guess I am going to use 'tutorial.base' as my main project folder. I might rename it, depending on how much trouble I will have to go through to get the renamed version working. If I did use 'tutorial.base' would I just need to copy all the car scripts from 'starter.racing' to be able to get the car working, only leaving me with figuring out how to mount it?EDIT: I noticed when I placed the buggy into the mission editor, it has no wheels. If I place the wheels where they should go, and when I save, and actually test the game, will they still move with the buggy? Even if I copy the 'wheeledvehicle.cs' and 'car.cs' into the Server>Scripts? Or will I have to do some more editing? What is going on wrong? How are you supposed to add the car into the mission editor so it actually works come beta testing?
Thanks.
#8
It might seem daunting at first but with a little bit of reading, and asking questions, you'll soon understand how it works. Good luck.
10/18/2008 (4:46 pm)
Yes, you'll need the car.cs script and the appropriate data, and from there you will have to add in the methods of mounting and controlling the car. Most everything you'll need to do will take place in player.cs. You'll need to decide if you want to mount upon collision with a vehicle or to have a "use" key in order to mount it. Once you mount it all you do is shift control from the player model to the car, and reverse the procedure for dismounting. You may also have to fiddle with keybinds (actionmaps) in order to work around discrepancies between player controls and vehicles controls. It might seem daunting at first but with a little bit of reading, and asking questions, you'll soon understand how it works. Good luck.
#9
10/18/2008 (4:57 pm)
I just edited my post right before you posted yours, so this is kind of a reminder. hehe :)
#10
The links above should get you the rest of the code you need.
It will show up in both.
10/18/2008 (5:55 pm)
Remember, the tutorial.base is a basic example. You'll have to set it up for multiplayer as it by default, isn't. Starter.racing is single player as well. That's why I converted the starter.fps to a racing game as it is multiplayer by default.The links above should get you the rest of the code you need.
I noticed when I placed the buggy into the mission editor, it has no wheels. If I place the wheels where they should go, and when I save, and actually test the game, will they still move with the buggy?Make sure you are placing the buggy as a shape and not as a static shape.
It will show up in both.
#11
It only appears in 'Static Shape', even though I placed it in Data>Shapes. How do I change this?
10/18/2008 (6:46 pm)
@ MikeIt only appears in 'Static Shape', even though I placed it in Data>Shapes. How do I change this?
#12
If not, make sure car.cs is exec'd and working.
10/18/2008 (8:19 pm)
You should see it under shapes-vehicles as defaultCarIf not, make sure car.cs is exec'd and working.
#13
Those resources about mounting in a vehicle need to be fixed. I can't find tons of files that they say. They also say some files without telling me where they are. I even searched for them, and still no show. Are there anymore, more detailed webpages on mounting in a vehicle? Thanx.
10/18/2008 (10:30 pm)
@ MikeThose resources about mounting in a vehicle need to be fixed. I can't find tons of files that they say. They also say some files without telling me where they are. I even searched for them, and still no show. Are there anymore, more detailed webpages on mounting in a vehicle? Thanx.
#14
What do you mean by 'car.cs' executed and working? I put the 'car.cs' and 'car.cs.dso' into Server>Scripts in my 'tutorial.base' folder. And still, the only thing that shows up in shapes is the 'Torque Logo' and 'WayPoint' and 'Spawnsphere'. Can you elaborate more, please? Thanx.
@ Aynone
If anyone else knows how to get the buggy to show up in 'Shapes' instead of 'Static Shapes', it would be greatly appreciated. Thanx. Also, if anyone knows some mounting tutorials on getting the player in a vehicle, I would love it. I just don't want to have to download anything. It would be even cooler if the tutorial could be about mounting a player in the buggy, spacifically the Orc, but really, just any player mounting into vehicle tutorial should work for me. Just please make sure it doesn't involve downloading anything. I can't seem to really find any. Thanx though if you do.
10/19/2008 (10:22 am)
@ MikeWhat do you mean by 'car.cs' executed and working? I put the 'car.cs' and 'car.cs.dso' into Server>Scripts in my 'tutorial.base' folder. And still, the only thing that shows up in shapes is the 'Torque Logo' and 'WayPoint' and 'Spawnsphere'. Can you elaborate more, please? Thanx.
@ Aynone
If anyone else knows how to get the buggy to show up in 'Shapes' instead of 'Static Shapes', it would be greatly appreciated. Thanx. Also, if anyone knows some mounting tutorials on getting the player in a vehicle, I would love it. I just don't want to have to download anything. It would be even cooler if the tutorial could be about mounting a player in the buggy, spacifically the Orc, but really, just any player mounting into vehicle tutorial should work for me. Just please make sure it doesn't involve downloading anything. I can't seem to really find any. Thanx though if you do.
#15
For mounting a vehicle when you run up to it and touch it you will need a check for it in Armor::onCollision() - look at the player.cs in starter.fps to see how it works. You'll also need these functions: Armor::onMount(), Armor::onUnmount(), Armor::doDismount(). But since you are using the tutorial.base you will have to either convert all of these to PlayerBody namespace or add a "className = Armor;" field to your PlayerData(PlayerBody) datablock.
So far as those resources up there go, I did say you would have to read through them and the comments to find all of the relevant parts you need. They are old but still work. Download the scripts and look at them, read the comments to see how various people improved or fixed the scripts. I think the problem you are having is the different namespaces found in tutorial.base as compared to starter.fps It may be simpler to just use starter.fps as the basis for your project, especially when using resources found on here. tutorial.base is a good starting point for learning the basics of TGE but it is kind of limiting.
10/19/2008 (12:49 pm)
Delete the .dso file, Torque will compile the .cs script files into a .dso file on it's own - if it is correct. When you modify existing scripts you should get into the habit of always deleting the old .dso files. When you placed the car.cs file into your project did you also exec it (tell it to load)? If not, look in game.cs to see where and how it's done. Once the script is exec'd it (the car) will show up under Shapes->Vehicles in the World Editor unless the Category field in the the datablock is different. The starter.racing car script contains an ::onAdd Method that spawns the car with wheels - make sure your script has it also.For mounting a vehicle when you run up to it and touch it you will need a check for it in Armor::onCollision() - look at the player.cs in starter.fps to see how it works. You'll also need these functions: Armor::onMount(), Armor::onUnmount(), Armor::doDismount(). But since you are using the tutorial.base you will have to either convert all of these to PlayerBody namespace or add a "className = Armor;" field to your PlayerData(PlayerBody) datablock.
So far as those resources up there go, I did say you would have to read through them and the comments to find all of the relevant parts you need. They are old but still work. Download the scripts and look at them, read the comments to see how various people improved or fixed the scripts. I think the problem you are having is the different namespaces found in tutorial.base as compared to starter.fps It may be simpler to just use starter.fps as the basis for your project, especially when using resources found on here. tutorial.base is a good starting point for learning the basics of TGE but it is kind of limiting.
#16
I have not posted in a long time, do to sports an school. I finally got the chance to get back into Torque. The car is now showing up in Vehicles. But when I click 'default car', I am getting a fatal error about a bad range. Do you know why it is doing this, or how I can fix it?
10/25/2008 (7:01 am)
@ MikeI have not posted in a long time, do to sports an school. I finally got the chance to get back into Torque. The car is now showing up in Vehicles. But when I click 'default car', I am getting a fatal error about a bad range. Do you know why it is doing this, or how I can fix it?
#17
10/25/2008 (7:57 am)
Are you using the torque buggy? Or your own car?
#18
10/25/2008 (8:02 am)
The Torque Buggy. I copied it from 'starter.racing'.
#19
10/25/2008 (8:15 am)
I don't know then. I have never got that error.
Torque Owner Mike Rowley
Mike Rowley
It is the starter.fps example converted into a racing demo using the demo buggy. It starts you out as the car, so you'll want to change that in server/scripts/game.cs to get the orc to start. It's a good working base to get you started.
If you are using windows, Use this one
edit to fix urls.