OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bronski on 25 Sep 2002, 00:11:53

Title: Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 00:11:53
Basically what i am looking for is a script that would cause a vehicle to loose its fuel gradually after suffering a certain amount of damage.

Preferrably i would like to be able to use it on any vehicle and be able to set the damage that starts the leak and the amount of fuel lost (ie how much it goes down each second or so).

The other script would cause the engine to shut off (and stay off) after the plane suffers a certain amount of damage.

Mainly i would need this one on planes and helicopters but if it was availiable for all vehicles that would be great.

If anyone could help me on either of those i would greatly appreciate it.

-Bronski
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 00:22:25
Oh, i just thought of this.  

Would it be possible to disable the eject command with the script as well?

Example (in init field):  [dammageamount, fuellossamount, eject disabled (true or false)] exec "scriptname.sqs"

The eject command would be disabled at the same time as the fuel loss or the engine off.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 00:33:42
well here is da 1st script (dammage 1)

Code: [Select]
_unit = _this select 0
_dam = _this select 1
_fuel = _this select 2
_eject= _this select 3
_pilot = _this select 4

@ getdammage _unit > _dam
#loop
_unit setfuel (fuel _unit - _fuel )
? _eject : goto "check"
#con
~0.2
? _eject : goto "check1"
#con1
~0.2
? _eject : goto "check2"
#con2
~0.2
? _eject : goto "check3"
#con3
~0.2
? _eject : goto "check4"
#con4
~0.2
goto "loop"

#check
? getout :exit
? ! (_pilot in _unit) : pilot moveindriver _unit

goto "con"

#check1
? getout :exit
? ! (_pilot in _unit) : pilot moveindriver _unit

goto "con1"

#check2
? getout :exit
? ! (_pilot in _unit) : pilot moveindriver _unit

goto "con2"

#check3
? getout :exit
? ! (_pilot in _unit) : pilot moveindriver _unit

goto "con3"

#check4
? getout :exit
? ! (_pilot in _unit) : pilot moveindriver _unit

goto "con4"


tel me if it work  ;)

LCD OUT

Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 00:38:47
What do you put in the init field?

Is it: [unitname, dammage, fuel, eject (t/f)] exec "scriptname.sqs"
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 01:04:40
yes it is ;D

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 02:38:41
Everything works but the eject part.  

I get this:  "_eject |#[ error type number, expected bool.... i couldn't make out the rest.

It is roughly what it told me.

This is what i put in the init field: [this, .25, .05, true] exec "fuelloss.sqs"

I am using version 1.75 if that makes any difference.

Otherwise the script works exactly the way i wanted it to.  

Even if the eject thing doesn't work it still helps a lot.  Thanks.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 15:11:17
k just edited da script try it again (on da same post)

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Gameer_77 on 25 Sep 2002, 15:40:41
In your script it says "goto "con"". Where's con?  ::)

 8)PEACE
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 16:00:01
@ gameer - wat da hel u r talkin bout ?





 ::)







LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 17:40:48
The fuel loss is working fine but the eject still isn't working.

I get a different error.

"| _pilot in |#| _unit": Error type object, expected bool....
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 17:51:42
ok try da last 1 - u have 2 use pilot not from da choper

exec it like dat

 [unitname, dammage, fuel, eject (t/f),nameofpilot] exec "scriptname.sqs"

nd 2 teminate it use getout = true

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Gameer_77 on 25 Sep 2002, 19:18:57
@ gameer - wat da hel u r talkin bout ?





 ::)







LCD OUT

Lol, you are one evil son of a...






STOP MAKING ME LOOK LIKE A FOOL!  :tomato:






 8)PEACE
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 19:35:52
@ gameer - dis was very long nd interestin post i wil try 2 answer all of it  ;D

Quote
Lol, you are one evil son of a...

LOL, btw here is da answer - f00k off game... (not alowed on forums  ;D)  (  ;) )

Quote
STOP MAKING ME LOOK LIKE A FOOL! :tomato:

let me qoute u ,my freind his name is mageer_77 nd he said

Quote
STOP MAKING ME LOOK LIKE A FOOL! :tomato:


Quote
8) PEACE

" 8)PEACE?" What'dya mean PEACE? Blinking fool...  ::)


dats al i can think off  ::)








 ::)







LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Gameer_77 on 25 Sep 2002, 19:45:09
@ gameer - dis was very long nd interestin post i wil try 2 answer all of it  ;D

Quote
Lol, you are one evil son of a...

LOL, btw here is da answer - f00k off game... (not alowed on forums  ;D)  (  ;) )

Quote
STOP MAKING ME LOOK LIKE A FOOL! :tomato:

let me qoute u ,my freind his name is mageer_77 nd he said

Quote
STOP MAKING ME LOOK LIKE A FOOL! :tomato:


Quote
8) PEACE

" 8)PEACE?" What'dya mean PEACE? Blinking fool...  ::)


