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

 
#1 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, 1082 days ago)


Author Message


Posts: 20257
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#2 Posted at 2014-11-06 20:28        
     
Your addon contains copyrighted music. You can of course spread this nice addon but I have to ask you to remove the music.

I hope you can find a way so it allows people to easily add their own music without having to edit the pbo. No matter the clear instruction, not everyone is up for that :-)

Visit my family webshop desteigerhoutshop.nl.

Advertisement


Author Message


Posts: 51
Rank:


Level: Member

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

 
#3 Posted at 2014-11-07 20:05        
     
I completely understand about the copyright issues/site protection.

I think that would be great if it was possible, but not aware of any way of writing dynamic info into a variable in c++ defines in an arma hpp from windows information. The only thing I could think of for that would be creating a simple program allowing people to create the defines and compile it into the pbo. Even then there is still the issue of converting the track and storing it in a form used by the arma engine...


Author Message


Posts: 20257
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#4 Posted at 2014-11-07 20:45        
     
Maybe this old release could be of help?
- Car Radio

Please note, that author does not allow porting to Arma 3, so you can not use his work. But you can learn from it.
I have really no idea if that is of any help but I thought I should give you the link anyway.

Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 51
Rank:


Level: Member

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

 
#5 Posted at 2014-11-11 04:52        
     
Unfortunately that addon just uses mission description ext to define cfgmusic which results in a larger download for each mission and more strain on the server.

I don't think there's a way to dynamically add something into a hpp, let alone binarize it and package it.

Thanks for the effort though it is very appreciated.