Log in

View Full Version : [REL] SH4 wrapper/profile selector


Phrozin
04-11-15, 04:28 PM
Ok, so my father was having an issue with corrupt save game files, and also keeping his ships separate. So I wrote a small program to keep backups of save games and allow him to keep his ships in separate SH4 folders for convenience. Anyway, I figure someone might want to use it, so here ya go.

Installing:
http://postimg.org/image/lcogowrol/http://postimg.org/image/lcogowrol/The default directory that the installer chooses will be an "Open Directory" that your user account has full read/write/execute permissions to. If you choose to install elsewhere I can't promise that the UAC wont make you run in full administrator access mode.

Once it's finished installing, it will give you the option of launching immediately or to simply exit the installer. If you have not renamed your sh4 folder yet, then I would suggest unchecking the "Launch Silent Hunter 4 Wrapper" and just finish the installer. I've programmed my application to look for the save files in your documents folder. (IE: for windows XP and down "C:\Documents and Settings\[user name]\My Documents" or for windows Vista and up "C:\Users\[user name]\Documents") More specifically it looks for folders starting with "SH4-". So lets say your current ships name in game is USS Bonefish, you would rename your "sh4" folder to "SH4-USS Bonefish". (Mind your capitalization, my program will ignore lower case "sh4" folders).

once it's launched for the first time, the program will ask you to locate your "Silent Hunter 4" installation folder. This is where the file "sh4.exe" is.

It will then ask you to name this installation. You can name it anything you like, but I would suggest something descriptive like TMO if your installation is modded with the trigger maru mod. My program allows for multiple installations for those of you running different "mod soups". You will be able to set these different installations up once the base installation is setup. Once the installation path and name have been set, you are presented with the programs main interface.

On first launch you will notice all the windows are empty and there are 3 installations named "install 1" though "install3", the program hasn't populated everything yet and this is normal.

*Note: if you already had a save game and renamed it before launching, the windows will be populated with information, but it will still have those 3 installations.

Simply click on the setup button to open the settings interface and choose the options you wish to activate if any.

For those of you that run multiple installations for different "mod soups" if you checkmark the "Multiple Installations" checkbox, you are then presented with 2 additional boxes to set those up. The setup is just like the initial setup, so it shouldn't need explaining. Once an install is setup the button on the right will change from "Setup" to "Reset". This is so you can rename them if you need too, or if you move the installation folder. If you then uncheck "Multiple Installations" my application will "forget" those additional installs and you will have to re-set them up. It does not delete or uninstall your installed game or folders, it simply forgets they are there.

Once you've set your options and clicked "Set" you'll be back at the main screen. I suggest you exit the application to allow it to set the registry settings and paths, then reopen it. Now you just select the ship you wish to pilot today and the installation you are playing that ship on and click play. As you can see, the ships info and captains info have populated.
http://s26.postimg.org/tlvqpkw15/click_play.png

If in the unfortunate event that a game save gets corrupted for one reason or another, click on "Setup", checkmark "Restore Profile". The "New Profile" button will change to "Restore", clicking it will now open the archived savefiles interface. Simply select the one you want and click the "Restore Selected Archive" button.

for those wanting a new ship, click on the "Setup" button, then click the "New Profile" button. This will create a new save named "USS Fresh" select it and click play. Once you are assigned your ship in game, exit the game you will be asked to name the save directory. My Father chooses to name the saves after his ships IE: USS Trigger, but you can name them whatever you like.

I think that's everything. If you have questions or find a bug let me know and I'll do my best to answer or correct it. If you just want the source code instead of the installer let me know. if enough people want it I'll put it up here for download as I didn't want to inflate the installer with the source code and materials.

Also, the images on the backgrounds and in the installer, I've had on my hard drive for years and can't recall who made them. If you feel these are your images, let me know and I'll give you credit for them or remove them based on your desires.

UPDATES

Version 1.3.0.3

Version 1.3.0.3
-Uses UTC time now instead of local
-Archives saves to the "[app path]\archives" folder now
-Checks for a "sh4" folder in your documents on startup, if found asks to rename it or delete it.
-Archives "sh4" folder if found before deleting it.
-No longer needs admin rights (if installed to default location)
-Archive times reworked for more precision

Download Links
SHA1: ff2bae912bd4bb0848df81e68b4ec576974436ea
MD5: ec65d962e5308e4c8faef80018a605f6
Updated - 04/13/2015 TinyUpload (http://s000.tinyupload.com/index.php?file_id=11379690522705448070) 2.0 MB
Updated - 04/13/2015 MediaFire (http://www.mediafire.com/download/w21lrbcy11mbdr1/SH4.Wrapper.exe) 2.0MB
Updated - 04/13/2015 Dead Legion Toolz (http://deadlegiontoolz.weebly.com/sh4wrapper.html) 2.0MB

Jeff-Groves
04-11-15, 04:38 PM
Looks pretty slick!
:salute:

I've grabbed a copy and Thanks!!
:up:

ReallyDedPoet
04-11-15, 08:45 PM
Nice work!

fitzcarraldo
04-11-15, 10:52 PM
Looks interesting. I'll try it.

Many thanks!

Fitzcarraldo :salute:

james_nix
04-12-15, 12:52 AM
Looks great! But I get a message saying that it can't find my activeuserplayerunits.cfg

I can't even use the USS Fresh because it says the same thing. If I try to start USS Fresh it says See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: Cannot create a file when that file already exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalMove(String sourceDirName, String destDirName, Boolean checkHost)
at sh4.wrapper.MainForm.Button1Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Phrozin
04-12-15, 08:59 AM
Looks great! But I get a message saying that it can't find my activeuserplayerunits.cfg

I can't even use the USS Fresh because it says the same thing. If I try to start USS Fresh it says

Sounds like you have an "sh4" folder in your documents folder. Check there for one and if found rename it to"SH4-USS <whateverYoulike>" or just "sh4-old". As for the ActiveUserPlayerUnits.cfg, USS Fresh will not have one because you haven't made commission on a boat in game yet.

let me know if this fixes it. :)

Phrozin
04-13-15, 01:36 PM
:timeout: Sorry everyone, My father uses Windows XP, and I completely forgot about Windows Vista - Windows 8.1 User Account Control. I'll have a new version written and posted in a few hours that will work with the UAC on newer versions of Windows.

Thank you idlehands for the headsup! :up:

Phrozin
04-13-15, 10:20 PM
Looks pretty slick!
:salute:

I've grabbed a copy and Thanks!!
:up:

Thank you. Make sure you grab the latest version, and you are more then welcome :03:

Nice work!

Thank you, I appreciate the complement.

Looks interesting. I'll try it.

Many thanks!

Fitzcarraldo :salute:

Most welcome, make sure to get the latest version and let me know if somethings screwy or you'd like something else in it.


Looks great! But I get a message saying that it can't find my activeuserplayerunits.cfg

I can't even use the USS Fresh because it says the same thing. If I try to start USS Fresh it says

Thank you for the complement, and do try the new version. It should catch any sh4 folders for you and ask what do with them.