Jump to content
Sign in to follow this  

Recommended Posts

I was about to work on a script that finds how many G-forces are working on a vehicle. Preferably even in all directions. It shouldn't be too hard to srcipt, just time consuming.

But before I start working on it, am I not reinventing the wheel? Did someone ever do this, or something simmelar?

I'm trying to figure out the G-forces working on the vehicle (and it's crew).

What I need it the speed (That's the easy part) and the speed it's moving arround it's axises. That's where it becomes complicated for me.

I know I need the vectorUp and vectorDir command to get the position arround the axisis but that's just giving me the sine and cosine of the angles. And these numbers are all connected to eachother.

Here it kinda stops for me...

Edited by 87th_Neptune
Additional information

Share this post


Link to post
Share on other sites

Animation source "gforce" built in the model can do the trick you are interested, it will return a value which can be processed latter on and used with a FX script. F/A-18 has such animation built in so you can play with a script below. Hope it helps.

//WORK IN PROGRESS ON THIS ONE

_plane = _this select 0;

_g_force_effect = ppEffectCreate ["radialBlur", 450];

_g_force_effect ppEffectEnable false;

while {(alive _plane)} do

{

if ((player == driver _plane) or (player == gunner _plane)) then

{

_g_force = _plane animationPhase "gmeter";

//_rpm = _plane animationPhase "rpm_meter";

//hintsilent format["G-force %1 \n RPM %2",_g_force,_rpm];

if (_g_force >= 9.5) then

{

_g_force_effect ppEffectEnable true;

_g_force_effect ppEffectAdjust [0.01,0.01,0.15,0.15];

_g_force_effect ppEffectCommit 15;

}

else

{

_g_force_effect ppEffectAdjust [0.005,0.005,0.075,0.075];

//sleep 0.1;

//_g_force_effect ppEffectAdjust [0,0,0,0];

_g_force_effect ppEffectCommit 15;

_g_force_effect ppEffectEnable false;

};

};

sleep 0.5;

};

Share this post


Link to post
Share on other sites

Adding to what JS said, there are gmeterX, gmeterY and gmeterZ animation sources if you want to differentiate between the different axes of motion.

Share this post


Link to post
Share on other sites
Nice!

Thanks both of you

As I said on TS the other night Neptune. From personal experience it isnt very accurate!

Share this post


Link to post
Share on other sites

Spartan's thingy seems to be atleast very close.

One strange thing I noticed is that is gives the G's in any direction.

Pulling gives you a positive indication

Pushing gives you a positive indication

Yaw gives you a positive indication

Another thing that's weird is that is shows (near) zero G in level flight.

That's easily corrected in the script.

I tried several manouvers in specific speeds, which should give a certain positive G result. It was correct.

But thats merely implemented in Spartan's F/A18.

@Spartan

Care to share how you pulled it off?

Edited by 87th_Neptune

Share this post


Link to post
Share on other sites

@Neptune, I have added only one dummy animation to get the value returned. Animation source is done bu BI programmer's, and if memory serves me right we had it since OFP time mate. Take a look at this BI wiki link.

As for adding a dummy animation - fake selection, axis in memory LOD + a config entry in model.cfg. SAMPLE MODEL AVAILIBLE HERE

class gmeter

{

type = "rotation";

source = "gmeter";

selection = "gmeter";

axis = "osa_gmeter";

memory = 1;

minValue = 0;

maxValue = 1;

angle0 = 0;

angle1 = 1;

};

Also it is somehow linked to models GEO LOD, at least two different aircraft [sU35 and FA18 will return different values under similar circumstances, needs testing]

Edited by John_Spartan

Share this post


Link to post
Share on other sites
Also it is somehow linked to models GEO LOD, at least two different aircraft [sU35 and FA18 will return different values under similar circumstances, needs testing]

Which is why i said its not always accurate. It changes given a huge number of factors. I've had the Gmeter value read 1.5 sat on the runway before now. Move at 2kph and it reverts to 0. I just cant get a consistent reading on it so if you find a solid solution i'd like to know too please.

Share this post


Link to post
Share on other sites
Which is why i said its not always accurate. It changes given a huge number of factors. I've had the Gmeter value read 1.5 sat on the runway before now. Move at 2kph and it reverts to 0. I just cant get a consistent reading on it so if you find a solid solution i'd like to know too please.

On tests I have done, I had no issues with relatively small velocity/returned value accuracy. The problem starts on high/velocity and AoA - value returned is unrealisticly high. In RL with such GForce applied to an aircraft or pilot would be beyond a critical point. So I guess it's GEO LOD and distribution of mass that is affecting that, since method of acquiring animation source value is only one, then only difference between our mods is - geometry.

Also I believe in base of calculation of animation source "gforce" engine is using velocity [X,Y,Z] and that definitely is affected by GEO LOD and our values in config.

Share this post


Link to post
Share on other sites

well, believe it or not...hitting a bump, I have had 2G on my G-meter IRL.

Anyway. Thanks Rock, we'll talk on TS. And Thanks JP for the links. :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×