OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MythPro1 on 23 Jul 2004, 01:09:11
-
I'm just looking for a script that when you pass a trigger your fuel supply will continuously drain quickly. I know there is a script in the Editor's Corner for OFPEC but that zip file is corrupted when I always download it for some reason.
-
This might be the script you talking about:
drainfuel.sqs
;***************************************
;* Drain Fuel script *
;* By [icarus_uk] *
;* http://furryclan.net *
;***************************************
; Call with [VehicleName]exec "drainfuel.sqs"
_vehicle = _this select 0
#drain
_amount = fuel _vehicle
;increase the value of 0.01 to a larger value (eg 0.1)
;to have the fuel drain faster.
;With a value of 0.1, it will take 5 seconds for a full tank to drain.
_amount = _amount - 0.01
_vehicle setfuel _amount
? _amount <= 0 : goto "exit"
~0.5
goto "drain"
#exit
exit
-
Yep, that is exactly what I was looking for. Thank you very much :D
-
but one slight problem, i save that text in notepad and I name it "drainfuel.sqs". I put it in the missions folder but when I try to execute it, its telling me the script cannot be found. It is in the correct place ??? ???
-
This is probably because it is really named 'drainfuel.sqs.txt'.
If you did not choose the All Files option for the File Type in Notepad save dialogue, this is what happens. So it saves as type 'Text' and appends .txt to the end of your file name.
You will not be able to see the .txt extension if you have 'Hide file extensions for known file types enabled in your folder properties.
Planck
-
Yup that fixed it, thanks a bunch. Now another problem has arisen, I go through the trigger and then it says "_vehicle = _this select 0|#| Error Select: Type Object, expected Array"
i tried putting in the vehicle name where it says "vehicle" but that turned up with the same error.
-
Make sure that you haven't confused your "this's" with your "_this's". :P
If your vehicle is named "car" then you need to put this in the script activation line -
[car] exec "drainfuel.sqs"
NOT
car exec "drainfuel.sqs"
otherwise the script will look for an element in an array that doesn't exist.
Just my suggestion . . .
Roni
-
Yeah, it's [this] exec "drainfuel.sqs"
- Ben
-
Or, you could just change the script from
_Vehicle = _This Select 0
To
_Vehicle = _This
!!!!!!!!!!!!!!!!
WOW----- :P
!!!!!!!!!!!!!!!!