World of Banished

Conversations => General Discussion => Topic started by: JM on September 16, 2018, 05:23:20 PM

Title: Mod manager
Post by: JM on September 16, 2018, 05:23:20 PM
The mod manager in the game is inadequate. If I have a total of 5-10 mods, it suits. When there are fifty, it's complicated. And the need to restart the game after any change is annoying.

That's why I made a little program about it. Not much, allowing you to turn modes on and off, and simply change their order with the mouse by dragging them to another position. You can also save the current mods configuration to a file and restore it later.

The program changes these values in the registry:
"HKEY_CURRENT_USER\Software\Shining Rock Software LLC\Banished\ModIndex_XXX" and "ModEnabled_XXX"
and does not change anything else.

Made using Dephi-7, tested on WinXP-32bit and Win10.

When you first run it, you need to set the path to the Banished executable (usually Application-32.exe or Application-64.exe). It can be changed at any time later.

Do not use ModMan when the game is running because your changes will be lost, the game will override these values.

So, if anyone wants to try ...
Title: Re: Mod manager
Post by: embx61 on September 16, 2018, 05:43:54 PM
Nice work.  :)


Delphi 7.0, The RAD Developing tool  :)


Version 7 is an oldie and I use to do programming as hobby in Delphi some years ago.
Object Pascal is a nice language and it was not hard to roll into and I never did any programming before Delphi 1.0 came out in the nineties.
Title: Re: Mod manager
Post by: embx61 on September 16, 2018, 06:08:16 PM
It seem to work all right.


It writes to the registry, read from the registry and players can even save the settings to a ini file and then load that file and save to the game.
Not tested it for a long time but it seem to do what it suppose to do :)


Great Job
Title: Re: Mod manager
Post by: brads3 on September 16, 2018, 06:15:04 PM
is there a way to complete yuour program so that it wll allow players to control the mod order?turning them on and off may work if you only have 4 or 5. when you deal with 100+ mods at once,it does take a lot of time to redo the mod order. 
Title: Re: Mod manager
Post by: embx61 on September 16, 2018, 06:38:52 PM
The program does that.

You can click and drag with the mouse any order in the interface of the program.
Then press Save to game (Game must not be running as it will rewrite as JM said) and voila.

With saving the Mod list to several ini files players can make a whole library of mod list's.

Just give those ini files some good names so you know for what kind of game you have that order.
Then when it is time, load Mod Manager, load from that file and you see the modlist as is in the file.
Write to game and that's it. Start banished and the modlist should be as in the list and interface.

I did a test and wrote my modlist to a ini file. Then I cleared my registry.
Loaded that saved ini file and pressed Save to game.

Loaded Banished and it was like the ini file :)
Title: Re: Mod manager
Post by: brads3 on September 16, 2018, 06:57:01 PM
looks good.sign this guy up . now we need 1 so we can crack into the game deeper. 1 that will add all start lines together so mods don't override each other.if we use 2 start mods the game should add items of both to start maps.or climate from 1 mod and terrain from another. i'll keep dreaming and go sit in a corner now.

seriously thanks. this mod should save lots of time between games.

what they say is impossable just hasn't been tried by the right pople yet.
Title: Re: Mod manager
Post by: RedKetchup on September 16, 2018, 09:54:31 PM
what they say is impossable just hasn't been tried by the right pople yet.

^^ moddling and programming is totally 2 different things, Brads
Title: Re: Mod manager
Post by: Gatherer on September 17, 2018, 12:56:22 AM
This is awesome @JM !!! Thank you very much. This will greatly reduce time to arrange mod load order.


I think this should be made a sticky topic.
Title: Re: Mod manager
Post by: RedKetchup on September 17, 2018, 01:08:40 AM

I think this should be made a sticky topic.

done as you wished
Title: Re: Mod manager
Post by: zak4862 on September 17, 2018, 01:15:08 AM
Greetings to you JM!
I have downloaded and tried it. It works like a charm.
So thanks to you there will be no more long hours adding all those mods to a new game start.
Extremely impressive work. Thank you very much for sharing it.
   Regards  zak4862   :o 8) :)
Title: Re: Mod manager
Post by: Kristahfer on September 17, 2018, 07:14:10 AM
I can not thank you enough for this fantastic tool.

To add a new mod you will have to place it in the WinData folder and start the game, exit and then run ModMan. You will have to correct your saved INI files to include the new mod.
I am a Mod Hog and have 268 Mods in the WinData folder, (No I do not use all at the same time), this tool saves so much time enabling, disabling and moving it is unbelievable.

Again thanks so very much.
Title: Re: Mod manager
Post by: embx61 on September 17, 2018, 08:30:12 AM
I am pleased to see this Mod gets the good remarks it deserves.
It will save the players which changing out mods many times over a lot of time.

