Forum Jump :

Author Message


Posts: 51
Rank:


Level: Member

Country: ca
Location: Victoria, British Columbia
Occupation: Canadian Forces Weapon Technician
Age:
In-game name: PiZZADOX

 
#172217 Posted at 2014-10-29 15:00        
     
Hey All,

Tried to find something like this, but could not find a public release of a mod like this, so i made a quick addon utilizing the CBA fleximenu to play music in vehicles

This addon requires CBA and ACE. It works with 1.62 as well as 1.63.

Only the activation of the music by other players is server-side with the rest being client-side so this addon should make barely any difference on server performance.

It is extremely easy to add tracks into this player, just note that players without these tracks will not be able to hear them. Only tracks that other players have added will be able to be broadcasted.



Issues:

Multiplayer synchronization in regards to raising the volume. Volume is correctly raised, but the farther you are from the point of activation (the player's vehicle) the more the sound is distorted, regardless of current position. May be an engine issue.

Download:

link removed, pbo contains copyrighted music

Notes:

Addon is unsigned, this is just meant to be a developer version. I'll sign when I can get the functionality working as best I can and put it on the releases.

How to add tracks:

You need to convert your track to .ogg format (There are many guides how to do this) and normalize the sound so that the volume is somewhat consistent with other tracks.

Then place your track in /musicplayer/sounds folder and then add the define to it in config.cpp

Example:
class USAnth {
		sound[] = {"\musicplayer\sounds\americananthem.ogg", 0.1, 1};
		name = "USAnth";
		titles[] = {};
	};

Then add your track to the fleximenu in /musicplayer/scripts/selfMenuPopulate.sqf

Example:
["American Anthem",{[(vehicle player),"USAnth"] execVM "\musicplayer\scripts\playmusic.sqf"}],

Tracks are added under submenu categories, which you can create by duplicating the category from the "if" statement and changing the second parameter of the submenu line.

For Example:

Under the "first" submenu
["MLG Pro Tunes >","","","",["\musicplayer\scripts\selfMenuPopulate.sqf","mlg", 1],-1,(true),(true)],

This points to another submenu by the name of mlg
if (_menuName == "mlg") then {
	_menus set [count _menus,
		[
			["mlg","Volume", _menuRsc],
			[

				["American Anthem",{[(vehicle player),"USAnth"] execVM "\musicplayer\scripts\playmusic.sqf"}],
                                ["Another Song Name",{[(vehicle player),"ShortName"] execVM "\musicplayer\scripts\playmusic.sqf"}]

			]
		]
	];
};

This post was edited by Foxhound (2014-11-06 20:29, ago)