Home   Help Search Login Register  

Author Topic: Mando Music for ArmA2 (ACCEPTED)  (Read 6676 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Mando Music for ArmA2 (ACCEPTED)
« 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

Offline rok

  • Members
  • *
    • ArmyOpsEurope.net
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #1 on: 28 Jan 2010, 16:52:38 »
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 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.

Offline CaptainBravo

  • Members
  • *
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #2 on: 29 Aug 2010, 17:47:26 »
Great script Mandoble!

Only question is if possible, how do you add custom music to radio menue?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #3 on: 03 Sep 2010, 22:44:26 »
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.


Offline CaptainBravo

  • Members
  • *
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #4 on: 03 Sep 2010, 23:44:53 »
I hate asking NooB question .. but how do you add it?

I did add below and obviously it did not work.

Code: [Select]
// 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.
« Last Edit: 05 Sep 2010, 06:55:05 by h- »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #5 on: 04 Sep 2010, 20:05:22 »
You need to add the sound/music definitions to this file:
http://community.bistudio.com/wiki/Description.ext

Offline CaptainBravo

  • Members
  • *
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #6 on: 05 Sep 2010, 02:09:42 »
Thanks Kju for your response. I have them listed in descption file:

Code: [Select]
#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?
« Last Edit: 05 Sep 2010, 06:54:16 by h- »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #7 on: 05 Sep 2010, 06:53:55 »
CaptainBravo, in the future please use code tags when posting longer pieces of code.. :cop:
Makes it easier to read.
« Last Edit: 05 Sep 2010, 06:56:44 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline CaptainBravo

  • Members
  • *
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #8 on: 05 Sep 2010, 13:56:20 »
My appologies, it slepped my mind as I usually do not post anything longer than 2 lines :)

Offline SaS TrooP

  • Members
  • *
  • n00b always & everywhere
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #9 on: 25 Sep 2010, 22:35:52 »
How to add Arrowhead music to that script?

Offline PartyHead

  • Members
  • *
Re: Mando Music for ArmA2 (ACCEPTED)
« Reply #10 on: 01 Oct 2010, 09:39:04 »
« Last Edit: 02 Oct 2010, 07:19:36 by PartyHead »