Just leave all your mods in the windata folder (My registry had the same mods like 8 or 9 times in the registry (the registry had about 700 mod entrees) and never had any issues) and use this GEM to enable/disable and/or reorder them.
Write to a ini file for save keeping and write to game so the mods are written to the registry and that all there is to it.

Players can make complete libraries of ini files with certain load orders and which mods are enabled/disabled.

Maybe a small suggestion to JM. Maybe add a text edit box in the Interface so players can write some notes about that load order what also get stored in the ini file, but of course that part not get written to the registry unless you want to add a key to the Banished registry, so pulled up when loading the ini file? Things like "This mod order is to play with Tom Sawyer's the North - Created September 16 2018, and so fort :)

For players who will make libraries of ini files it will be very helpful I think.
Title: Re: Mod manager
Post by: embx61 on September 17, 2018, 08:46:57 AM
what they say is impossable just hasn't been tried by the right pople yet.

^^ moddling and programming is totally 2 different things, Brads


In this game it is because there is no SDK (Software Development Kit)
Civilization had a SDK so some stuff could be programmed to change game behaviors. You have to know some C++ though and need a compiler.
Microsoft gave a away for free a stripped version of Visual Studio which is good enough (I used it many years ago when doing some modding for Civ 4) for this purpose.


But Red is right, JM cannot access the source code unless he knows, if even possible, to reverse engineer the Banished code.
All JM does is using some registry keys of Banished and his program not touch the Banished code at all.


Banished itself reads and writes from/to the registry when loading and shutting down.
This program makes the process of enabling and reordering Mods very fast and simple without the need of having Banished run to do it all.
Title: Re: Mod manager
Post by: galensgranny on September 17, 2018, 12:49:34 PM
@JM This is great!  Thank you so very much for making this!  I had been wanting a way to inactivate/activate mods and change mod order in a faster, easier way, and here it is it! 
Title: Re: Mod manager
Post by: Tom Sawyer on September 17, 2018, 01:38:20 PM
That's a nice idea and a great little tool. Especially for the people who like to play different scenarios.. CC, North and so on. I support the idea from EB about a title or description of the profiles. Or at least the profiles file name to see in the app window. Also, you can initially try to get the path from C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe. It will work in 90% and not everyone knows this path to set it manually.

I have some more ideas but want to test it a bit for this CC/North profile switching case. Again, nice work! :)
Title: Re: Mod manager
Post by: JM on September 17, 2018, 10:09:40 PM
Version 0.2 (experimental)

Fixed possible bug when overwriting existing profiles.

Changes:

When saving profile, it is now possible to add notes, which are then displayed in the "load from file" dialog. I do not  like this implementation, I will be thinking about changing it somehow. So far, I'm going to look for bugs.
Title: Re: Mod manager
Post by: Hawk on September 18, 2018, 04:42:36 AM
Also, you can initially try to get the path from C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe. It will work in 90% and not everyone knows this path to set it manually.

But what about all the people that didn't buy Banished from Steam?
On my computer, the path to the exe is E:\GoG\Banished\Application-x64.exe (GoG is a directory I created. It wasn't created by installing the GoG version).
Others will have a completely different path. Most folks know how to find their own path, I think.  :)
Title: Re: Mod manager
Post by: RedKetchup on September 18, 2018, 10:59:02 AM
usually when you install a game, it doesnt store its path in the registry ?
Title: Re: Mod manager
Post by: JM on September 18, 2018, 12:27:06 PM
It is certainly possible to try to get a path from the registry. Or, get it by dragging the Banished shortcut into the Modman window. But maybe it's useless.

ModMan has no installer. Its user must be able to download the archive, unzip it somewhere, and make a desktop shortcut.

If he can do this, he will certainly be able to find the Application-XX using the standard file dialog.
If cannot, he is also unable to manually add mods to WinData, so he does not need ModMan.

Title: Re: Mod manager
Post by: Tom Sawyer on September 18, 2018, 01:05:50 PM
The idea was to let the app try the known path from Steam users (and also from the default GOG installation) to skip this initial step if possible. If it cannot find the right path then the user has to set it manually of course. Steam users don't deal with mod files. They just subscribe in Steam or grab it directly in game. I doubt they usually know where it's stored on their local machine. Was just a thought to make the app more user-friendly. :)
Title: Re: Mod manager
Post by: RedKetchup on September 18, 2018, 01:30:12 PM
ModMan has no installer. Its user must be able to download the archive, unzip it somewhere, and make a desktop shortcut.

i was not talking about the ModMan install, was talking about the game itself install. in the registry, if you install the game from steam or gog install, there is surely a trace somewhere; where the banished game did installed itself.
Title: Re: Mod manager
Post by: Hawk on September 18, 2018, 02:09:37 PM
usually when you install a game, it doesnt store its path in the registry ?

It shows in the Registry on my machine at this location.

