Car instead of Player in starter.fps
by Dustin Mullen · in Technical Issues · 06/09/2008 (12:18 pm) · 27 replies
How would I use a car (the buggy) instead of a player for the starter.fps?
I copied the car.cs (put in server), the car shapes(put it shapes), into my starter.fps.
I commented out player.cs in my game.cs and put in car.cs.
The game froze when I did that.
I then tried just attributing the playerbody() in player.cs to my car object. That somewhat worked, but I don't have wheels and the car just slides around.
Anyone know the proper way to do this?
I copied the car.cs (put in server), the car shapes(put it shapes), into my starter.fps.
I commented out player.cs in my game.cs and put in car.cs.
The game froze when I did that.
I then tried just attributing the playerbody() in player.cs to my car object. That somewhat worked, but I don't have wheels and the car just slides around.
Anyone know the proper way to do this?
#22
06/15/2008 (10:50 am)
Hmm i would use the player.cs as your base and make sure your car has a death animation as well. Thats probably one item that you need to address. it will look alot better too :). Glad that your makign progress. Now you can make the racing game you wanted :)
#23
Okay, in my buggy.cs file (the one in shapes)
I have this and is this correct? Should it be default car or just leave it like that?
Also, is the sequence correct? I only have 1 animation for the car.
Next, I have car1.cs (the one in server)
I have it setup like this:
I'm not sure if that is correct. I know I need to only have one animation. Just, I'm not sure which ones to take out.
That's about it.
06/15/2008 (12:42 pm)
I don't have any tools yet to change the buggy to make a dsq animation. I could however use the deathcar resource because it comes with a milkshape model and I could use that to make a dsq. I have to purchase milkshape first. In the meantime, I have a couple questions and then it should be all done. I really appreciate your help in your hints on what to do. Rather than just telling me, you let me figure it out for myself and help me learn.Okay, in my buggy.cs file (the one in shapes)
I have this and is this correct? Should it be default car or just leave it like that?
Also, is the sequence correct? I only have 1 animation for the car.
datablock TSShapeConstructor(WheeledVehicle)
{
baseShape = "./buggy.dts";
sequence0 = "./car_death.dsq death"; <---
};Next, I have car1.cs (the one in server)
I have it setup like this:
$CarDeathAnim::TorsoFrontFallForward = 1; $CarDeathAnim::TorsoFrontFallBack = 2; $CarDeathAnim::TorsoBackFallForward = 3; $CarDeathAnim::TorsoLeftSpinDeath = 4; $CarDeathAnim::TorsoRightSpinDeath = 5; $CarDeathAnim::LegsLeftGimp = 6; $CarDeathAnim::LegsRightGimp = 7; $CarDeathAnim::TorsoBackFallForward = 8; $CarDeathAnim::HeadFrontDirect = 9; $CarDeathAnim::HeadBackFallForward = 10; $CarDeathAnim::ExplosionBlowBack = 11;
I'm not sure if that is correct. I know I need to only have one animation. Just, I'm not sure which ones to take out.
That's about it.
#24
06/15/2008 (2:03 pm)
Well if you have 11 death animations. you need to have death1, death2, and so forth.. check out the orc for example for 11 death animations, if you have only 1 death animation then you need to comment out that section on the death. (should be in the player, or in your case the car.cs). did you end up using the starter.racing or using the FPS starter kit?
#25
I did everything I believe correctly, but it still gets an error that it can't get the getstate of the vehicle.
This is preventing the car from getting killed when the health reaches zero.
Any ideas besides what you told me to do?
What I'm trying to do is build a game like Twisted Metal.
06/15/2008 (4:58 pm)
I ported the racing over to the fps.I did everything I believe correctly, but it still gets an error that it can't get the getstate of the vehicle.
This is preventing the car from getting killed when the health reaches zero.
Any ideas besides what you told me to do?
What I'm trying to do is build a game like Twisted Metal.
#26
Everything is done enough for a beta run.
One problem is when the vehicle dies, it does not respawn and the player automatically goes into an observer type mode. I added some options for the respawning issue that I thought of.
Fix 1: Set the time limit to 5 minutes. If you die, it is your own fault and wait for next map. Could not be too good for 1 on 1 games.
Fix 2: Maybe someone knows the code where I should put it for the respawn function.
Fix 3: Implement teams. If you die, change your team and you can respawn.
That's the best I thought of.
06/15/2008 (8:36 pm)
Well, it's 11:30 at night here and everything works. I had to change the getstate to the destroyed level.Everything is done enough for a beta run.
One problem is when the vehicle dies, it does not respawn and the player automatically goes into an observer type mode. I added some options for the respawning issue that I thought of.
Fix 1: Set the time limit to 5 minutes. If you die, it is your own fault and wait for next map. Could not be too good for 1 on 1 games.
Fix 2: Maybe someone knows the code where I should put it for the respawn function.
Fix 3: Implement teams. If you die, change your team and you can respawn.
That's the best I thought of.
#27
and replace that with %client.spawnCar();
06/17/2008 (9:34 am)
To get your car to respawn once you die find where it says %client.spawnPlayer(); in server/scripts/camera.csand replace that with %client.spawnCar();
Dustin Mullen
I get a error in my console that it can't get the setstate (I'm guessing the death state).
Would a function like this work?
function DefaultCar
{
%if health="0" then setstate"dead";
}
I don't know, I'm not good with coding, but I try. Anyone know to do next?