Jump to content
Sign in to follow this  
Sneeper

Making a bombcar?

Recommended Posts

Hey

Does anyone know how to create a bombcar?

Oh and how to add a explosion upon the destruction of a car?

Thanks in advance

Share this post


Link to post
Share on other sites
There are a couple of scripts here:

http://www.ofpec.com/ed_depot/index.php?action=list&page=0

Look at both pages.

If these won't do I have a few others.

Can't i just do it myself with inisilisation?

Btw how can i add music to my mission, i know how to add 1 music track with a trigger but i want it to play all the tracks randomly

Edited by Sneeper

Share this post


Link to post
Share on other sites

Btw how can i add music to my mission, i know how to add 1 music track with a trigger but i want it to play all the tracks randomly

To play a track, use the playmusic command. This document has a list of the class names.

What you're going to need to do to play them all randomly is execute a script, something like this:


;array of tracks that haven't been played yet

_remainingtracks = ["7thLifeless", "7thIAmGonaFly"]

;array of track durations, must be in corresponding order to tracks in _remainingtracks! (and remember to convert seconds to decimals of a minute!)

_trackdurations = [4.52, 4.07]

;beginning of loop
#loop

;generate a random number, then round it down to a whole number

_musicselector = random (count _remainingtracks)
_musicselector = _musicselector - (_musicselector mod 1)

;select a track and duration based on our random number
_playthis = _remainingtracks select _musicselector
_wait = _trackdurations select _musicselector

;remove from arrays

_remainingtracks = _remainingtracks - [_playthis]
_trackdurations = _trackdurations - [_wait]

;play the track
playmusic _playthis

;exit if we're done
? count _remainingtracks == 0 : exit

;otherwise, wait until the track is finished, then loop back and start again
~_wait
goto "loop"

That's done with just two tracks, obviously to play every track in the game you will need to fill _remainingtracks and _trackdurations with the classnames and durations of each song.

Has not been tested, not guaranteed to work!

EDIT: *facepalm* I put the wait in seconds, not minutes! You get the idea, though.

And if the above script has any more errors, just tinker around with until it works. Or post problems here maybe. :D

Edited by RKDmitriyev
error in script

Share this post


Link to post
Share on other sites

Not to undercut you Kurtz buddy, but if you want to add a track or two and be able to select it through triggers/waypoints you need to make a description.ext file with similar content.

Music

-----

class CfgMusic

{

tracks[]=

{

jade, blink

};

class jade

{

name = "jade";

sound[] = {\music\jade.ogg, db+0, 1.0};

};

class blink

{

name = "blink";

sound[] = {\music\blink.ogg, db+0, 1.0};

};

};

of course the music files need to be in your mission folder.

Share this post


Link to post
Share on other sites

Yes, Zulu is right, you need to do that if you want to add custom music. Of course if you only use the music OFP comes with, that's not necessary. :P

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×