Code: [Select]
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GOG.com\Games\1207660783\launchCommand

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GOG.com\Games\1207660783\exe

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GOG.com\Games\1207660783\path
Title: Re: Mod manager
Post by: JM on September 18, 2018, 03:35:17 PM
"Steam users don't deal with mod files. They just subscribe in Steam or grab it directly in game"

I did not know this, I do not use Steam. Thx for info.
Okay, I'll try to find out what I can do for Steam users.
Title: Re: Mod manager
Post by: elemental on September 18, 2018, 03:46:02 PM
It's true that Steam users can do it that way but Steam users can also manually add mods. It doesn't have to be done through Steam.
Title: Re: Mod manager
Post by: JM on September 18, 2018, 04:40:12 PM
Well, if the 'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' or 'x32.exe' exists, I use it as the initial value in the file dialog.

// How does the quote button on the right of the post work? I clicked on it and nothing happened.
Title: Re: Mod manager
Post by: elemental on September 18, 2018, 04:51:03 PM
The quote button you see when reading posts doesn't work. But if you hit reply, then you can use the Insert Quote button.
Title: Re: Mod manager
Post by: RedKetchup on September 18, 2018, 05:04:32 PM
Well, if the 'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' or 'x32.exe' exists, I use it as the initial value in the file dialog.

// How does the quote button on the right of the post work? I clicked on it and nothing happened.


for steam users you can get the REG_SZ there : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\
Title: Re: Mod manager
Post by: Hawk on September 19, 2018, 02:43:11 AM

// How does the quote button on the right of the post work? I clicked on it and nothing happened.

The quote button you see when reading posts doesn't work. But if you hit reply, then you can use the Insert Quote button.

Strange! It works for me.
Title: Re: Mod manager
Post by: JM on September 24, 2018, 11:04:51 AM
Version 0.3

Before using this, backup your existing saves.

It is now possible to add comments to the data stored in the registry. Click on "Description" button to open the comment box. Text can be changed at any time. When submitting data to a game, the text will be written together. When saving to a file, the text can also be changed in the save dialog window before saving it. When reading data from a registry or loading a file, the saved text is also loaded.

ModMan should be able to find the game directory according to the uninstaller data. It works for me, but my game is not from Steam. Please a Steam user to try this: Open ModMan.ini and delete or rename the "ExeName" entry, then run Modman and let me know how it works.
Title: Re: Mod manager
Post by: Tom Sawyer on September 24, 2018, 01:01:16 PM
Sorry to say but the auto detection does not work in my Steam installation. May I ask why do you actually need the path of the game exe?
Title: Re: Mod manager
Post by: JM on September 24, 2018, 01:21:48 PM
I do not need exe. Need WinData to be able to make list of existing mods. It's easier to find the exe using the standard windows open dialog.
I am searching Software\Microsoft\Windows\CurrentVersion\Uninstall for all installed programs, looking for DisplayName = Banished, then extract uninstall directory from UninstallString. Maybe Steam installation differs grom my installation.

I do not have access to a computer with a game installed from Steam.

Dropping an icon works?
Steam users use an exe or launcher to start the game?


Title: Re: Mod manager
Post by: embx61 on September 24, 2018, 01:41:42 PM
Probably he needs the path to find the Banished registry entrees.

Long, long time that i used Delphi so bear with me if i screwed up somewhere :)
If the name of the executable is known it is easy to get the path of the application.

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
   var AppDir: string;
begin
   AppDir := ExtractFileDir(Application.ExeName); <--- So Application.Application-steam-x64.exe
  // Do something with useful here with the path. for example Edit1.text := AppDir;
   ShowMessage(AppDir);  // <--- just show a message as test :)
   end;
end;

Of course this is useless pseudo code with a onclick event handler what is not needed by itself so JM has to do it all behind the scene at init stage as Mod Manager starts so the user not even know the path is taken and used.

Can always raise an exception if something goes wrong or the exe does not exist by putting the code above in an exception handler block.
Title: Re: Mod manager
Post by: Tom Sawyer on September 24, 2018, 03:31:20 PM
It can be started via Steam launcher or from file.. As I wrote in C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe
Title: Re: Mod manager
Post by: kid1293 on September 24, 2018, 03:40:40 PM
Just a small thought. Easy solution.
Why not put it in Banished directory and look only in current directory for Application (Steam or Vanilla)?
Are people so computer illiterate they can not follow a simple instruction?
Title: Re: Mod manager
Post by: JM on September 24, 2018, 04:24:02 PM
Originally I read and displayed only registry entries and I did not care about mod files, but the registry also contains a lot of entries of  mods I once tried and then deleted. This 0.0 version was not published.

Now I search for existing files in WinData and for each one I search for ModIndex and ModEnabled in the registry. If mod does not have these items in the registry because I just added it and did not play the game yet, I add the mod to the end of the list. That's why I need a WinData directory.

