Home   Help Search Login Register  

Author Topic: Vehicle fire script  (Read 1611 times)

0 Members and 1 Guest are viewing this topic.

B-2-0

  • Guest
Vehicle fire script
« on: 23 May 2003, 00:27:42 »
Hi, anyone know where i can get the script which makes a vehicle set on fire when it is blown up??

I have looked in the script snippets section but there doesn't seem to be one there!! :-\

Thanx in advance :thumbsup:

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #1 on: 23 May 2003, 04:46:28 »
Hi!

IÂ'm using the one from Kegetys Winter Nogojev, very nice fire, the only thing is you dont get hurt when you stand in the fire, I think the script from BAS MH-47E Chinook has that working...

I put the following in the init line for each vehicle:
Code: [Select]
this addEventHandler ["killed", {[[0,0,0],[0,0,0],60,3+random 3,_this select 0] exec "\KEGnoecain_snow\script\destroy.sqs"}]
cheers...

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #2 on: 23 May 2003, 05:26:13 »
Thanx Mujahedeen :thumbsup:

It works great....i just had a thought though....I have to put this in each vehicle's init field, yeah?  Is there a way to apply it to very vehicle on the map??  

Also, will this work once a vehicle is respawned, as this is a MP map i am making! :)

Thanx for your reply!! :cheers:

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #3 on: 23 May 2003, 06:06:13 »
Hi!

Yeah you have to put it in every vehicle (as far as I know)...

As for respawning, I think you have to put the line from my previous post in the respawn-script you are using (most respawn scripts create a new vehicle and delete the old one, therefor you have to add another eventhandler)...

edit: A better way yet:  If you are using a respawn script, you can add the eventhandler before the vehicle "dies", that way you dont have to put it in every vehicle!  example:
Code: [Select]
; [vehicle,time] exec "thisscript.sqs"
?!(local server) : exit
_vehic = _this select 0
_time = _this select 1
_type = typeof _vehic
_pos = getpos _vehic
_dir = getdir _vehic

#loop
_vehic addEventHandler ["killed", {[[0,0,0],[0,0,0],60,3+random 3,_this select 0] exec "\KEGnoecain_snow\script\destroy.sqs"}]
@!(alive _vehic)
~_time
deletevehicle _vehic
_vehic = _type createvehicle [0,0]
_vehic setpos _pos
_vehic setdir _dir
_vehic setdamage 0
goto "loop"

...Just be sure you're not using the bike, you dont want it to inflame now do you?   ;D

cheers...

« Last Edit: 23 May 2003, 06:47:09 by Mujahedeen »

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #4 on: 23 May 2003, 06:38:48 »
Errr...sorry Mujahedeen but u will have to explain it in simpler terms if u can please ;D

I haven't got to grips with event handlers yet....so what do i do with this script??

[Edit] Do i just have []exec "thisscript" in my init.sqs or something??

Thanx :thumbsup:
« Last Edit: 23 May 2003, 06:43:49 by B-2-0 »

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #5 on: 23 May 2003, 06:46:43 »
Hi!  :)

how exactly are you respawning vehicles?

are you using a script or are you doing it some other way?

cheers...

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #6 on: 23 May 2003, 06:52:16 »
I haven't actually implemented the vehicle respawn script yet, i was planning on using Doolittles script. :)

I have attatched it so you can have a look!

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #7 on: 23 May 2003, 07:17:07 »
Hi!

I checked out the script...  pretty neat!  If you're using it, you would have to edit it and put the eventhandler before or after the vehicle has been created again (respawned)...  (would require some scripting and testing!)

OR

you could use the script above, it requires OFP version 1.91 because it uses the "typeof" command, and you have to have a Game Logic called "server".  Just copy/paste the code into a notepad document and save it as e.g. "vehiclerespawn.sqs" in your mission folder.

...And put the following into every vehicle's init line:
Code: [Select]
[this,120] exec "vehiclerespawn.sqs"where: this is the vehicle because the script is activated by it, and 120 is the time (in seconds) for the vehicle to respawn (120 = 2 minutes).

...then, all the vehicles that run the script get respawned after the amount of time specified, and all inflame upon destruction!

this script does not provide the smoke effect that doolittle's script has, but it is quite good i think and works too!...  :D

cheers...

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #8 on: 23 May 2003, 07:48:02 »
Hi, i just checked out both respawn scripts (i hadn't actually tested the other one until now) and i think i will use yours (If u don't mind ;D)  I will credit you on my briefing!! ;)

Thanx a lot for your help dude!! :thumbsup:

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #9 on: 23 May 2003, 07:51:28 »
One more thing....(I'm a pain i know, but this is my first MP map and i want it to be spot-on)....this will be ok for MP because i have the "Server" Game Logic, right?

[Edit] And you say it needs V.1.91....does that count for the people playing it aswell??
« Last Edit: 23 May 2003, 07:53:13 by B-2-0 »

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #10 on: 23 May 2003, 07:58:10 »
Hi!

you're welcome to use it!

...you should rather include Kegetys in your credits list!  It's his burn script after all!  this is just one of the easiest type of respawn scripts around, I think I picked most of it up on here on ofpec!  :)

Just remember, if you have a bicycle using the script, it will catch fire upon destruction...  :D

enjoy it mate!

[edit] Yes, that includes all other players...   ...the game logic "server" is only local on the server machine, therefor some scripts, like this one, are only executed there, if there wouldn't be no game logic called "server" the script would run on all computers causing just as many vehicles respawned at the same spot at the same time...  ..causing caos! - only happens in MP.

cheers...
« Last Edit: 23 May 2003, 08:04:19 by Mujahedeen »

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #11 on: 23 May 2003, 08:12:42 »
Ahhh...now i get it....thanx!! :thumbsup:

Kegetys already has credit on my brief anyway....i think every mission made owes him credit....dude is a genius!! :)  (I'll stick u on there anyway mate!! ;)

I have one more Q (lol...i know)  I have triggers that activate the tail-rotor script grouped to my choppers and scattered randomly around the map....once the choppers have been destroyed and respawned, they no longer activate the trigs....any way to solve this or is it impossible because a new vehicle is created??

And i think i will put a bike on there....just the one for comedy effect....anyone who gets on a bycicle in the midst of a war deserves to get blown up and torched...lol
« Last Edit: 23 May 2003, 08:14:51 by B-2-0 »

Mujahedeen

  • Guest
Re:Vehicle fire script
« Reply #12 on: 23 May 2003, 16:50:06 »
hi!  :D

Well, you could try to embed the tail rotor script to the respawn script.  You could have an array, in the respawnscript which all the helicopter types are in e.g. :  
Code: [Select]
_choppers = ["AH64","Cobra","Mi24","Mi17","UH60","UH60MG"] + whatever more choppers there are...  don't remember what they are all called :D  (you can see the type, if you open your mission.sqm file in notepad, under every item, there is something called:  VEHICLE="something", and that something is the type! - then you can add it to the array...)  :D

and then check if the vehicle is in the chopper array:

Code: [Select]
?(_type in _choppers) : _vehic exec "yourrotorscript.sqs"where _vehic exec "yourrotorscript.sqs" is the commandline for your tail rotor script...
therefor, only if the vehicle is a chopper, the tail rotor script will run!  (this command would have to be placed between "#Loop" and "@!(alive _vehic)")

...which tail rotor script are you using anyway?

cheers...

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #13 on: 24 May 2003, 14:14:02 »
Ok, so if i am getting this right, i add all my chopper types to the first line of code (The array) eg:

_choppers = ["MH6A", "Mi2no"]

And then the next line:

?(_MH6A, _Mi2no) : _vehc exec "Tailrotor.sqs"

And place both these lines into the vehicle respawn script....

#loop

HERE??

"@!(alive _vehic)")

Correct??  (Probably not..lol)

I am using Vektorboson's tailrotor script btw

Thanx for your help ;)

[Edit] I have just had a thought, won't this execute the tailrotor script as soon as the chopper is respawned??

The way i have it set up is.... a MP map where each chopper is grouped to 3 triggers that exec the T/R script, these are only small trigs and are in random locations so there is only a small chance of T/R faliure.....i need to know (If there is a way to do it) how to regroup the respawned choppers to these triggers so they can be activated.

Any ideas ???
« Last Edit: 24 May 2003, 17:37:55 by B-2-0 »

B-2-0

  • Guest
Re:Vehicle fire script
« Reply #14 on: 28 May 2003, 09:02:07 »
Can anyone help me with this ???