Home   Help Search Login Register  

Author Topic: Shaking and vibrations from dammage  (Read 688 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Shaking and vibrations from dammage
« on: 24 Dec 2005, 23:46:09 »
is it possible to script shaking and vibrations for when an aircraft gets hit or dammaged. to make it harder to control the aircraft. If so could sombody manifest such a script.

thank you

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Shaking and vibrations from dammage
« Reply #1 on: 25 Dec 2005, 00:39:43 »
Perhaps the basis could be:

Code: [Select]
_shaken = _this select 0

#Loop

?(getdamage _shaken > 0.1): goto "Start"

~0.5

goto "Loop"

#Start

[_shaken] exec "SmokeAndFlamesScript.sqs"

PlaySound "Bang"

#SecondLoop

_shaken setvelocity[-30+(velocity _shaken select 0)+random 60,-30+(velocity _shaken  select 1)+random 60,-30+(velocity _shaken select 2)+random 60]

~0.2

goto "SecondLoop"


Then all you need is a smoke and flames script (check out UltimateFire from the scripts area) and you're set  :thumbsup:
« Last Edit: 25 Dec 2005, 00:51:07 by C0LDSt33L »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Shaking and vibrations from dammage
« Reply #2 on: 25 Dec 2005, 02:58:57 »
 oh cool, thanks. I will try this



Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Shaking and vibrations from dammage
« Reply #3 on: 25 Dec 2005, 05:04:20 »
it gets a unknown operator error. about the getdammage part.

EDIT

oh, I just needed to add an extra m in dammage.

it works now but is far to powerful, how would I enter values to make the shaking milder.

thanks
« Last Edit: 25 Dec 2005, 07:04:14 by penguinman »

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Shaking and vibrations from dammage
« Reply #4 on: 25 Dec 2005, 14:42:42 »
The shaking can be changed from altering the setvelocity values. i.e. altering the numbers in bold


_shaken setvelocity[ -30+(velocity _shaken select 0)+random 60,-30+(velocity _shaken  select 1)+random 60,-30+(velocity _shaken select 2)+random 60 ]


Decrease these values to decrease the amount of shaking. I'd reccomend keeping the first number half the second within the component like it is already (30 is half 60).

If it helps you understand this part of the code the script takes the x, y and z components of the velocity and adds between -30 and 30 to them.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Shaking and vibrations from dammage
« Reply #5 on: 29 Dec 2005, 22:37:16 »
ok, I get it
thank you.