When path in ModMan.ini not found, because it is the first start, I look for the path to exe as follows:
I browse all the keys in 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall' and look for DisplayName REG_SZ 'Banished'. If found, I use the UninstallString value to get the path to the uninstall file. For me, it's 'D:\Games\Banished\unins000.exe'.
I have Application-x32.exe in the same directory **, so the mods are in 'D:\Games\Banished\WinData'. Then I look for 'data0.pkg', 'data1pkg', 'patch0.pkg' and 'patch1.pkg'. When I find all this ***, the path to the file is used as the starting directory when using the file dialog. If I do not find what I was looking for, the initial directory is the ModMan directory.

/** I do not know how it is in Steam installation. Is there a 'UninstallString' entry in the uninstall record in the registry? If so, is the target in the same directory as Applicationxxxx.exe and WinData? Is there anything at all in the registry that can be used to find path to WinData?

/*** Perhaps, at this point, I could recognize the path as valid and not force the user to confirm it.

Code: [Select]
function GetBanishedDirectory: string;
const
  UPath = 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
var
  R: TRegistry;
  SL: TStringList;
  i: integer;
  S,WS: string;
begin
  Result := '';
  R := TRegistry.Create;
  try
    R.RootKey := HKEY_LOCAL_MACHINE;
    if not R.OpenKey(UPath,False) then Exit;
    SL := TStringList.Create;
    try
      R.GetKeyNames(SL);
      for i := 0 to SL.Count-1 do begin
        R.CloseKey;
        if R.OpenKey(UPath+'\'+SL[i],False) then begin
          try S := R.ReadString('DisplayName') except S := ''; end;
          if SameText(S,'Banished') then begin
            try S := R.ReadString('UninstallString') except S := ''; end;
            if S = '' then Continue;
            if Copy(S,1,1) = '"' then Delete(S,1,1);
            if Copy(S,Length(S),1) = '"' then Delete(S,Length(S),1);
            S := ExtractFilePath(S);
            WS := S+'WinData';
            if not DirectoryExists(WS) then Continue;
            WS := WS + '\';
            if not FileExists(WS+'data0.pkg') then Continue;
            if not FileExists(WS+'data1.pkg') then Continue;
            if not FileExists(WS+'patch0.pkg') then Continue;
            if not FileExists(WS+'patch1.pkg') then Continue;
            Result := S;
            Break;
          end;
        end;
      end;
    finally
      SL.Free;
    end;
  finally
    R.Free;
  end;
end;

================

Change:

If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkg files, I'll take it.

Title: Re: Mod manager
Post by: Tom Sawyer on September 24, 2018, 04:46:15 PM
Change: If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkm files, I'll take it.

That's what I was talking about. It works now for my installation and I guess for all other Steam users as well. Just copy ModMan where ever you like and run it. :)

The only thing I noticed is that your searching the registry seems to takes some time. Maybe to try Steam folder first and only if it doesn't exist to search in registry. But that's really a tiny thing.
Title: Re: Mod manager
Post by: RedKetchup on September 24, 2018, 05:25:01 PM
If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkm files, I'll take it.

my game is install :'D:\Steam\SteamApps\common\Banished\Application-steam-x64.exe'

how you will find it ?

did you checked the REG_SZ there : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\
Title: Re: Mod manager
Post by: JM on September 24, 2018, 05:31:36 PM
Tom:
That's what I'm doing, first of all the Steam folder and then looking in the registry.
On my 10 year old computer - Core 2 duo, 2GB of memory, WinXP 32bit -  it takes almost no time.

RK:
Is there 'UninstallString'  item in 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\'?
Is yes, what's it's value? Is it 'D:\Steam\SteamApps\common\Banished\something.exe'?

Title: Re: Mod manager
Post by: RedKetchup on September 24, 2018, 05:49:58 PM
RK:
Is there 'UninstallString'  item in 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\'?
Is yes, what's it's value? Is it 'D:\Steam\SteamApps\common\Banished\something.exe'?

you will find a REG_SZ there named "InstallLocation" and the value inside this REG_SZ is the folder it has been installed : my value is "D:\Steam\steamapps\common\Banished"

then you add "\Bin\WinData\" to it and you've got the folder where are the mods.
Title: Re: Mod manager
Post by: Tom Sawyer on September 25, 2018, 01:54:36 AM
Mr. Red can set it manually, it's not a problem. ;D
Title: Re: Mod manager
Post by: RedKetchup on September 25, 2018, 03:20:09 AM
Mr. Red can set it manually, it's not a problem. ;D

but it is not a problem.... it is just for him if he wants to help the people who dont know how to do it... and make his program a perfect automated program :)
Title: Re: Mod manager
Post by: JM on September 25, 2018, 03:43:45 AM
When I examined the contents of the registry, I found that all the installations of all programs have UninstallString, but not all of them have InstallLocation. And I did not think the installation from Steam was different.
InstallLocation is also different. You would have to add "\Bin\WinData\", I just "WinData\" (without the initial backslash).

I can change it yet. I can take the InstallString and try to find WinData or Bin\WinData and remake the manual procedure to search the directory, for example via a directory tree.

Please help. Is there someone who bought the game directly from Luke's site? If so, does this installation have an InstallLocation entry in the uninstall info in the registry? If so, where is the target? How to get to WinData from there?

Search procedure: run regedit, open the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" key and look for "Banished" (search data, not keys or values) . It should find DisplayName REG_SZ Banished. In the same place, there should be InstallString REG_SZ "that's what I'm looking for".

Quote
.. make his program a perfect automated program ..
Yes. I will add automatic weekly updates that can not be turned off  :D
Title: Re: Mod manager
Post by: Hawk on September 25, 2018, 04:01:58 AM
When path in ModMan.ini not found, because it is the first start, I look for the path to exe as follows:
I browse all the keys in 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall' and look for DisplayName REG_SZ 'Banished'.

On my machine, it's not found there. It's found in 'HKEY_LOCAL_MACHINE\Software\Wow6432Mode\Microsoft\Windows\CurrentVersion\Uninstall' as well as where I mentioned in Post 21 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GOG.com\Games\1207660783'

I did a full registry search using Banished as the Find term with a check mark in the Data box only, plus the Match whole string only box. It is not in 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall'
Title: Re: Mod manager
Post by: Hawk on September 25, 2018, 04:25:25 AM
I tried ModMan 03 and it worked great.

I clicked on the desktop shortcut and got the first window below, as expected. Then on the second window below, even though the path was right, I first tried File Dialog to locate the Application-x64.exe, which immediately gave me the contents of the WinData folder.

Then I deleted the ModMan.ini file and the second time I dragged the desktop shortcut to the window and again got the WinData folder.

So it looks like ModMan is finding the location just fine.  ;D
Title: Re: Mod manager
Post by: RedKetchup on September 25, 2018, 04:48:00 AM
InstallLocation is also different. You would have to add "\Bin\WinData\", I just "WinData\" (without the initial backslash).

oh ya sorry ! so sorry there is no /bin/ it is just /WinData/
Title: Re: Mod manager
Post by: JM on September 28, 2018, 05:18:59 AM
Version 0.4

Added search for text in item names. I have been tired of looking for a mod that is definitely in the list, but I do not remember where I moved it.

Type anything in the main window and the items containing the text are highlighted.
BackSpace cancels the last typed character, Esc all the text.
Title: Re: Mod manager
Post by: kid1293 on September 28, 2018, 05:58:34 AM
Strange. I don't get the search box. Did you upload new version?
Title: Re: Mod manager
Post by: kid1293 on September 28, 2018, 06:22:49 AM
It works. It works fine, thank you.

No complaints, I'm happy. :)
Title: Re: Mod manager
Post by: JM on September 28, 2018, 06:31:59 AM
I apologize very much, the image shows version 0.3a, I saved it before I overwritten the version number in the program.  :-[

There is no CtrlF to activate the search. Once you start typing something in the main window, the box appears. After Esc or after deleting the last character the box disappears.
Title: Re: Mod manager
Post by: zak4862 on September 28, 2018, 06:35:25 AM
 How did you manage to work it out? I also dont have "search box".

Sorry! I see your post. Thanks.  :)
Title: Re: Mod manager
Post by: embx61 on September 28, 2018, 06:38:13 AM
Just start typing in the Interface and the search box appears
Title: Re: Mod manager
Post by: RedKetchup on September 28, 2018, 08:14:59 AM
Thanks you ALOT ! JM !!!
Title: Re: Mod manager
Post by: JM on September 28, 2018, 10:11:52 AM
I thought I'd add the ability to add my own comments on mods. Comments would be saved in ModNotes.ini or somewhere else.

I do not like to guess what a mod is from a short file name.
What is 'unlimited'?  :-\  (= unlimited vanilla mines and quarries)

For example, I would write 'this mod must be above XYZ and does not work with ABC'. As time goes by, I forget such details. Or to some modpack that contains a bakery I would write 'remember to disable standalone xxBakery.pkm'.

==================

But first of all I would like to get the original text from pkm, including the title, author and version.

Does the mod kit contain a description of the pkm file structure? Unfortunately, I can not run it, it does not work on WinXP. Gooooogle does not know anything about it.

I'm trying to get a description of the mod from its pkm, but the text in the file is garbled, maybe compressed.

For example, NewDebug.pkm:
In-game mod manager says 'This mod adds the Debug Utility window to your game'.
Inside the file is 'This mode adds the' #E0 #06 #3C #15 'to your game'.
Maybe it's a link to another location in the file. The 'Debug Utility' text already exists in the file, but I have not yet figured out how it works.
Title: Re: Mod manager
Post by: embx61 on September 28, 2018, 10:39:37 AM
I am afraid this will not be possible without knowing the structure of the PKM file and a program to extract those.
I think it is Luke's own compression/packing structure.

We modders use the Package.rsc file to set the Author, description, version, and stuff.

Code: [Select]
PackageFile EBStatueCristoRedentor
{
String _name = "EB Statue Cristo Redentor";
String _author = "embx61";
String _description = "The Statue of the Cristo Redentor give some spirit happiness with a radius of 100.";
String _icon = "icon.png";
int _userVersion = 17001;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}
Title: Re: Mod manager
Post by: Tom Sawyer on September 28, 2018, 11:37:56 AM
I had a similar thought but did not ask for it.. to try to read out some info from pkm files to show in ModMan (title, description, author and icon). But I think it's too difficult to get it from the compiled files without knowledge about the data structure. I loaded one in a hex editor and I doubt we can manage this. Would be easier to maintain a small database with icons and infos to use in this tool. At least for important mods.
Title: Re: Mod manager
Post by: RedKetchup on September 28, 2018, 11:59:36 AM
the thing is Luke use a custom data compressing utility. you would probably need to decrypt/uncompress first.
when i say "custom" not probably of his own but probably what he could find on internet / company he worked for / programmer teams he is member of.
Title: Re: Mod manager
Post by: JM on September 28, 2018, 03:24:55 PM
What does a Steam user see when downloading a mod? Does he know the file name? If so, it was best for everyone to describe it himself. When I get a mod from worldofbanished or from anywhere, usually there is a description. I suppose there is some description on Steam as well. So copy the description and paste it into ModMan, and finito. The length of the description may be unlimited. Well, let's say we'll limit it to 5000 characters or so.

==========================

It can be easy. I can add a window to edit these texts. Accompanying texts could be in ini file. Each mod can have its own ini file, or all mods can be together in one file. In the second case, I will add some function to merge a file from another user.

Then someone  :D can make a database of descriptions and publish it.

But copying a description database from another user is tricky.
How to maintain the integrity of descriptions? There are many versions of mods that have the same file name but different functionality. The old version is compatible with something, and the new one is not. You have a version for 1.0.6, my version is for 1.0.7.
Something like a central database would have similar disadvantages.

Code: [Select]
[NewDebug]
Title = New debug utility for 1.0.7
Author = RK
Description: This adds the Debug Utility window to your game

[logic]
Title = Smarter bannies
Author = Spock
Desription = This mode makes people less stupid. For example, vendors do not go across the map for one apple when they have a barn full of apples just around the corner.
Title: Re: Mod manager
Post by: RedKetchup on September 28, 2018, 04:16:59 PM
a steam user see nothing. he goes to the workshop and browse the mods. Then if he wants it he click subscribe and everything happends hidden.

there is a download progression bar at botton of the client and when complete it says 1/1 complete and you just have to launch the game enable your mod and play.

nobody knows there is an hard drive existing and nobody knows what is a file ^^
Title: Re: Mod manager
Post by: JM on September 28, 2018, 04:29:43 PM
Quote
nobody knows there is an hard drive existing and nobody knows what is a file
If so, then they can not use ModMan because they would have to download the zip file, save it to the disk, unpack it and make a shortcut on the desktop. So we do not have to pay attention to Steam users. :D
Title: Re: Mod manager
Post by: Tom Sawyer on September 28, 2018, 04:41:43 PM
Yes, different versions with same file name would make problems and not always consistent with a database. What about an info file and icon together with the actual mod included in the download zip. Like North.pkm, North.txt and North.png. ModMan could use it if existing or not if not. But would also only working for manual downloads, not for Steam subs. And maybe not worth to pursue this idea anyway.
Title: Re: Mod manager
Post by: RedKetchup on September 28, 2018, 04:42:12 PM
Quote
nobody knows there is an hard drive existing and nobody knows what is a file
If so, then they can not use ModMan because they would have to download the zip file, save it to the disk, unpack it and make a shortcut on the desktop. So we do not have to pay attention to Steam users. :D

the only attention you need to give is : where is installed the game and where is the WinData folder. being a steam user doesnt mean necessary we are a neanderthal ^^ and know what is a file.pkm ^^
Title: Re: Mod manager
Post by: JM on September 28, 2018, 05:45:58 PM
Neanderthal had a bigger brain than we have.  :)

Modman currently displays only filenames. So when I want to write a comment on the mod, I need to know the filename. How can I easily find it when installing from Steam? The image shows the file size, but not the file name. At least I do not see it.

First I try to extract the texts from the pkm file, despite the difficulty.

I will definitely add the mod comments. Now I have all the descriptions in one txt file, like 'X must be above Y', 'there is a mill, but not a bakery', 'needs glass and rooftiles'  and so on. I have to open a file, look for "little housing" or "littlehousing" or "little" or .. (damn, what is the name ...?). And that's pretty uncomfortable.


Title: Re: Mod manager
Post by: RedKetchup on September 28, 2018, 06:53:13 PM
yeah almost impossible. you would need to do your own database.
Title: Re: Mod manager
Post by: embx61 on September 29, 2018, 11:34:43 AM
JM, with all due respect I think what you are seeking will be a hell of a job to pull off.

I personally would not worry to much about adding automated database with descriptions, load order information, etc. to the Mod manager Program.
Adding a Dialog Form with some information text boxes linked to a mod will be enough IMHO if you still want to add some info about the mods.

So for example a Dialog form which can be opened by placing a little button next to all the mods in the interface linked to the mod name.
This Dialog form has just some Edit Boxes and a Text Boxes for Author, description and various information about this mod what players can fill in as they see it fit.

Maybe a button is not even needed if you can use the DoubleClickEvent of the mods seen in the interface to open the Dialog Form.

So for example:
Mod name(Will be the same as the PKM filename), version, Author, Description, and maybe some information about load order etc.

Let the players do the work instead of trying to automate it in some way.
Not all modders, me included, have all this information anyway and I not see modders adding text files with all kind of information about their mods to all their mods.

Honestly, I not think too many players will use this feature anyway.
Title: Re: Mod manager
Post by: Kristahfer on September 29, 2018, 11:57:27 AM
First I really greatly appreciate the work that @JM has been put into this utility and agree with @embx61 .

I have been using 'Create sorted list of Banished mods' release 6b by Gordon Dry for a very long time. Along with a makeshift database created in a spreadsheet program where the list was placed along with a description of the various mods to give a single location for looking at the mods as loaded and what each provided. It was useful albeit very time consuming and clumsy to use. As I began adding more mods to the game and using various configurations for playing it became even more difficult to use I replaced each included description with a link to the source location. Still very slow but it allowed me to follow the mod development and specified recommendations and conflicts the developer listed. Moving the mods around when changing configurations has been a hair loosing effort to do but accomplish-able with time.

This utility has reduced those efforts by almost 90%. When a new mod was added you still would be required to place it in the WinData file and start the game prior to being able to use the ModMan utility, but once done have to move it around was a breeze. The addition of being able to provide a description of each configuration immeasurable. While I feel that being able to put a description for each mod in the ModMan INI file would be an unbelievably powerful addition I am not sure that @JM should endeavor to build some sort of extraction tool to build an internal database for the user. Various mod versions, source locations and internal program coding would make that a daunting effort. Not being a programmer with the newer languages myself I can only see hours and hours of work to achieve a usable utility, which could possibility be a very sizable space and speed requirement, that would satisfy the multitude of users and their own ideas of what they wish to see.

I feel that providing a description area for each mod would be acceptable and give each user the ability to use that area for their own ends.

Once more I wish to thank @JM for this fine utility.
Title: Re: Mod manager
Post by: brads3 on October 02, 2018, 10:36:32 AM
small request: can we lock a group of files and move several at once? that would be helpful to keep EB or KID or RED's,etc mods as a group and lock them with the shift key.
Title: Re: Mod manager
Post by: rengafzzz on October 02, 2018, 01:54:25 PM
Hello! I would like to know where to find a mod that of the possibility of not comestible for salt, sugar and vegetable oil.
Title: Re: Mod manager
Post by: Kristahfer on October 02, 2018, 04:24:31 PM
small request: can we lock a group of files and move several at once? that would be helpful to keep EB or KID or RED's,etc mods as a group and lock them with the shift key.


Agreed, that would be very helpful.
Title: Re: Mod manager
Post by: RedKetchup on October 02, 2018, 05:01:53 PM
Hello! I would like to know where to find a mod that of the possibility of not comestible for salt, sugar and vegetable oil.
mostly Kralyerg have mave them all and his mods are there : http://blackliquidsoftware.com/ (http://blackliquidsoftware.com/)
Title: Re: Mod manager
Post by: JM on October 04, 2018, 08:02:44 AM
Version 0.5
========

Now you can select multiple items using the standard shift+click, ctr+click or shift+cursor keys actions. Click 'Check selection', 'Uncheck selection' or press spacebar to check/uncheck all selected items at once. It is also possible to drag them all together to another position.
Title: Re: Mod manager
Post by: brads3 on October 04, 2018, 08:14:50 AM
much appreciated.thank you. so much faster than loading the game. the manager is awesome.

quick question when mods are taken back out of the WinData folder,can the manager somehow remember and delete them from the registry? i noticed it the other day.i removed a mod and the save TXT file still had the mod listed but diasabled.i went into the registry and manually deleted the mod. this doesn't matter much but 2 things can happen.with mods still in the registry, the game tries to load them so will load slower. and a few mods do get stuck, where they load some files even when disabled. so a delete function from the registry would be helpful.
Title: Re: Mod manager
Post by: JM on October 04, 2018, 09:26:39 AM
Quote
save TXT file
What file? Did you mean INI file?

Quote
with mods still in the registry, the game tries to load them so will load slower
Their presence does not slow down the start of the game, because reading an entry from the registry, or checking existence of a file does not take time. When the file does not exist, the game ignores it's registry entries. What else could be done?

When reading a profile from a file or from a registry, I only read the entries of existing pkm files. If there are extra items in the registry, they do not matter and can stay there. When writing to a registry or saving to a file, I write only what is on the screen. To remove unnecessary items from a saved profile, load the profile and save it again. But even those items do not matter.

Quote
few mods do get stuck, where they load some files even when disabled
The game processes all existing files. At least to get a description of them, which he then displays in the manager.

Maybe I did not understand, I do not know English well and Google translate is my best friend.

Do you want to delete entries of non-existent files from the registry? I can do it, but it is useless.
I can delete entries of disabled (unchecked) mods, but the game will write them down again.
Title: Re: Mod manager
Post by: brads3 on October 04, 2018, 10:20:55 AM
yes ,the INI file. i agree with you on how the game should work. it doesn't always follow that.if you try many mods over say months without deleting the registry so when you do clear it deletes 20 or so unused mods,you do see a difference to the load time.like the computer takes time to go looking for them.1 or 2 mods,the time isn't enough to be noticed. i know it is debated, but there are commnets on other sites where mods get hung up and cause issues even when disabled.

      i understand that the game will reload the mod as long as it is still in the WinData folder. if we delete the mod completely from the registry and move it, the game won't.players will have to remember to physically remove the mod from the folder.i think it should be done separate of the disable function.not all disabled mods need to be deleted.

      does the mod manager rewrite the entire registry or just the mod entries? does it keep and write the start settings,climate,etc, or just lines for the mods? maybe the mods that did cause issues after they were removed,somehow wrote info into the start settings.that could be where they got stuck.
Title: Re: Mod manager
Post by: JM on October 04, 2018, 11:08:42 AM
ModMan is only interested in ModEnabled_ and ModIndex_ of existing pkm files, and does not change anything else. ModEnabled_ and ModIndex_ of non-existing files remain untouched.

I have about 120 mods in WinData, with about 200 entries in the registers. I tried deleting all ModIndex and ModEnabled entries from the registry, and the game started about as fast as before. I never got stuck at the start of the game.

Maybe ModMan could move disabled mods somewhere else, let's say WinData\DisabledMods\, then the game would not see them. Moving does not damage the file. At worst case, one would have to manually move these modes back to WinData.
But then it would not be possible to add a new mod to the old game. I do it often, although it should not be done. And when opening an old saved game there would not be necessary mod files.
Title: Re: Mod manager
Post by: Abandoned on October 04, 2018, 01:48:19 PM
This mod sound very interesting but I do not like the sound of it messing with the registry or move disabled mods out of WinData.  I have over 300 mods in WinData and pick and choose which mods I want enabled or disabled for each map. I only move WinData files when adding new ones or removing ones I no longer want.  I have never done anything to my registry and I have never had a problem.
Title: Re: Mod manager
Post by: rkelly17 on October 05, 2018, 11:00:44 AM
There are several ways to approach managing mods--and we each gravitate to the one that works best for us, hopefully. I have a folder called "Downloaded Mods" where I keep a copy of every version of every mod I have ever downloaded (call me a mod hoarder!) each in its own folder, because updated mod .pkm files often have the same name as older versions. Then, between games I copy the ones I want to use to windata and erase the ModEnabled_ and ModIndex_ keys from my Banished registry. This latter habit got started in the early days of modding when things were not always stable. I don't recommend it to those who are uncomfortable mucking around in the registry, and I always remind myself how little I know so I don't go doing dangerous stuff. I like the idea of the Mod Manager, but old habits die hard.
Title: Re: Mod manager
Post by: JM on October 09, 2018, 05:20:28 AM
Version 0.6
========

You can add your own description to individual mods. Double-clicking the item opens the editing window. The description is displayed when the mouse pointer moves over the item. You can turn it off by unchecking Show mod description. Descriptions are stored in ModDesc.ini.

I could not find out how to get descriptions from pkm files. The description in the picture was obtained by copying the text from the downloading thread.

I've been using it for a couple of days, and it seems useful to me. I have described almost all the mods I have. (But mostly in Czech, so it does not make sense to post it here)

Mod is a word taken from English into Czech. MOD is not translated from Czech into English as MODE. And the word "mod" has nothing to do with the word "móda" (="fashion"). The word "mod" in Czech is related to the word "modifikace" (="modification") . Remember it at last, Google.
Title: Re: Mod manager
Post by: Paeng on October 12, 2018, 11:06:42 AM
Great job!

Thanks to all you guys searching ways to improve the gaming experience!
Title: Re: Mod manager
Post by: BlueFireChelle on October 13, 2018, 03:22:18 AM
Just installed and used for the first time. Awesome work! Really handy :)  thanks so much.