Author Topic: [Request] New Mainhall Capabilities  (Read 9304 times)

0 Members and 1 Guest are viewing this topic.

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
The pilot files are indeed now unified between single- and multi-player. I think the only difference between the singleplayer tab and the multiplayer tab in pilot selection is what the game mode is currently set to, but I haven't looked at that code very deeply.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
What's 'Script 6' supposed to do in your test? It hooks GS_EVENT_SCRIPTING, looks like it's supposed to display string 'You pressed button 6'.. but for me it just exits FSO.

Otherwise, this is working great. All of the previous issues have been fixed. Multiplayer is the only remaining thing I'm wondering about, but it is likely beyond the scope of this particular patch.
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 mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
Just FYI. This won't patch to latest Trunk anymore because the unstretched mainhall stuff was committed.
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 ngld

  • Administrator
  • 29
  • Knossos dev
Re: [Request] New Mainhall Capabilities
I just fixed the multiplayer stuff. You can now use the Readyroom and Multiplayer regions. Once the user selects the Readyroom or Multiplayer the game mode will be updated accordingly.
I also added a Start region which keeps the retail behaviour (Readyroom if single player was selected and Multiplayer if multi was selected).

Your issue with "Script 6" was a problem with the descriptions. If you look at the "+Door mask value"s, you'll notice that "Test" is supposed to quit FSO and the normal Exit region shows the scripted screen.

I've opened a new pull request on GitHub (which applies against current trunk).
Here's a Windows build and a Linux build.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
That pull request as a patch (add.patch to the URL) still doesn't apply to the latest SVN trunk. But that's OK, I can test with your supplied builds.

Start, Multiplayer, and Readyroom all work! Nicely done. :)

Here's the rejected patch hunks.
Code: [Select]
--- code/menuui/mainhallmenu.cpp
+++ code/menuui/mainhallmenu.cpp
@@ -1532,36 +1582,30 @@
  */
 void main_hall_maybe_blit_tooltips()
 {
- int w, text_index;
+ int w;
 
  // if we're over no region - don't blit anything
  if (Main_hall_mouse_region < 0) {
  return;
  }
 
- // get the index of the proper text to be using
- if (Main_hall_mouse_region == READY_ROOM_REGION) {
- // if this is a multiplayer pilot, the ready room region becomes the multiplayer region
- if (Player->flags & PLAYER_FLAGS_IS_MULTI){
- text_index = NUM_REGIONS - 1;
- } else {
- text_index = READY_ROOM_REGION;
- }
- } else {
- text_index = Main_hall_mouse_region;
+ if (Main_hall_mouse_region >= (int) Main_hall->regions.size()) {
+ Error(LOCATION, "Missing region description for index %d!\n", Main_hall_mouse_region);
  }
 
  // set the color and blit the string
  if (!help_overlay_active(Main_hall_overlay_id)) {
  int shader_y = (Main_hall->region_yval) - Main_hall_tooltip_padding[gr_screen.res]; // subtract more to pull higher
+ const char *desc = Main_hall->regions.at(Main_hall_mouse_region).description.c_str();
+
  // get the width of the string
- gr_get_string_size(&w, NULL, Main_hall->region_descript.at(text_index));
+ gr_get_string_size(&w, NULL, desc);
 
  gr_set_shader(&Main_hall_tooltip_shader);
  gr_shade(0, shader_y, gr_screen.clip_width_unscaled, (gr_screen.clip_height_unscaled - shader_y), GR_RESIZE_MENU);
 
  gr_set_color_fast(&Color_bright_white);
- gr_string((gr_screen.max_w_unscaled - w)/2, Main_hall->region_yval, Main_hall->region_descript.at(text_index), GR_RESIZE_MENU);
+ gr_string((gr_screen.max_w_unscaled - w)/2, Main_hall->region_yval, desc, GR_RESIZE_MENU);
  }
 }
 

Basically it still looks as if your changes aren't made on mainhallmenu.cpp that includes the new defined width and height. I tried to do those hunks manually, but I'm too dumb. :p
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 ngld

  • Administrator
  • 29
  • Knossos dev
Re: [Request] New Mainhall Capabilities

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
It did, thanks! No issues found, either. :)

I have no more requests for this patch.

EDIT.. I loaded the wrong mod. This patch against latest trunk gives me. ERROR: Missing required token ($Main Hall). Found [+Door mask value: 255] instead.

Looks like this chunk gets patched into the wrong place. It should go below Door Pan section and not above Num Door Animations. Dunno why Tortoise patched it there. *shrug*

Anyhow, I got it working together once I moved that to the correct place.. and NOW I have no issues.

Code: [Select]
                       region_info_init(*m);
                     
                       int mask;
                       for (idx = 0; optional_string("+Door mask value:"); idx++) {
                               // door mask
                               stuff_string(temp_string, F_RAW, MAX_FILENAME_LEN);
                             
                               mask = (int) strtol(temp_string, NULL, 0);
                               mask = 255 - mask;
                             
                               m->regions.resize(m->regions.size() + 1);
                               m->regions.at(idx).mask = mask;
                       }
                     
                       for (idx = 0; optional_string("+Door action:"); idx++) {
                               // door action
                             
                               if (optional_string("Script")) {
                                       m->regions.at(idx).action = SCRIPT_REGION;
                                       stuff_string(m->regions.at(idx).lua_action, F_RAW);
                               } else {
                                       stuff_string(temp_scp_string, F_RAW);
                                     
                                       int action = -1;
                                       for (int i = 0; Main_hall_region_map[i].name != NULL; i++) {
                                               if (temp_scp_string == Main_hall_region_map[i].name) {
                                                       action = Main_hall_region_map[i].mask;
                                                       break;
                                               }
                                       }
                                     
                                       if (action == -1) {
                                               temp_scp_string = "";
                                               for (int i = 0; Main_hall_region_map[i].name != NULL; i++) {
                                                       temp_scp_string += ", ";
                                                       temp_scp_string += Main_hall_region_map[i].name;
                                               }
                                             
                                               Error(LOCATION, "Unkown Door Region '%s'! Expected one of: %s", temp_string, temp_scp_string.substr(2).c_str());
                                       }
                                     
                                       m->regions.at(idx).action = action;
                               }
                       }

                       for (idx = 0; optional_string("+Door description:"); idx++) {
                               // region description (tooltip)
                               stuff_string(temp_scp_string, F_MESSAGE);

                               if (temp_scp_string != "default") {
                                       m->regions.at(idx).description = temp_scp_string;
                                     
                                       if (idx == 2) {
                                               m->default_readyroom = false;
                                       }
                               }
                       }
« Last Edit: June 27, 2014, 05:03:08 pm by mjn.mixael »
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 ngld

  • Administrator
  • 29
  • Knossos dev
Re: [Request] New Mainhall Capabilities
You were right. I updated the patch so the parsing code is in the right place.
So... I guess I'll poke someone to commit this to trunk?

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
it needs to be reviewed first.
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 AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
Looked over the patch, found a couple issues (which ngld promptly fixed), and tested it out. Seems to work, does what it says it does, and doesn't break existing functionality (as far as I could tell).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [Request] New Mainhall Capabilities
I know it's awfully late for 3.7.2, but I'm hoping this can make it in. I'm working toward a late 2014 release of BtA which will make use of this.
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.