OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mr.BoDean on 14 Jun 2003, 07:14:59

Title: Fuel leak
Post by: Mr.BoDean on 14 Jun 2003, 07:14:59
I want to simulate a leaking fuel tank .  
 
 I know the script would have to use _vehicle SetFuel ammount then I would like it to decrease by .05 every second.

So, how would I do this, with no getFuel command? (I'm using ver. 1.46)  Something like this?

;Theoretical Fuel Leak Script

#Leak
_Tank1 setFuel (_Tank1 getFuel -.05)
~1
goto "Leak"


 ???  non-scripted scripter   :o   Thanx :)
Title: Re:Fuel leak
Post by: Mr.BoDean on 14 Jun 2003, 08:18:47
Okay, I got this to work, although I forgot that only AIR vehicles have a fuel gauge, thus diminishing the visual effect.  ::)  But maybe there is a cleaner, more environmentally-sound way to do it?  ;)

;Fuel leak Script by Mr.BoDean

M1A1 SetFuel 0.95
~1
M1A1 SetFuel 0.90
~1
M1A1 SetFuel 0.85
~1
M1A1 SetFuel 0.80
~1
M1A1 SetFuel 0.75
~1
M1A1 SetFuel 0.70
~1
M1A1 SetFuel 0.65
~1
M1A1 SetFuel 0.60
~1
M1A1 SetFuel 0.55
~1
M1A1 SetFuel 0.50
~1
M1A1 SetFuel 0.45
~1
M1A1 SetFuel 0.40
~1
M1A1 SetFuel 0.35
~1
M1A1 SetFuel 0.30
~1
M1A1 SetFuel 0.25
~1
M1A1 SetFuel 0.20
~1
M1A1 SetFuel 0.15
~1
M1A1 SetFuel 0.10
~1
M1A1 SetFuel 0.05
~1
M1A1 SetFuel 0

exit


WOW! My first actual working script!!  :D    8)
Title: Re:Fuel leak
Post by: LCD on 14 Jun 2003, 08:19:25
Code: [Select]
#Leak
_Tank1 setFuel ( Fuel _Tank1 -.05)
? fuel _Tank1 == 0 : exit
~1
goto "Leak"

LCD OUT
Title: Re:Fuel leak
Post by: Mr.BoDean on 14 Jun 2003, 08:22:36
Code: [Select]
#Leak
_Tank1 setFuel ( Fuel _Tank1 -.05)
? fuel _Tank1 == 0 : exit
~1
goto "Leak"

LCD OUT

Doh! Thanx, LCD , guess that is a little cleaner!  8)  But now I can't take credit for it ...hehe.   :P
Title: Re:Fuel leak
Post by: LCD on 14 Jun 2003, 12:37:39
u dont need 2 :P

just solve da topic (didnt i told u dat b4 ::))

btw da moon - its not cheese - i proved it last night ::) made outa bread ;D

LCD OUT