dats al i can think off  ::)








 ::)







LCD OUT


What...the hell...are you on about!  ::)

What's that noise? Uh-oh! It's KttoTE with his anti-spam gun!

RUN!!

:gunman: :noo:


Ahem...

Who is this "Mageer_77"?  ???  ;)

 8)PEACE
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 19:52:48
Quote
What...the hell...are you on about!  

im on dat thing dat my name is how do u call it  ???    ::) ( ;D)

Quote
What's that noise? Uh-oh! It's KttoTE with his anti-spam gun!


RUN!!

i cant run my legs hurts  :o PLZ ktotte dont kil me PLZ dont shot me im just trin 2 help em PLZ  :'(  (  ;D )

Quote
Who is this "Mageer_77"?


donno but he looks prety much like u  :-*  ::)





 ::)




LCD OUT

P.S should i call tomb 2 look @ dis thread ?
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Gameer_77 on 25 Sep 2002, 20:03:23
P.S should i call tomb 2 look @ dis thread ?

Ooh yeh, call on your back-up! C'mon then, ill take you both on:

LCD =  (http://www.tacnet.org/forum/ikonboard/non-cgi/emoticons/couto.gif) Tomb =  :beat: Gameer = (http://www.tacnet.org/forum/ikonboard/non-cgi/emoticons/fal.gif)





 ::)....Anyways, as fun this spam-fest is, lets get back on the rails, shall we?  :P

(http://www.tacnet.org/forum/ikonboard/non-cgi/emoticons/FIREdevil.gif)HEHE
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 20:12:28
u think u r frightnin me wid all ur foregin smilies  :P  ;D

k im getin back 2 the rails  ;D

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 21:12:21
I'll try that out.  Thanks a lot for working on this.  I'll be sure to give you credit when i put this into a mission.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 21:17:15
first make4 sure it works  ;)  ;D

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 25 Sep 2002, 23:20:09
I'm still getting the same error message.  Hmmmm
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 25 Sep 2002, 23:38:35
try it now ?

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 26 Sep 2002, 02:06:44
No error message but i am still able to eject.  
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: KTottE on 26 Sep 2002, 12:18:06
Can't believe I've missed this thread. Must be because only times I can get on the net, is between 20:00 and 24:00 CET, which just so happens to be the exact same time that the server load is the greatest. So I kept timing out. Weeell, y'all seem to have sorted it anyways. But next time, I'll bust a cap in yer ass with my anti-spam gun ;)

Bronski, double, and triple check for spelling errors, and make sure you didn't leave anything out. Then do it all over again, and do it backwards too, so you know that the script is working.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 26 Sep 2002, 14:34:15
lol  ;D

@ bronski - i cant think on nothin mor  :-\

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Gameer_77 on 26 Sep 2002, 19:59:13
I don't think you can remove the action "Eject" from the player.

LCD's thing just puts the player back in the car/plane if he gets out.

How are you running it?  ::)

 8)PEACE
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 26 Sep 2002, 23:22:28
I actually just came up with an idea.

Would it be possible to lock the plane when the damage is reached and then unlock it when the speed reaches zero?

When you lock the plane/vehicle it disables all the commands that have to do with getting in and out of the vehicle.

If you are able to unlock the vehicle when the speed reaches zero, in other words the plane is on the ground, that would get it to do what my original idea was.

There is a car bomb script that makes the vehicle explode after it hits a certain speed.  It looks like that could be applied to this.

The car bomb script is in the editor's depot under script snippets for ground vehicles.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 27 Sep 2002, 01:37:16
if wat u say is right here is ur new script  ;D

Code: [Select]
_unit = _this select 0
_dam = _this select 1
_fuel = _this select 2
_eject= _this select 3
_pilot = _this select 4

@ getdammage _unit > _dam
#loop
_unit setfuel (fuel _unit - _fuel )
? _eject : goto "check"
#con
~0.2
? _eject and (getdammage _unit > 0) : _unit lock true
#con1
~0.2
? _eject and (getdammage _unit > 0) : _unit lock true
#con2
~0.2
? _eject and (getdammage _unit > 0) : _unit lock true
#con3
~0.2
? _eject and (getdammage _unit > 0) : _unit lock true
#con4
~0.2
? speed _unit < 5 : _unit lock  false; exit
goto "loop"

test it nd report back  ;)

LCD OUT
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: Bronski on 27 Sep 2002, 02:07:56
No error messages or anything but it doesn't work correctly.

It takes off the amount of fuel i put in but only once.  The vehicle doesn't lock either.
Title: Re:Loss of fuel after damage/Engine shut off after damage
Post by: LCD on 27 Sep 2002, 02:38:03
wel i tink dat da prob is da way dat u wanted it 2 b - it wil lock only if da vehicle is dammaged nd it will stop lockin + loosin feul after da vehicle is stoped try da thing on litle dammaged + flyin plane  ;D

LCD OUT