Home   Help Search Login Register  

Author Topic: Loss of fuel after damage/Engine shut off after damage  (Read 5076 times)

0 Members and 3 Guests are viewing this topic.

Bronski

  • Guest
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

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #1 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.
« Last Edit: 25 Sep 2002, 00:23:33 by Bronski »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #2 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

« Last Edit: 25 Sep 2002, 23:37:31 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #3 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"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #4 on: 25 Sep 2002, 01:04:40 »
yes it is ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #5 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.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #6 on: 25 Sep 2002, 15:11:17 »
k just edited da script try it again (on da same post)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #7 on: 25 Sep 2002, 15:40:41 »
In your script it says "goto "con"". Where's con?  ::)

 8)PEACE

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #8 on: 25 Sep 2002, 16:00:01 »
@ gameer - wat da hel u r talkin bout ?





 ::)







LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #9 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....

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #10 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #11 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

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #12 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
« Last Edit: 25 Sep 2002, 19:38:02 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #13 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
« Last Edit: 25 Sep 2002, 19:47:29 by Gameer_77 »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #14 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 ?
« Last Edit: 25 Sep 2002, 19:54:06 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #15 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 =   Tomb =  :beat: Gameer =





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

HEHE

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #16 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #17 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.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #18 on: 25 Sep 2002, 21:17:15 »
first make4 sure it works  ;)  ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #19 on: 25 Sep 2002, 23:20:09 »
I'm still getting the same error message.  Hmmmm

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #20 on: 25 Sep 2002, 23:38:35 »
try it now ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #21 on: 26 Sep 2002, 02:06:44 »
No error message but i am still able to eject.  

Offline KTottE

  • Former Staff
  • ****
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #22 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.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #23 on: 26 Sep 2002, 14:34:15 »
lol  ;D

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

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gameer_77

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #24 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

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #25 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.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #26 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Bronski

  • Guest
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #27 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.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Loss of fuel after damage/Engine shut off after damage
« Reply #28 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta