Author Topic: Request: Selectable Debriefing Music?  (Read 4101 times)

0 Members and 1 Guest are viewing this topic.

Offline Axem

  • 211
Request: Selectable Debriefing Music?
Hey there FRED coder(s). I have a hopefully small request. The ability for the FREDder to select different debriefing musics. We can select Fiction viewer and briefing music, why not debriefing?

My idea would be three drop down boxes in the Debriefing Editor, where the FREDder can select the Success, Average and Fail entries from a music tbl/tbm. The three would obviously default to the originals.

The person who implements this gets 50 Axembux*!

*Due to hyperinflation, Axembux may be worthless in weeks days hours minutes!

 

Offline Axem

  • 211
Re: Request: Selectable Debriefing Music?
I'm being told that this feature may already be in the game (in missionparse) just not added to the FRED gui...

Let this be a reminder then!

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Request: Selectable Debriefing Music?
wat rly :/
(´・ω・`)
=============================================================

 

Offline Axem

  • 211
Re: Request: Selectable Debriefing Music?
So having a quick look in the code (thanks Eli for pointing me in the right direction), I have come to the conclusion that, yes indeed this feature is already in the codebase!

For any adventurous FREDder who wants to use it, here's how! (Until someone adds the GUI elements in. In notepad look for #Music and add the last three (and optional) lines.

Code: [Select]
#Music

$Event Music: None
$Briefing Music: None
$Debriefing Success Music: Brief6
$Debriefing Average Music: Cinema
$Debriefing Failure Music: Brief1

As you can see, I have brief6 playing for winning, and cinema for average!

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Request: Selectable Debriefing Music?
You are le awesome Axem
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Axem

  • 211
Re: Request: Selectable Debriefing Music?
But I didn't do anyt- :nervous:

Yes, yes I am.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: Selectable Debriefing Music?
Remind me about this on Friday and I'll add it to FRED. I've promised not to let coding distract me from FREDding until then but if I need a break from FRED I may code it before then.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Request: Selectable Debriefing Music?
Zacam seems to be working on adding these to FRED already.

Though if you want something to add to FRED...
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Request: Selectable Debriefing Music?
This was supposed to be a secret feature! :hopping:

(Not really; I was too lazy to add it to the gui.  But I'll take those Axembux.)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: Selectable Debriefing Music?
Zacam seems to be working on adding these to FRED already.

Though if you want something to add to FRED...

There's a good reason why I've never gotten around to adding that stuff. Although adding most of that stuff is fairly easy, adding a generic way of  choosing the SEXP formula that can be reused by other editors is a fairly big task. It's on the list for soon after I have no work for Diaspora R1.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Steam
    • Twitter
    • ModDB Feature
Re: Request: Selectable Debriefing Music?

I seem to have the basic structure for it worked out. I just need to add the graphical elements/positions to the .rc file to actually test it out with and then I'll have a .patch to post (assuming that it works)

Edit: Okay, so I have what I think is a rudimentary adjustment to make it all happen. I'll put the code/patch up first for critical review, then based on feedback I'll link some test builds based on that.

Code: [Select]
Index: debriefingeditordlg.cpp
===================================================================
--- debriefingeditordlg.cpp (revision 7857)
+++ debriefingeditordlg.cpp (working copy)
@@ -14,7 +14,10 @@
 #include "DebriefingEditorDlg.h"
 #include "FREDDoc.h"
 #include "mission/missionbriefcommon.h"
+#include "mission/missionparse.h"
+#include "globalincs/linklist.h"
 #include "parse/sexp.h"
+#include "gamesnd/eventmusic.h"
 #include "cfile/cfile.h"
 #include "sound/audiostr.h"
 #include "localization/localize.h"
@@ -35,6 +38,9 @@
  m_voice = _T("");
  m_stage_title = _T("");
  m_rec_text = _T("");
+ m_debriefPass_music = -1;
+ m_debriefAvg_music = -1;
+ m_debriefFail_music = -1;
  m_current_debriefing = -1;
  //}}AFX_DATA_INIT
 
@@ -54,6 +60,9 @@
  DDX_Text(pDX, IDC_VOICE, m_voice);
  DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
  DDX_Text(pDX, IDC_REC_TEXT, m_rec_text);
+ DDX_CBIndex(pDX, IDC_SUCCESSFUL_MISSION_TRACK, m_debriefPass_music);
+ DDX_CBIndex(pDX, IDC_DEBRIEFING_TRACK, m_debriefAvg_music);
+ DDX_CBIndex(pDX, IDC_FAILED_MISSION_TRACK, m_debriefFail_music);
  //}}AFX_DATA_MAP
 
  DDV_MaxChars(pDX, m_text, MAX_BRIEF_LEN - 1);
@@ -115,12 +124,32 @@
  CDialog::OnInitDialog();
  m_play_bm.LoadBitmap(IDB_PLAY);
  ((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
+ CComboBox *box;
+ box = (CComboBox *) GetDlgItem(IDC_ICON_IMAGE);
 
  m_current_debriefing = 0;
  UpdateData(FALSE);
 
+ m_debriefPass_music = Mission_music[SCORE_DEBRIEF_SUCCESS] + 1;
+ m_debriefAvg_music = Mission_music[SCORE_DEBRIEF_AVERAGE] + 1;
+ m_debriefFail_music = Mission_music[SCORE_DEBRIEF_FAIL] + 1;
  Debriefing = &Debriefings[m_current_debriefing];
 
+ box = (CComboBox *) GetDlgItem(IDC_SUCCESSFUL_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_DEBRIEFING_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_FAILED_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
  m_tree.link_modified(&modified);  // provide way to indicate trees are modified in dialog
  n = m_tree.select_sexp_node = select_sexp_node;
  select_sexp_node = -1;
@@ -152,6 +181,9 @@
  int enable, save_debriefing;
  debrief_stage *ptr;
 
+ Mission_music[SCORE_DEBRIEF_SUCCESS] = m_debriefPass_music - 1;
+ Mission_music[SCORE_DEBRIEF_AVERAGE] = m_debriefAvg_music - 1;
+ Mission_music[SCORE_DEBRIEF_FAIL] = m_debriefFail_music - 1;
  save_debriefing = m_current_debriefing;
 
  if (update)
Index: debriefingeditordlg.h
===================================================================
--- debriefingeditordlg.h (revision 7857)
+++ debriefingeditordlg.h (working copy)
@@ -8,6 +8,7 @@
 */
 
 
+#include "mission/missionbriefcommon.h"
 
 /////////////////////////////////////////////////////////////////////////////
 // debriefing_editor_dlg dialog
@@ -29,6 +30,9 @@
  CString m_voice;
  CString m_stage_title;
  CString m_rec_text;
+ int m_debriefPass_music;
+ int m_debriefAvg_music;
+ int m_debriefFail_music;
  int m_current_debriefing;
  //}}AFX_DATA
 
Index: fred.rc
===================================================================
--- fred.rc (revision 7857)
+++ fred.rc (working copy)
@@ -1646,7 +1646,7 @@
     CONTROL         "order 10",IDC_CHECK10,"Button",BS_3STATE | WS_TABSTOP,7,183,105,10
 END
 
-IDD_DEBRIEFING_EDITOR DIALOGEX 0, 0, 322, 172
+IDD_DEBRIEFING_EDITOR DIALOGEX 0, 0, 322, 225
 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Debriefing Editor"
 MENU IDR_PLAYER_EDIT_MENU
@@ -1668,6 +1668,13 @@
     LTEXT           "Stage 1 of 9",IDC_STAGE_TITLE,7,10,53,8
     LTEXT           "Usage Formula",IDC_STATIC,7,43,48,8
     LTEXT           "Recommendation Text",IDC_STATIC,135,96,72,8
+    GROUPBOX       "Debriefing Music",IDC_STATIC,7,175,260,45
+    LTEXT           "Success Music",IDC_STATIC,15,187,53,8
+    COMBOBOX        IDC_SUCCESSFUL_MISSION_TRACK,12,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Average Music",IDC_STATIC,100,187,53,8
+    COMBOBOX        IDC_DEBRIEFING_TRACK,97,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Failure Music",IDC_STATIC,185,187,53,8
+    COMBOBOX        IDC_FAILED_MISSION_TRACK,182,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
 END
 
 IDD_ADJUST_GRID DIALOG  0, 0, 153, 94



[attachment deleted by ninja]
« Last Edit: October 04, 2011, 08:30:51 am by Zacam »
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: Selectable Debriefing Music?
Ummmm. What is calling the update_data function? I don't see any OnSelectionChanged() style functions.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: Selectable Debriefing Music?
Here we go, updated patch.

Code: [Select]
Index: code/fred2/debriefingeditordlg.cpp
===================================================================
--- code/fred2/debriefingeditordlg.cpp (revision 7859)
+++ code/fred2/debriefingeditordlg.cpp (working copy)
@@ -14,7 +14,10 @@
 #include "DebriefingEditorDlg.h"
 #include "FREDDoc.h"
 #include "mission/missionbriefcommon.h"
+#include "mission/missionparse.h"
+#include "globalincs/linklist.h"
 #include "parse/sexp.h"
+#include "gamesnd/eventmusic.h"
 #include "cfile/cfile.h"
 #include "sound/audiostr.h"
 #include "localization/localize.h"
@@ -35,6 +38,9 @@
  m_voice = _T("");
  m_stage_title = _T("");
  m_rec_text = _T("");
+ m_debriefPass_music = 0;
+ m_debriefAvg_music = 0;
+ m_debriefFail_music = 0;
  m_current_debriefing = -1;
  //}}AFX_DATA_INIT
 
@@ -54,6 +60,9 @@
  DDX_Text(pDX, IDC_VOICE, m_voice);
  DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
  DDX_Text(pDX, IDC_REC_TEXT, m_rec_text);
+ DDX_CBIndex(pDX, IDC_SUCCESSFUL_MISSION_TRACK, m_debriefPass_music);
+ DDX_CBIndex(pDX, IDC_DEBRIEFING_TRACK, m_debriefAvg_music);
+ DDX_CBIndex(pDX, IDC_FAILED_MISSION_TRACK, m_debriefFail_music);
  //}}AFX_DATA_MAP
 
  DDV_MaxChars(pDX, m_text, MAX_BRIEF_LEN - 1);
@@ -115,12 +124,33 @@
  CDialog::OnInitDialog();
  m_play_bm.LoadBitmap(IDB_PLAY);
  ((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
+ CComboBox *box;
+ box = (CComboBox *) GetDlgItem(IDC_ICON_IMAGE);
 
  m_current_debriefing = 0;
  UpdateData(FALSE);
 
  Debriefing = &Debriefings[m_current_debriefing];
 
+ box = (CComboBox *) GetDlgItem(IDC_SUCCESSFUL_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_DEBRIEFING_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_FAILED_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ m_debriefPass_music = Mission_music[SCORE_DEBRIEF_SUCCESS] + 1;
+ m_debriefAvg_music = Mission_music[SCORE_DEBRIEF_AVERAGE] + 1;
+ m_debriefFail_music = Mission_music[SCORE_DEBRIEF_FAIL] + 1;
+
  m_tree.link_modified(&modified);  // provide way to indicate trees are modified in dialog
  n = m_tree.select_sexp_node = select_sexp_node;
  select_sexp_node = -1;
@@ -139,6 +169,7 @@
  }
  }
 
+ CDialog::OnInitDialog();
  update_data();
  set_modified();
 
@@ -402,6 +433,11 @@
  m_voice_id = -1;
  m_cur_stage = -1;
  update_data(1);
+
+ Mission_music[SCORE_DEBRIEF_SUCCESS] = m_debriefPass_music - 1;
+ Mission_music[SCORE_DEBRIEF_AVERAGE] = m_debriefAvg_music - 1;
+ Mission_music[SCORE_DEBRIEF_FAIL] = m_debriefFail_music - 1;
+
  CDialog::OnClose();
 }
 
Index: code/fred2/debriefingeditordlg.h
===================================================================
--- code/fred2/debriefingeditordlg.h (revision 7859)
+++ code/fred2/debriefingeditordlg.h (working copy)
@@ -8,6 +8,7 @@
 */
 
 
+#include "mission/missionbriefcommon.h"
 
 /////////////////////////////////////////////////////////////////////////////
 // debriefing_editor_dlg dialog
@@ -29,6 +30,9 @@
  CString m_voice;
  CString m_stage_title;
  CString m_rec_text;
+ int m_debriefPass_music;
+ int m_debriefAvg_music;
+ int m_debriefFail_music;
  int m_current_debriefing;
  //}}AFX_DATA
 

[attachment deleted by ninja]
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Steam
    • Twitter
    • ModDB Feature
Re: Request: Selectable Debriefing Music?

Thank you for the testing and feedback, Karajorma. I hit a roadblock on making sure that modifications would update (which you almost gave up on too, so I'm glad it wasn't just me).

Linked test builds, SSE2 Release and Debug for folks to test this change out with and find any errors before it goes to Trunk.

Also updated and attached the "complete" patch, since kara's lost the rc file information.


Fred2_DebriefMusic_SSE2.7z
MD5: E6015CE6EC6CC4889DEB553D77F7F7D1

[attachment deleted by ninja]
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Request: Selectable Debriefing Music?
As I said on IRC I've got no ****ing clue why my fixes work when yours didn't. Especially since the function I moved the Mission_music[SCORE_DEBRIEF_SUCCESS] = m_debriefPass_music - 1 called update_data() anyway.

But if it works, it works and that's good enough.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Axem

  • 211
Re: Request: Selectable Debriefing Music?
I gave it a quick test. It saves my choices and FreeSpace plays the right music. I'd say it works very nicely. :)

 

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Steam
    • Twitter
    • ModDB Feature
Re: Request: Selectable Debriefing Music?

Committed r7879.

Axem tested, even if not Axem approved. Apparently, it's not "centered". Pheh. FREDders. :D
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys