Home   Help Search Login Register  

Author Topic: vaporized!  (Read 1686 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
vaporized!
« on: 28 Dec 2004, 22:47:50 »
is there any way to get planes/helos to explode and vaporize as in real life.

like maby when the plane has a speed of over 150 an is set dammaged to 1  then it is delete vehicled and if the person flying the plane is AI then delete him to but if it is the player then set pos him in the same spot but under ground.

maby if it works sombody could make a wrekage addon and that could be put in pos of the plane

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:vaporized!
« Reply #1 on: 28 Dec 2004, 23:14:37 »
Another great idea! So great I'm already working on it!  ;D

Anyway, let me make sure I've got this right: you mean that instead of the vehicle crumpling up, it should just bust apart into a bunch of wreckage if, say, it crashes into a building at 200 km/h?

I've made a script that does just that, but the effects just aren't very pretty yet. Basically, the script checks for changes in velocity, and if the change is big enough, the aircraft is destroyed. If you know much physics, it's kinda a bastardized version of the idea of impulses, only without the mass. Anyway, I'll post the script I have so far, but keep in mind it is yet to be completed:

Code: [Select]
~0.5

_aircraft = _this select 0
;try 2000
_tol = _this select 1

_vSub = { [((_this select 1) select 0) - ((_this select 0) select 0), ((_this select 1) select 1) - ((_this select 0) select 1), ((_this select 1) select 2) - ((_this select 0) select 2)] }
_vMagSqr = {(_this select 0)^2 + (_this select 1)^2 + (_this select 2)^2}

#Loop
_v1 = velocity _aircraft
~0.001
_v2 = velocity _aircraft
_dv = ([_v2, _v1] call _vSub) call _vMagSqr

? (_dv > _tol) && !alive _aircraft : goto "crash"
~0.001
goto "Loop"



#crash

titletext [format ["%1", _dv], "PLAIN"]

_pos = getpos _aircraft
deletevehicle _aircraft

_bomb = "shell125" camcreate _pos
_bomb = "shell125" camcreate _pos

_i = 0
#effect
   _loc = [(_pos select 0)-2+random 4, (_pos select 1)-2+random 4, (_pos select 2)-2+random 4]
   _vel = [((_v2 select 0)/3)-10+random 20, ((_v2 select 1)/3)-10+random 20, ((_v2 select 2)/3)-10+random 20]
   drop ["cl_fire","","Billboard",3,3,_loc,_vel,0,0.11,0.11,0,[0.5,2,1.5,0],[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],[0,1,0,1],0,0.1,"","",""]

;   _shrap = "FxExploArmor2" camcreate [5 + (_pos select 0) - random 10, 5 + (_pos select 1) - random 10, 5 + (_pos select 2) - random 10]
;   _shrap setvelocity _vel
;   _size = 0.1 + random 0.7
;   ? 0.5 > random 1 : [_shrap,_size] exec format["%1explosions\debriflamelets.sqs",ECP_path]
;
;   _vel = [((_v1 select 0)/3)-10+random 20, ((_v1 select 1)/3)-10+random 20, ((_v1 select 2)/3)-10+random 20]
;   drop ["cl_fire","","Billboard",3,3,_loc,_vel,0,0.11,0.11,0,[0.5,2,1.5,0],[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],[0,1,0,1],0,0.1,"","",""]
;
;   _shrap = "FxExploArmor2" camcreate [5 + (_pos select 0) - random 10, 5 + (_pos select 1) - random 10, 5 + (_pos select 2) - random 10]
;   _shrap setvelocity _vel
;   _size = 0.1 + random 0.7
;   ? 0.5 > random 1 : [_shrap,_size] exec format["%1explosions\debriflamelets.sqs",ECP_path]

_i = _i + 1
? _i < 50 : goto "effect"


I've commented out the part of the effects that require the ECP, but the script should work still. It is called like this: [aircraft, tolerance] exec "crash.sqs"

Aircraft - plane or helo to use the script
Tolerance - basically a number telling the script how much the velocity has to change before the aircraft is destroyed. About 2000 seems to work well. Higher = bigger change in speed/direction required to destroy aircraft.

Also, when the plane crashes, a hint will appear on the screen that tells you what the number was for the velocity change the aircraft just had. You can use this number to help you decide what to set your tolerance at.

The full explaination: The script monitors the square of the magnitude of the change in velocity of the aircraft over a 0.001 second period. If this number is greater than the tolerance, the aircraft will be destroyed.

Anyway, I'll stop talking now. :)


HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:vaporized!
« Reply #2 on: 28 Dec 2004, 23:19:56 »
Hmm, I'm getting an "invalid referring site" error when I try to edit, so I'll just post anew.

I should point out that this script is kinda cpu intensive, since it is a very fast loop doing some calculations each time. It should work fine in most missions, but if you are trying to do something with a ton of aircraft all running the script, it could be pretty bad. I've never tried it outside of my little test mission though, so I don't know for sure.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:vaporized!
« Reply #3 on: 28 Dec 2004, 23:21:11 »
Hehehehe.......I did this the other day.

I lawed a chopper and I had a script running checking its health and if it was dead it was deleted.

The effect viewing it as player was as if the chopper was vaporised, mainly because I am running ECP and the explosion, debris and flame and smoke effects helped create that illusion.


Planck
I know a little about a lot, and a lot about a little.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:vaporized!
« Reply #4 on: 30 Dec 2004, 06:40:51 »
Just thinking out loud here,  ::)

