Force a refresh when mods disappear after a ModBuddy build

robk

Warlord
Joined
Sep 8, 2006
Messages
210
Location
Santa Monica, CA
I constantly have this problem where my mod disappears after doing a build from modBuddy (happens about 1/3rd of the time). This is really annoying since one of my mods takes about 12 seconds to build and that's a long time when you're sitting around twiddling your thumbs, especially if you have to rebuild, like, 4 times just to get the list to show up correctly.

I did a little investigation today and found out that, when that happens, you can do this to get your mod to show up again:

1) Go to your tuner and change the state to "InstalledPanel"
2) Type in Modding.DiscoverMods()
3) Type in RefreshMods()

It looks like RefreshMods() is being fired whenever something in that directory changes. However, it sometimes fires a split second too early and catches the mod right before it unpacks, which makes it look like the mod doesn't exist. Calling RefreshMods() by itself doesn't work because it uses Modding.GetInstalledMods() which doesn't actually open the directory and look at the files; however, Modding.DiscoverMods() does that for us.

Because I'm lazy and hate typing stuff in, I made edits to the InstalledPanel files to add a button that forces the mod list to fully refresh. They're attached to the post and you can just drop them in C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\Assets\UI to override the originals (thanks Thal!).

Note: attached files are compatible with version 1.0.1.141
 

Attachments

  • InstalledPanel.zip
    9.6 KB · Views: 209
I just noticed I goofed on the placement of the button. It shows up correctly in 1024x768 windowed mode but looks horrible otherwise. I'll play with it tonight to see if I can find a better spot for it to live.

Edit: Ok, updated the files so the button shows up in the right place regardless of the screen resolution.
 
Tested, and it works, yay! Thanks robk!

By the way, you don't have to replace core files. I discovered the Assets\UI root directory is read after the subdirectories, so you can put files there to override.
 
Why not just add a new panel to FireTuner for this? Works like a charm.

Drop the attached panel into your civ5/debug directory, open FireTuner, click on File->Open Panel, open it. Then click on Admin->Edit Project Panels and check the ModListRefresh panel so it's opened automatically. Whenever the mod goes AWOL, simply click the button and enjoy.
 
Updated the installed panel files with the changes from the latest two patches. I also moved the button so it's not sitting over the "Install Mods" button.

Oh, and regarding the firetuner, it's more or less a preference thing for me to put the button in the game itself. Mainly, because on occasion, I'll be in full screen mode and don't want to flip back and forth if I don't have to. Still, it's pretty cool that you can create buttons like that in the tuner.
 
I assume this is the panel alpaca meant to attach.

Admittedly, in-game has it advantages, but if you could see all the unwanted print statements I've accidentally left in the base files and can no longer locate to remove, well, you'd understand my hesitation at editing the base files. :)
 

Attachments

  • ModListRefresh.zip
    470 bytes · Views: 128
I assume this is the panel alpaca meant to attach.

Admittedly, in-game has it advantages, but if you could see all the unwanted print statements I've accidentally left in the base files and can no longer locate to remove, well, you'd understand my hesitation at editing the base files. :)

Hmm strange, I was sure I had actually attached it :lol:

You don't have to edit them as such, you can create a new directory in the UI folder that's loaded later, like "skins" and the files inside can override the vanilla versions. I do this to suppress the EULA for the modding screen for example. I always play in windowed mode anyways, so it's not much of a bother for me to have it in FireTuner.

Actually, this bug is a bit strange. Once PWM grew larger (couple seconds build time) it disappeared for me, and for very small mods it doesn't usually occur, either.
 
Good to know. The real problem is I usually edit a base file accidentally. I forget what file I'm looking in and I want a print statement to see something. The moment I hit save, I always think, it's okay, it's just temporary. But for some reason I always then have to go looking somewhere else in the code and...

I swear, I've looked in every lua file and I just can't seem to find that giant print statement coming out of MapScript. :)

I keep thinking a reinstall wouldn't be a bad idea, but then I stop to think if I still remember all the steps for getting the SDK up and running and I decide it's not worth it.
 
Good to know. The real problem is I usually edit a base file accidentally. I forget what file I'm looking in and I want a print statement to see something. The moment I hit save, I always think, it's okay, it's just temporary. But for some reason I always then have to go looking somewhere else in the code and...

I swear, I've looked in every lua file and I just can't seem to find that giant print statement coming out of MapScript. :)

I keep thinking a reinstall wouldn't be a bad idea, but then I stop to think if I still remember all the steps for getting the SDK up and running and I decide it's not worth it.
The map scripts print a lot of stuff in vanilla. Anyways, you should be able to delete it and let steam verify your game cache. (Keep a backup, though, steam sometimes bugs out)

I know the problem, though, apart from vanilla files I also usually forget to switch off print statements in my mod. Putting the vanilla files you change in another folder is good, though, because you can then just wipe it.
 
It's only a big deal when I forget to turn on that darn VFS and there's a file load failure somewhere in the middle of the startup text. Oh look! Selection for # 8 NW to be assigned -- ATTEMPT # 5. I turned that on for a reason... I think. :)
Spoiler :
Code:
InstalledPanel: Refreshing Mods
 InstalledPanel: Refreshing Mods
 InstalledPanel: Refreshing Mods
 Map Script: Generating Map
 Map Script: Generating Plot Types (Lua Pangaea) ...
 Map Script: Setting Plot Types (MapGenerator.Lua)
 Map Script: Setting Plot Types (MapGenerator.Lua)
 Map Script: Setting Plot Types (MapGenerator.Lua)
 Map Script: Setting Plot Types (MapGenerator.Lua)
 Map Script: Setting Plot Types (MapGenerator.Lua)
 Map Script: Setting coasts and oceans (MapGenerator.Lua)
 Map Script: Expanding coasts (MapGenerator.Lua)
 Map Script: Setting Terrain Types (MapGenerator.Lua)
 Map Script: Map Generation - Adding Rivers
 Map Script: Map Generation - Adding Lakes
 Map Script: 3 lakes added
 Map Script: Adding Features (Lua Pangaea) ...
 Map Script: Creating start plot database.
 Map Script: Dividing the map in to Regions.
 Map Script: Map Generation - Dividing the map in to Regions
 Map Script: Choosing start locations for civilizations.
 Map Script: Map Generation - Choosing Start Locations for Civilizations
 Map Script: Normalizing start locations and assigning them to Players.
 Map Script: Placing Natural Wonders.
 Map Script: -
 Map Script: NW#	5	of ID#	9	has OccurrenceFrequency of:	10
 Map Script: -
 Map Script: NW#	1	of ID#	13	has OccurrenceFrequency of:	10
 Map Script: -
 Map Script: NW#	3	of ID#	12	has OccurrenceFrequency of:	10
 Map Script: -
 Map Script: NW#	8	of ID#	14	has OccurrenceFrequency of:	1
 Map Script: -
 Map Script: NW#	9	of ID#	15	has OccurrenceFrequency of:	5
 Map Script: -
 Map Script: NW#	10	of ID#	16	has OccurrenceFrequency of:	2
 Map Script: -
 Map Script: NW#	6	of ID#	10	has OccurrenceFrequency of:	10
 Map Script: -
 Map Script: NW#	7	of ID#	11	has OccurrenceFrequency of:	10
 Map Script: --------------------------------------------------
 Map Script: Table printout for table ID:	table: 15E26CB0
 Map Script: Table index:	1	Table entry:	5
 Map Script: Table index:	2	Table entry:	5
 Map Script: Table index:	3	Table entry:	5
 Map Script: Table index:	4	Table entry:	5
 Map Script: Table index:	5	Table entry:	5
 Map Script: Table index:	6	Table entry:	5
 Map Script: Table index:	7	Table entry:	5
 Map Script: Table index:	8	Table entry:	5
 Map Script: Table index:	9	Table entry:	5
 Map Script: Table index:	10	Table entry:	5
 Map Script: Table index:	11	Table entry:	1
 Map Script: Table index:	12	Table entry:	1
 Map Script: Table index:	13	Table entry:	1
 Map Script: Table index:	14	Table entry:	1
 Map Script: Table index:	15	Table entry:	1
 Map Script: Table index:	16	Table entry:	1
 Map Script: Table index:	17	Table entry:	1
 Map Script: Table index:	18	Table entry:	1
 Map Script: Table index:	19	Table entry:	1
 Map Script: Table index:	20	Table entry:	1
 Map Script: Table index:	21	Table entry:	3
 Map Script: Table index:	22	Table entry:	3
 Map Script: Table index:	23	Table entry:	3
 Map Script: Table index:	24	Table entry:	3
 Map Script: Table index:	25	Table entry:	3
 Map Script: Table index:	26	Table entry:	3
 Map Script: Table index:	27	Table entry:	3
 Map Script: Table index:	28	Table entry:	3
 Map Script: Table index:	29	Table entry:	3
 Map Script: Table index:	30	Table entry:	3
 Map Script: Table index:	31	Table entry:	8
 Map Script: Table index:	32	Table entry:	9
 Map Script: Table index:	33	Table entry:	9
 Map Script: Table index:	34	Table entry:	9
 Map Script: Table index:	35	Table entry:	9
 Map Script: Table index:	36	Table entry:	9
 Map Script: Table index:	37	Table entry:	10
 Map Script: Table index:	38	Table entry:	10
 Map Script: Table index:	39	Table entry:	6
 Map Script: Table index:	40	Table entry:	6
 Map Script: Table index:	41	Table entry:	6
 Map Script: Table index:	42	Table entry:	6
 Map Script: Table index:	43	Table entry:	6
 Map Script: Table index:	44	Table entry:	6
 Map Script: Table index:	45	Table entry:	6
 Map Script: Table index:	46	Table entry:	6
 Map Script: Table index:	47	Table entry:	6
 Map Script: Table index:	48	Table entry:	6
 Map Script: Table index:	49	Table entry:	7
 Map Script: Table index:	50	Table entry:	7
 Map Script: Table index:	51	Table entry:	7
 Map Script: Table index:	52	Table entry:	7
 Map Script: Table index:	53	Table entry:	7
 Map Script: Table index:	54	Table entry:	7
 Map Script: Table index:	55	Table entry:	7
 Map Script: Table index:	56	Table entry:	7
 Map Script: Table index:	57	Table entry:	7
 Map Script: Table index:	58	Table entry:	7
 Map Script: - - - - - - - - - - - - - - - - - - - - - - - - - -
 Map Script: Selection for #	1	NW to be assigned -- ATTEMPT #	1
 Map Script: NW#	5	chosen.
 Map Script: Selection for #	2	NW to be assigned -- ATTEMPT #	1
 Map Script: NW#	7	chosen.
 Map Script: Selection for #	3	NW to be assigned -- ATTEMPT #	1
 Map Script: NW#	6	chosen.
 Map Script: Selection for #	4	NW to be assigned -- ATTEMPT #	1
 Map Script: NW#	1	chosen.
 Map Script: Selection for #	5	NW to be assigned -- ATTEMPT #	1
 Map Script: NW#	3	chosen.
 Map Script: Selection for #	6	NW to be assigned -- ATTEMPT #	1
 Map Script: Selection for #	6	NW to be assigned -- ATTEMPT #	2
 Map Script: Selection for #	6	NW to be assigned -- ATTEMPT #	3
 Map Script: Selection for #	6	NW to be assigned -- ATTEMPT #	4
 Map Script: Selection for #	6	NW to be assigned -- ATTEMPT #	5
 Map Script: NW#	9	chosen.
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	1
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	2
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	3
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	4
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	5
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	6
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	7
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	8
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	9
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	10
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	11
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	12
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	13
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	14
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	15
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	16
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	17
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	18
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	19
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	20
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	21
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	22
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	23
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	24
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	25
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	26
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	27
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	28
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	29
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	30
 Map Script: Selection for #	7	NW to be assigned -- ATTEMPT #	31
 Map Script: NW#	8	chosen.
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	1
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	2
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	3
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	4
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	5
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	6
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	7
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	8
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	9
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	10
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	11
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	12
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	13
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	14
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	15
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	16
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	17
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	18
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	19
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	20
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	21
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	22
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	23
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	24
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	25
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	26
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	27
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	28
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	29
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	30
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	31
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	32
 Map Script: Selection for #	8	NW to be assigned -- ATTEMPT #	33
 Map Script: NW#	10	chosen.
 Map Script: -
 Map Script: --- Readout of NW Assignment Priority ---
 Map Script: NW Assignment Priority#	1	goes to NW#	5
 Map Script: NW Assignment Priority#	2	goes to NW#	7
 Map Script: NW Assignment Priority#	3	goes to NW#	6
 Map Script: NW Assignment Priority#	4	goes to NW#	1
 Map Script: NW Assignment Priority#	5	goes to NW#	3
 Map Script: NW Assignment Priority#	6	goes to NW#	9
 Map Script: NW Assignment Priority#	7	goes to NW#	8
 Map Script: NW Assignment Priority#	8	goes to NW#	10
 Map Script: -
 Map Script: -
 Map Script: -
 Map Script: Natural Wonder #	5	has been selected for placement.
 Map Script: Natural Wonder #	7	has been selected for placement.
 Map Script: Natural Wonder #	6	has been selected for placement.
 Map Script: -
 Map Script: Natural Wonder #	1	has been selected as fallback.
 Map Script: Natural Wonder #	3	has been selected as fallback.
 Map Script: Natural Wonder #	9	has been selected as fallback.
 Map Script: Natural Wonder #	8	has been selected as fallback.
 Map Script: Natural Wonder #	10	has been selected as fallback.
 Map Script: -
 Map Script: --- Placing Natural Wonders! ---
 Map Script: - Placed Mesa in Plot	24	27
 Map Script: - Placed Krakatoa in Plot	47	31
 Map Script: - Placed Reef in Plot	39	28
 Map Script: -- Placed all Natural Wonders --
 Map Script: -
 Map Script: -
 Map Script: Placing Resources and City States.
 Map Script: Map Generation - Assigning Luxury Resource Distribution
 Map Script: Map Generation - Placing City States
 Map Script: Map Generation - Choosing sites for City States
 Map Script: All city states assigned.
 Map Script: Map Generation - Placing Luxuries
 Map Script: Failed to place	1	units of Marble.
 Map Script: Map Generation - Placing Strategics
 Map Script: Map Generation - Placing Bonuses
 Map Script: Map Generation - Normalize City State Locations
 Map Script: -------------------------------
 Map Script: Map Generation - Adding Goodies
 Map Script: -------------------------------
 Map Script: Determining continents for art purposes (MapGenerator.Lua)
 CivilopediaScreen: SetSelectedCategory(12)
 CivilopediaScreen: CivilopediaCategory[CategoryTerrain].DisplayList
 CivilopediaScreen: SetSelectedCategory(1)
 CivilopediaScreen: CivilopediaCategory[CategoryHomePage].DisplayList
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ConfirmImprovementRebuildPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\CityPlotManagementPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ConfirmCommandPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\MinorCivEnterTerritoryPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\LiberateMinorPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ReturnCivilianPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\AnnexCityPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\DeclareWarMovePopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\BarbarianRansomPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ConfirmGiftPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ConfirmCityTaskPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\PuppetCityPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\GreatPersonPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\DeclareWarRangeStrikePopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\ConfirmPolicyBranchPopup.lua
 GenericPopup: Loaded Popup - Assets\UI\InGame\PopupsGeneric\MinorCivGoldPopup.lua
Anyway, I wanted to know what you were talking about with Tuner so played around with building the panel you meant to attach. In-game using skins makes a lot more sense, but it never hurts to know all the options.

BTW, I'm releasing a new version of ModList tonight. It rocksaur... :)
edit: a day late, and worth the wait. Check it!
 
Top Bottom