1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

ModsMenu.xml

Discussion in 'Civ5 - Creation & Customization' started by SnakeRavenCat, Jul 16, 2017.

  1. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    I'm having a little trouble getting my custom ModsMenu.lua/xml to load.

    It's just a copy of the original ModsMenu.lua, with
    Controls.MultiPlayerButton:SetHide(true);
    changed to
    Controls.MultiPlayerButton:SetHide(false);
    And the original ModsMenu.xml included for good measure

    It works fine if I change the original game file, but when I try to use the modified version to make a mod, the multiplayer option doesn't show.

    I've included it all into the VFS, set the actions to update on activation, and it's got the paired xml file.
    Nothing shows in the logs related to this, so now I'm just lost. Any help on how to get this working would be greatly appreciated.

    Before any comments about just changing it in the original, I'm making a bigger mod, this is just step one.

    I uploaded the mod file that I created so you can check for mistakes that I may have made. It is not a working mod.
     

    Attached Files:

  2. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    7,075
    Location:
    Illinois, USA
    This is incorrect for an xml file that begins with <Context>:
    Code:
      <Actions>
        <OnModActivated>
          <UpdateDatabase>Hotmodding/ModsMenu.xml</UpdateDatabase>
        </OnModActivated>
      </Actions>
    See whoward69's what ModBuddy setting for what file types tutorial

    Your mod is in fact "working". It is just not exposing the Multiplayer option and is instead removing the option to start a new game from the Single-Player menu on tha page that succeeds selecting SINGLE PLAYER in the modded games menus.

    So far as I know of the only way anyone has found to allow mods in a Multiplayer Civ5 game is by using the "fake DLC" method. No attempts I know of to allow direct usage of the game's mods menu for Multiplayer play has ever succeeded to my knowledge.
     
  3. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    That's just it. I got it working by modifying the original game file. All it takes is one change in modsmenu.lua to enable the multiplayer button, and then a few small changes in stagingroom.lua. I can use the built in multiplayer mods menu. No problem. The issue I'm having is making it work as a mod. Again, totally working if I make the changes directly to game files, but doesn't work when I attempt it as a mod.
     
  4. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    Here are the game files in question. They are in a mod package for ease of upload only. This is not a functioning mod. If you take the files in here and replace the originals, you will enable the built in multiplayer.

    First file is ModsMenu.lua it goes in [Install folder]/Assets/UI/FrontEnd/Modding/
    The only change is at the very end, where I made the change referenced in the post above to enable the button for multiplayer.

    Second is StagingRoom.lua which goes in [Install folder]/Assets/UI/FrontEnd/Multiplayer/
    The changes here are just commenting out a few lines which checked for approved dlc that were causing the game to unload mods at this screen.

    If anyone would like to make a successful mod based off of this, please feel free. Just mention me in the special thanks, since I'm apparently the only one to figure this out in all of these years the game has been around. Or at least the only one to post about it.
     

    Attached Files:

  5. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    I've just gotten into modding the Civ series, and for the past week have been pursuing this exact solution. I had independently found each of the changes you present here, SnakeRavenCat, and have also run into the same problem.

    It appears that simply providing override files for the existing front end UI scripts does not have any effect. My speculation is that the original scripts have already been loaded and their corresponding UIs already active in the background prior to the mod loading process. Regardless of the change, it does not appear to have any effect. It would be great if a more experienced modder could clear up the question for us: Is it possible to mod front end UI, or no?
     
  6. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    As I said above, it works if you mod the original game files, so it should be possible to do it as a mod. You are correct in your thoughts about it loading the modsmenu screen before it fully loads the mods. I was working on trying to force an update after you get into the screen by hijacking another process, but gave up. My thought was to insert a little sonething into the single player button that would force a screen update when clicked the first time, and then function normally afterwards. Alternatively, you could try a custom entry point that would bring you around to the functional version of the modsmenu screen. Ive tried both of these ideas in the past, with limited or no success, but maybe you'll see something i didnt.
     
  7. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    Right now, I'm just getting around the issue by manually flipping ModsMenu's DeferLoad to 1 in ModsBrowser.xml. This lets the mod properly load in before ModsMenu.

    Did you ever actually get into a Hot Seat game with mods this way? Or only up to the StagingRoom? I may be doing something wrong, because after clicking Ready in StagingRoom unloads all mods before beginning map generation, even though I've commented out the ActivateAllowedDLC lines in StagingRoom.
     
  8. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    Yeah, I've gotten it to load in with mods. Check the files in my more recent upload. See if maybe there's something i got that you missed.
     
  9. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    Hmm... I just tested with the files you provided, and I'm getting the same result as mine. When the Ready button is clicked, the game reconfigures and deactivates any active mods before moving on. Something is missing.
     
  10. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female

    Weird. I'll check it out, and get back to you later today. I'd love it if we could get a working mod together with this.
     
  11. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    Any progress on that? If we can get this working properly, I'm sure everyone would love a new, user friendly method of modded multiplayer play.

    I attempted to force a reactivation of enabled mods immediately after they get disabled, but that just seems throws the game into an infinite loop of activate/deactivate.
     
  12. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    Sorry about the delay, kind of spaced off yesterday. I work today, but I'll try and figure it out. I just tried mine again, and it's unloading the mods now, so I'll have to go through and see what I changed because as i said, it was working before.
     
  13. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    Was poking around, and can't figure out why it worked before, but not now. Seems like the trick is going to be figuring out what file is loaded right after you hit that ready button on the hotseat screen. Will work more later, and keep you updated. Let me know if you make any progress.
     
  14. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    The next script to print output in the Lua log after mods get deactivated is MapGenerator.lua. However, that script contains nothing related to the problem. Either there is a script that runs before MapGenerator which does not print anything, or MapGenerator functions are called from within the Matchmaking.LaunchMultiplayerGame() function inside the core DLL. Hopefully the mod deactivation is not internal to that function. If it is, we probably won't be able to do anything about it, short of a DLL mod.
     
  15. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    I'm on my way home now, and I'll check it out. There should be a way to do it without dll modding, because as i said before, i had it workng at one point, and i don't know jack about dll. What little i know of xml and lua comes from modding this game.
     
  16. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    Any progress on this? I don't have anything new to report.
     
  17. SnakeRavenCat

    SnakeRavenCat Chieftain

    Joined:
    Jul 6, 2017
    Messages:
    22
    Gender:
    Female
    Nothing yet. I've been working alot. Today's my day off though, so I may poke it a bit, and see if I can get it to do anything worthwhile.
     
  18. Exsolutus

    Exsolutus Chieftain

    Joined:
    Aug 12, 2017
    Messages:
    16
    Gender:
    Male
    I don't suppose you've come back to this project, have you?
     

Share This Page