Vehicle Spawns
by Jesse Eklund · in Torque Game Engine · 02/12/2005 (10:48 am) · 9 replies
Ive just started to learn the basic of the vehicles in the torque game engine ive been Playing RW and im trying to import the Airscout.cs and flyervehicle.cs into the game. Right now im at the point were i can do everything with the vehicles e.x Fly around stop race and things. But the one thing i cant figure out how to od is spawn them in a dedicated mission. I was thinking there was a simgroup to spawn them like the one to spawn players but i couldent figure it out. My friend said that it was in the script i had to choose were to spawn them but i couldent figure out how. So really all im asking is what is the right way to spawn a vehicle in a dedicated mission. The simgroups i tried were "FlyerDropPoints" and "CarDropPoints". So will someone just set me strait and tell me how???
#2
{
transform = " ( In her is the location were i want it to spawn??? ) ";
}
In there do i put the location with the zxy axis??
And do i put it at the bottom of airscout.cs????
Or in a diff script????
02/12/2005 (7:46 pm)
%vehicle = new FlyingVehicle{
transform = " ( In her is the location were i want it to spawn??? ) ";
}
In there do i put the location with the zxy axis??
And do i put it at the bottom of airscout.cs????
Or in a diff script????
#3
You should place this command inside the function that spawns the vehicle. I beleive airscout.cs will have functions to control the vehicle. I would say game.cs would be the place to put it.
Check the racing example for more info on the "new" command syntax.
02/13/2005 (7:11 am)
Transform = "10 20 30" will make your vehicle spawn in X=10, Y=20, Z=30.You should place this command inside the function that spawns the vehicle. I beleive airscout.cs will have functions to control the vehicle. I would say game.cs would be the place to put it.
Check the racing example for more info on the "new" command syntax.
#4
//Vehicle Spawns
%vehicle = new FlyingVehicle
{
transform = "(12.2672 41.7805 344.273)";
}
I loaded up the game and i went to that position and i dident see no Vehicle i looked in editor too and there was no Vehicle. So what did i do wrong???
Should i try and put it into Airscout.cs???
(If it whould help i could post my airscout.cs script)
Also were is the racing example??
02/13/2005 (8:31 am)
Ok i added it into game.cs and i couldent find anything with a Vehicle spawn so what i did was make a little section like this://Vehicle Spawns
%vehicle = new FlyingVehicle
{
transform = "(12.2672 41.7805 344.273)";
}
I loaded up the game and i went to that position and i dident see no Vehicle i looked in editor too and there was no Vehicle. So what did i do wrong???
Should i try and put it into Airscout.cs???
(If it whould help i could post my airscout.cs script)
Also were is the racing example??
#5
%vehicle = new FlyingVehicle
{
transform = "12.2672 41.7805 344.273";
datablock = airscout;
}
please refer to the racing example for syntax checking.
02/14/2005 (6:43 am)
Don't use the parenthesis. you'll also need to add the desired Datablock.%vehicle = new FlyingVehicle
{
transform = "12.2672 41.7805 344.273";
datablock = airscout;
}
please refer to the racing example for syntax checking.
#6
Oh ya i was looking around in airscout.cs and i found this function it looks like this might be how to spawn it. I was wondering if you could look at it. i think it looks like how it spawns them if so could u tell me how:
function FlyingVehicleData::create(%block)
{
%obj = new FlyingVehicle() {
dataBlock = %block;
};
%obj.mountable = true;
return(%obj);
}
02/14/2005 (9:57 am)
Ok i tried what you said and i couldent get it to work im still trying thoe. And could u plz give me a url for this racing example.Oh ya i was looking around in airscout.cs and i found this function it looks like this might be how to spawn it. I was wondering if you could look at it. i think it looks like how it spawns them if so could u tell me how:
function FlyingVehicleData::create(%block)
{
%obj = new FlyingVehicle() {
dataBlock = %block;
};
%obj.mountable = true;
return(%obj);
}
#7
The problem with your airscout is that it's not shipped with the engine, it's an optional purchased resource.
But yes, the code shows the syntax on how to create a flying object, just add the transform parameter to that.
Just one more thing : As I'm observing, your problem isn't really on how to spawn the vehicle, it's how to work with Torque altogether. I suggest you to do the tutorials available on GG site and to buy Kenneth's book "3D Game Programming All in One".
02/15/2005 (12:44 pm)
The racing example is shipped with torque on the demo version.You might as well already have it.The problem with your airscout is that it's not shipped with the engine, it's an optional purchased resource.
But yes, the code shows the syntax on how to create a flying object, just add the transform parameter to that.
Just one more thing : As I'm observing, your problem isn't really on how to spawn the vehicle, it's how to work with Torque altogether. I suggest you to do the tutorials available on GG site and to buy Kenneth's book "3D Game Programming All in One".
#8
P.S thanks for help.
02/15/2005 (12:51 pm)
Look i dident buy the torque engine i dl a game called Realm Wars and i was creating a server and all i needed was how todo this. Im not a pro i just know the basics of scripting. So dont tell me to go off and buy some crap i dont need when i just need 1 little thing.P.S thanks for help.
#9
function FlyingVehicleData::create(%block)
Cas im really confused i always get a error in the dedicated mission when i try.
02/16/2005 (7:49 am)
I couldent get it to work whould u mind typing the whole function thats under:function FlyingVehicleData::create(%block)
Cas im really confused i always get a error in the dedicated mission when i try.
Torque Owner Bruno Grieco
{
transform = " ( the place where you want it to appear ) ";
}