OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman 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
-
Perhaps the basis could be:
_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:
-
oh cool, thanks. I will try this
-
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
-
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.
-
ok, I get it
thank you.