Ever wondered about how much fuel you vehicle is using (supposing the on screen indicators are not present for the addon)?
Here's a way of getting a fuel gauge to work on your plane, car, or boat using the inbuilt fuel command:
This presumes you know how to make gauges in Oxygen.
1.
Create the animated objects in O2 i.e. gas needle and axis points in the appropriate lods (driver view and memory)
2.
class aniDipGas
{
type = "rotation";
animperiod = 5;
selection ="diplomaticgas";
axis = "osa diplomaticgas";
angle0=0;
angle1=Â Â Â -2.844876;
};
angle0 is the start angle of your gas needle ( or Empty mark)
angle1 is the end angle of your gas needle (or Full tank mark on the gauge) . Note angle1 is in Radians. If you need to convert degrees to radians get my Degree to Radian convertor here:
http://www.dc3d.co.nz/Downloads/OFP/Tools/Degree2Radians.exe3. The script code in gasgauge.sqs (note this script runs as long as the car is not destroyed):
_lincoln = _this select 0
#Start
_lincoln animate ["aniDipGas", 0]
#Repeat
~0.001
?!(isengineon _lincoln): goto "Start"
_lincoln animate ["aniDipGas", (fuel vehicle _lincoln)]
?(not alive _lincoln): goto "Exit"
goto "Repeat"
#Exit
exit
4. call the above script from the init eventhandler:
init = [_this select 0] exec "\youraddonName\gasgauge.sqs"
That's about it.. I think
Have fun.