Ejecting from planes
by Bryce · in General Discussion · 10/16/2006 (6:30 am) · 9 replies
Just how would i script this in torque?
#2
What if you were to model it after the modern jet "whole seat ejects" system and create a new "vehicle" that is the seat/parachute model. Take the velocity vector of the plane and apply it to the seat (or mount the seat to the plane??), unmount the player from the plane and mount them to the seat and the accelerate the seat away from the plane at a high rate of speed for a short time. After a time deploy the parachute and the vehicle collides with the ground you could just unmount them from the seat/parachute "vehicle" and they could run away leaving the vehicle behind.
Something like this would take care of the little details of attaching the parachute to the player etc. but there may be some issues I haven't thought of... it would need to be fast but even some "bumping" with the un/mounting could be part of the ejection process.
Just a thought,
=Tod
10/17/2006 (12:17 pm)
I'm relatively new to Torque and I'm just playing with flying vehicles now so take this with a grain of salt, but here goes...What if you were to model it after the modern jet "whole seat ejects" system and create a new "vehicle" that is the seat/parachute model. Take the velocity vector of the plane and apply it to the seat (or mount the seat to the plane??), unmount the player from the plane and mount them to the seat and the accelerate the seat away from the plane at a high rate of speed for a short time. After a time deploy the parachute and the vehicle collides with the ground you could just unmount them from the seat/parachute "vehicle" and they could run away leaving the vehicle behind.
Something like this would take care of the little details of attaching the parachute to the player etc. but there may be some issues I haven't thought of... it would need to be fast but even some "bumping" with the un/mounting could be part of the ejection process.
Just a thought,
=Tod
#3
Anyways, execution-wise, in addition to the seat being a "vehicle", you could take a cue from Operation Flashpoint, where parachutes were classified as vehicles as well. This would give you a bit of flexibility as far as giving the chutes their own "flight" characteristics, and even give them limited steering (steerable chutes).
10/17/2006 (12:24 pm)
Actually, I believe the seat typically gets jettisoned automatically in mid-air, before the chute deploys.Anyways, execution-wise, in addition to the seat being a "vehicle", you could take a cue from Operation Flashpoint, where parachutes were classified as vehicles as well. This would give you a bit of flexibility as far as giving the chutes their own "flight" characteristics, and even give them limited steering (steerable chutes).
#4
I was thinking you could mount the seat to the plane and then mount the player to the seat - but I think that would result in difficulties controlling the plane. Perhaps you could mount a seat/parachute "next to" each mount position in a plane (ie right next to the seat) and then it would be a matter of unmounting the player from the plane and switching them to the parachute and unmounting the parachute from the plane and accelerating it away at a high rate of speed. But you would need to modify the vehicle code to allow mounting of vehicles onto other vehicle mount points.
Depending on how much realism you're going for you could also have a character take damage and/or a chance of death from hitting the canopy or whatever else you wanted to do... Ejecting from a jet is not a pleasant experience - the seats are designed to make the parachute work even from ground level so the ejection force is really strong. Many people report losing a 1/4" to 1/2" in height from the ejection experience due to compression. But that may be more realism than you are going for... ;)
=Tod
10/17/2006 (1:16 pm)
Yes, the seat ejects upwards (on small rocket engines I believe) and then when the seat starts to fall downwards the parachute opens. In a real physics world you need to be moving downwards before a parachute will successfully deploy.I was thinking you could mount the seat to the plane and then mount the player to the seat - but I think that would result in difficulties controlling the plane. Perhaps you could mount a seat/parachute "next to" each mount position in a plane (ie right next to the seat) and then it would be a matter of unmounting the player from the plane and switching them to the parachute and unmounting the parachute from the plane and accelerating it away at a high rate of speed. But you would need to modify the vehicle code to allow mounting of vehicles onto other vehicle mount points.
Depending on how much realism you're going for you could also have a character take damage and/or a chance of death from hitting the canopy or whatever else you wanted to do... Ejecting from a jet is not a pleasant experience - the seats are designed to make the parachute work even from ground level so the ejection force is really strong. Many people report losing a 1/4" to 1/2" in height from the ejection experience due to compression. But that may be more realism than you are going for... ;)
=Tod
#5
10/17/2006 (1:27 pm)
Just thought that I would note that this topic just turned hellacool with ideas about implementation.
#6
The code to get on vehicles is in each vehicle script, but the code to get out is in the Armor class in the player script file. You'll need to write something which combines both of these to move the player from the airplane to the parachute (and probably even create the parachute on demand during ejection).
10/17/2006 (2:55 pm)
I would just mount the chair as an image to the player, and not worry about simulating it. I would probably try to make the parachute a separate vehicle, though. Thus, the parachute is responsible for guiding the player as soon as the player is dismounted from the airplane.The code to get on vehicles is in each vehicle script, but the code to get out is in the Armor class in the player script file. You'll need to write something which combines both of these to move the player from the airplane to the parachute (and probably even create the parachute on demand during ejection).
#7
10/17/2006 (9:57 pm)
I would go with David Blake's Idea. They use a simular method I think in Battle Field 2 when ejecting from planes but you have to press the 9 key for the parachute to open. Sometimes you have to press the 9 key a couple of times to get the chute to open, sometimes you don't have time to open the chute which leaves your guy splatted on the ground dead. Lol, lots of fun.
#8
Thanks for the ideas, everyone. When the player hits the ground, i dont want him to get out or anything. When the player decides to eject, he is deciding to not permanetly kill his pilot. He'll just respawn back in another plane. So all I have to do when he hits the ground is delete the parachute, and then switch the camera to maybe his plane or the plane that crippled it.
10/18/2006 (6:20 am)
@malcom: ......i can hear your sickening laughter from here as you have now splattered your 900th soldierThanks for the ideas, everyone. When the player hits the ground, i dont want him to get out or anything. When the player decides to eject, he is deciding to not permanetly kill his pilot. He'll just respawn back in another plane. So all I have to do when he hits the ground is delete the parachute, and then switch the camera to maybe his plane or the plane that crippled it.
#9
I was thinking about your last post and it sounds like you might be doing an air-combat only scenario - eg pilots rez into planes and fly again rather than air/vehicle/ground combat ala 1942.
If this is the case you might not have to do any of what we discussed. If ejecting from the plane effectively ends the players "life" (which is effectively a "turn" in most fps scenarios) instead of worrying about what to do with the player you could "kill" them and the "onDeath" sequence make the body disappear immediately and start the countdown to the "rebirth" and the eject just the camera from the plane. If the player can take no action while they "parachute" they don't need to be there - just the POV of the camera does. This does rob the other pilots of the chance to machine gun helpless pilots while the float to the ground but this doesn't sound like that kind of game.
This isn't all that different then the death sequence in starter.fps, really. Instead of a death dance you make them disappear immediately (so they don't see their body in the plane) and then command the camera to do the motions of eject and then follow focus on their plane or the enemy plane. If this fits your scenario then you can save yourself all the trouble of the vehicles and mounting etc. that we all suggested.
Just a thought,
=Tod
10/24/2006 (12:11 pm)
@BrYcE,I was thinking about your last post and it sounds like you might be doing an air-combat only scenario - eg pilots rez into planes and fly again rather than air/vehicle/ground combat ala 1942.
If this is the case you might not have to do any of what we discussed. If ejecting from the plane effectively ends the players "life" (which is effectively a "turn" in most fps scenarios) instead of worrying about what to do with the player you could "kill" them and the "onDeath" sequence make the body disappear immediately and start the countdown to the "rebirth" and the eject just the camera from the plane. If the player can take no action while they "parachute" they don't need to be there - just the POV of the camera does. This does rob the other pilots of the chance to machine gun helpless pilots while the float to the ground but this doesn't sound like that kind of game.
This isn't all that different then the death sequence in starter.fps, really. Instead of a death dance you make them disappear immediately (so they don't see their body in the plane) and then command the camera to do the motions of eject and then follow focus on their plane or the enemy plane. If this fits your scenario then you can save yourself all the trouble of the vehicles and mounting etc. that we all suggested.
Just a thought,
=Tod
Employee David Montgomery-Blake
David MontgomeryBlake
I have no idea if that would work or how hellishly clunky it might be, but it just might be some semblance of ejecting. Of course, it might not, too.