how does set object texture work?

Is it possible to make certain portions of any vehicle invisible via this command? Ive never investigated it before, someone should know.

Thoughts?

Zay
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:vaporized!
« Reply #5 on: 30 Dec 2004, 06:46:24 »
I remember asking someone about this before. I believe the answer is that their are only certain textures on the model that can be changed, as designated by the modeller. Too bad....
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:vaporized!
« Reply #6 on: 30 Dec 2004, 06:57:19 »
Bugger,
hmmm  :(  , lateral thinking needed here methinks guys.

This would be a real coup were it accomplished.
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Dubieman

  • Guest
Re:vaporized!
« Reply #7 on: 30 Dec 2004, 17:21:11 »
Too bad we can't have pieces of helicopters & planes.

Like an AH64 would have the nose section, the engine/middle, and the tail boom. All wrecked pieces. And when destroyed in mid air or if it hit the ground, then the vehicle is deleted and the parts are thrown in.

But I'd like to see the parts roll like the clumps of "crap" that come from explosions that roll on the ground and bounce. That would look nice with a fiery explosion from the  heli as it disentergrates into pieces and hits the ground and the wreckage tears itself apart on the impact.  :o

And the pilot survives... ::)

Is that possible without a lot of CPU power? :-\

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:vaporized!
« Reply #8 on: 31 Dec 2004, 01:04:40 »
barron im sry to make a waste of all ur work but wunt it be easier just to detect if the planes dammage is a .95 or somthing :)
just a thought

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:vaporized!
« Reply #9 on: 31 Dec 2004, 03:44:13 »
barron im sry to make a waste of all ur work but wunt it be easier just to detect if the planes dammage is a .95 or somthing :)
just a thought
Ah, well I see we have different ideas on what such a script should do.

The idea of my script is that it only "vaporizes" the aircraft when it would realistically happen. IRL, if a plane was shot down by, say, machine guy fire, then it wouldn't exactly 'vaporize', until possibly after it hits the ground. But that would happen in ofp if you just checked the damage of the plane.

Also, imagine a plane coming in for a crash landing on the ground. If the plane wasn't going too fast, and it hit the ground at a low angle, it wouldn't nescessarily 'vaporize'. The point is, the script checks how much force is acting on the aircraft, and if it is above a certain amount, then the aircraft is 'vaporized'.

A bit overly complicated perhaps, but I just wanted to put some stuff I was learning in physics class to good use. :)
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:vaporized!
« Reply #10 on: 31 Dec 2004, 05:51:40 »
but if you do too steep a turn will it "vaporize"?

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:vaporized!
« Reply #11 on: 31 Dec 2004, 05:54:16 »
but if you do too steep a turn will it "vaporize"?

If you set the tolerance to something really, really, really low, then yes, that would happen. But at the recommended levels, that can not happen. Go ahead and try the script out and you'll see. :)
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:vaporized!
« Reply #12 on: 31 Dec 2004, 06:30:52 »
its done?

oh ok i thought that was just an unfinished part

DBR_ONIX

  • Guest
Re:vaporized!
« Reply #13 on: 01 Jan 2005, 18:23:08 »
Setobjecttexture has to be set up in the config file, and have the named selection models set-up in the P3D.
And you can just change textures (32x32 I think is max size?)
Or hide selection..
You can't make one selection fly of etc, sadly :(
- Ben