OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bad_fingers on 13 Sep 2005, 00:34:50

Title: sound to objects in mp
Post by: bad_fingers on 13 Sep 2005, 00:34:50
im trying to set a ogg file to play from an object like an empty jeep. To sound like the radio in the jeep is p-laying when you near the vehicle.  Ive tried a few things but cant get it to find the ogg file in my mission folder....  HELPPPPPP!!!
Title: Re:sound to objects in mp
Post by: RujiK on 13 Sep 2005, 01:03:05
Do you have a description.ext file that clearifies the file's whearabouts and such?
Title: Re:sound to objects in mp
Post by: THobson on 13 Sep 2005, 14:29:53
Assuming you do have the sound file in the correct folder and are defining the resource correctly in description.ext.  Then do the following

_soundobj = "logic" createvehicle [0,0,0]
_soundobj setPos getPos vehiclename
_soundobj say "whateveryouhavecalledyoursound"

Later do a

deleteVehicle _soundobj

The above assumes you are doing all this in a script.  To do it in a trigger put this in the activation field:

soundobj = "logic" createvehicle [0,0,0];soundobj setPos getPos vehiclename;soundobj say "whateveryouhavecalledyoursound"

Then later have a trigger that has the following:

deleteVehicle soundobj

(Note the absence of an underscore if you are using a trigger)





Title: Re:sound to objects in mp
Post by: Trapper on 13 Sep 2005, 17:44:29
Just in case this is the reason:

Sound files for your missions, always have to be in YourMission\sound folder.

And in description.ext you have to write for example:
class carhit1{name = "";sound[] = {"carhit1.ogg", db-45, 1.0};titles[] = {0};};