OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Mandoble on 07 Sep 2009, 22:25:45
-
Its a radio in car from where you can play all ArmA2 tunes. The car activates an action when player gets in, and if he gets out with music on, music volume selfadjust based on distance between player and car.
Mando Music v1.0 for ArmA2 (http://www.ofpec.com/ed_depot/index.php?action=details&id=644)
-
Hi.
I used this script to check the names of new music in patch 1.05 by changing the _count to value 42 in mando_showplayer.sqf.
Worked ok except I get this error when starting the tune music-action:
'/tracks' is not a class ('Name' accessed)
also there's empty item in 'Mando Music List'. (Between 36: Defcon Three and the new EW campaign musics.)
Maybe related: 'C2_ND_Ambient' listed on BI wiki (http://community.bistudio.com/wiki/ArmA_2:_Music) doesn't seem to play anything with simple playMusic command and arma2.rpt shows 'Music C2_ND_Ambient not found' error. Also 'C2_ND_Ambient' is not listed in editor in Trigger>Effects>Track.
-
Great script Mandoble!
Only question is if possible, how do you add custom music to radio menue?
-
You would need to modify mando_showplayer.sqf, adding your custom music after the for loop. Add the music as the default ones are added inside the loop.
-
I hate asking NooB question .. but how do you add it?
I did add below and obviously it did not work.
// mando_showplayer.sqf
// By Mandoble May 2007
// Executed by action menu added to player
private["_ok", "_displaym", "_list", "_cfg", "_count", "_i"];
disableSerialization;
_ok = createDialog "DlgMandoMusic";
Sleep 0.1;
_displaym = findDisplay 100;
_list = _displaym displayCtrl 102;
_cfg =(configFile >> "CfgMusic");
//_count = count _cfg;
_count = 34;
for [{_i = 1},{_i < _count},{_i = _i + 1}] do
{
_cfgi = _cfg select _i;
_index = _list lbAdd (getText (_cfgi >> "Name"));
_list lbSetData [_index, format["%1", configName _cfgi]];
};
(_displaym displayCtrl 103) ctrlSetTooltip "Copy/Paste this to use with playMusic command";
class CfgMusic
{
tracks[]={Adult_Funny, ww2};
class Adult_Funny
{
name = "Adult_Funny";
sound[] = {"\music\Adult_Funny.ogg", db+0, 1.0};
};
class ww2
{
name = "ww2";
sound[] = {"\music\ww2.ogg", db+10, 1.0};
};
};
What have I done wrong?
Thanks.
-
You need to add the sound/music definitions to this file:
http://community.bistudio.com/wiki/Description.ext
-
Thanks Kju for your response. I have them listed in descption file:
#define MANDCT_STATIC 0
#define MANDCT_BUTTON 1
#define MANDCT_EDIT 2
#define MANDCT_SLIDER 3
#define MANDCT_COMBO 4
#define MANDCT_LISTBOX 5
#define MANDCT_MAP 101
#define MANDST_LEFT 0
#define MANDST_CENTER 2
#define MANDST_MULTI 16
#define MANDST_PICTURE 48
#define MANDST_FRAME 64
#define MANDST_BACKGROUND 80
#define MANDST_HUD_BACKGROUND 128
#define MANDST_WITH_RECT 160
#define MANDST_SHADOW 256
#define FontMandM "Bitstream"
#define FontMandHTML "Bitstream"
class RscMandText
{
type = MANDCT_STATIC;
idc = -1;
style = MANDST_LEFT;
h = 0.04;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = FontMandM;
sizeEx = 0.02;
};
class RscMandPicture
{
type = MANDCT_STATIC;
idc = -1;
style = MANDST_PICTURE;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = FontMandM;
sizeEx = 0.04;
};
class RscMandButton
{
type = MANDCT_BUTTON;
idc = -1;
style = MANDST_CENTER;
access = ReadAndWrite;
colorText[] = {0, 0, 0, 1};
font = FontMandHTML;
sizeEx = 0.025;
soundPush[] = {, 0.2, 1};
soundClick[] = {"ui\ui_ok", 0.2, 1};
soundEscape[] = {"ui\ui_cc", 0.2, 1};
default = false;
colorDisabled[] = {0.3, 0.3, 0.3, 1};
colorBackground[] = {0.6, 0.6, 0.6, 0.5};
colorBackgroundActive[] = {0.8,0.8,0.8,0.5};
colorBackgroundDisabled[] = {0.6, 0.6, 0.6, 1};
colorFocused[] = {0,0,0,1};
colorShadow[] = {0,0,0,0.1};
colorBorder[] = {0,0,0,1};
offsetX = 0.004;
offsetY = 0.004;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
soundEnter[] = {"ui\ui_ok", 0.2, 1};
borderSize = 0.0;
};
class RscMandBackground
{
type = MANDCT_STATIC;
idc = -1;
style = MANDST_HUD_BACKGROUND;
colorBackground[] = {0, 0, 0, 0.2};
colorText[] = {1, 1, 1, 1};
font = FontMandHTML;
sizeEx = 0.04;
};
class RscMandFrame
{
type = MANDCT_STATIC;
idc = -1;
style = MANDST_FRAME;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = FontMandM;
sizeEx = 0.04;
};
class RscMandEdit
{
type = MANDCT_EDIT;
idc = -1;
style = MANDST_LEFT;
font = FontMandHTML;
sizeEx = 0.02;
colorText[] = {0, 0, 0, 1};
colorSelection[] = {0.5, 0.5, 0.5, 1};
autocomplete = false;
text = ;
};
class RscMandListBox
{
type = MANDCT_LISTBOX;
style = MANDST_LEFT;
idc = -1;
colorSelect[] = {1.0, 1.0, 1.0, 1};
colorSelectBackground[] = {0.2, 0.2, 0.2, 0.1};
colorText[] = {0.0, 0.0, 1.0, 1};
colorBackground[] = {0.0, 0.0, 0.0, 1};
font = FontMandHTML;
sizeEx = 0.025;
rowHeight = 0.03;
soundSelect[] = {"", 0.1, 1};
maxHistoryDelay = 1;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
class ScrollBar
{
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "\ca\ui\data\ui_scrollbar_thumb_ca.paa";
arrowFull = "\ca\ui\data\ui_arrow_top_active_ca.paa";
arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa";
border = "\ca\ui\data\ui_border_scroll_ca.paa";
};
};
class RscMandCombo
{
access = ReadAndWrite;
type = MANDCT_COMBO;
style = 0;
h = 0.05;
wholeHeight = 0.25;
colorSelect[] = {0.0, 0.0, 0.0, 1};
colorText[] = {1.0, 1.0, 1.0, 1};
colorBackground[] = {0.0, 0.0, 0.0, 1};
colorScrollbar[] = {0.2, 0.2, 0.2, 0.1};
font = FontMandHTML;
sizeEx = 0.025;
soundSelect[] = {"", 0.1, 1};
soundExpand[] = {"", 0.1, 1};
soundCollapse[] = {"", 0.1, 1};
};
class RscMandSlider
{
type = MANDCT_SLIDER;
style = 1024;
color[] = {0, 0, 0, 1};
angle = 0;
idc = -1;
sizeEx = 0.025;
selection="display";
w = 0.2;
h = 0.025;
};
// Missile control center dialog
class DlgMandoMusic
{
idd = 100;
movingEnable = true;
controlsBackground[] = {MUSIC_BACKGROUND,MUSIC_FRAME};
class MUSIC_BACKGROUND : RscMandBackground
{
colorBackground[] = {0, 0.1, 0.3, 0.6};
text = ;
style = MANDST_HUD_BACKGROUND;
sizeEx = 0.015;
x = 0.0+0.05;
y = 0.0+0.05-0.01;
w = 0.32-0.05+0.1;
h = 0.585 + 0.02 + 0.011+0.02;
};
class MUSIC_FRAME : RscMandText
{
idc = 101;
style = MANDST_FRAME;
colorText[] = {0, 0.6, 1, 1};
text = "Mando Music List";
font = "Bitstream";
sizeEx = 0.03;
x = 0.01+0.05;
y = 0.011+0.05-0.01;
w = 0.30-0.05+0.1;
h = 0.585+0.02;
};
objects[] = { };
controls[] = {MUSICLIST,MUSIC};
class MUSICLIST : RscMandListBox
{
idc = 102;
style = MANDST_LEFT;
x = 0.021+0.05;
y = 0.033+0.05;
w = 0.28-0.05+0.1;
h = 0.585 - 0.033 - 0.038;
colorText[] = {0.0, 0.8, 1, 1};
font = "Bitstream";
sizeEx = 0.03;
onLBSelChanged = "_this execVM""mando_playtrack.sqf""";
};
class MUSIC : RscMandEdit
{
idc = 103;
style = MANDST_LEFT + MANDST_WITH_RECT + MANDST_SHADOW;
x = 0.021+0.05;
y = 0.585 - 0.033+0.05;
w = 0.28-0.05+0.1;
h = 0.037;
colorText[] = {0, 0.8, 1, 1};
font = "Bitstream";
sizeEx = 0.03;
text = "";
};
};
class CfgMusic
{
tracks[]={Adult_Funny, ww2};
class Adult_Funny
{
name = "Adult_Funny";
sound[] = {"\music\Adult_Funny.ogg", db+0, 1.0};
};
class ww2
{
name = "ww2";
sound[] = {"\music\ww2.ogg", db+10, 1.0};
};
};
still not working?
-
CaptainBravo, in the future please use code tags when posting longer pieces of code.. :cop:
Makes it easier to read.
-
My appologies, it slepped my mind as I usually do not post anything longer than 2 lines :)
-
How to add Arrowhead music to that script?
-
Hello Mandoble,
my question is, for some reason none of the music player scripts work anymore, well for me anyway, im running A2OA and BAF expansions, ive tried your Mando Music for Arma2 aswell as Loki's Lost Key AddOn which has a music player and they dont work anymore, and ive used Lokí's Lost Key music player script which is much the same as yours with my own dialog im working on and it dosent work either. Is there any chance this is the case with you to, and if so could you look into it or if anyone else has had this problem and fixed it, can you help?
EDIT:
It seems to be a problem with XP i think because i have just updated to Windows7 in the last couple of days, and now the music players work again. The reason i think its XP is because i was using XP when i upgraded to A2OA and for some reason when ever i got a hint in mission after that, it made no sound, and now with Windows7 hints make a sound again to. :dunno: