[TOOL] (Alpha 6) Save Editor v0.9.6.7 - Updated 8/22

Started by Neurotoxin, August 11, 2014, 09:54:08 PM

Previous topic - Next topic

Do you use the update checker?

Yes
44 (60.3%)
No
15 (20.5%)
I tick it to check then untick it - I prefer manual update checks
14 (19.2%)

Total Members Voted: 73

Neurotoxin





Cross Compatibility:
As I'm not using any OS specific code, and I'm targeting the 4.0 Mono Framework this program should be cross compatible with Linux and Mac. I've personally tested on linux.
What you need to make it work:
First, you need the Mono Runtime (MRE)
Some distros of linux come with it installed, to find out, open a terminal and type "mono" without quotes. If it's a valid command you already have it.
Once you take care of getting mono/determining if you already have it open a terminal and enter "mono path/to/RimWorldSaveEditor.exe" without the quotes (or add quotes to the path if it contains spaces). Viola!

Todo:
TODO

Changelog:
v0.9.6.6
Bugfixing 0.9.6.5
NRE fix when manipulating traits
Fixed traits not populating in lists until a colonist is selected
Minor code cleanup
Fix for mods that modify pawn class or KindDef, should probably not have any more issues detecting pawns
Built against Mono framework to (hopefully) address some cross-compatibility issues
Merged a pull request adding a splash screen (still a bit of a WiP, need to fade/default select tab on save load)
Removed "Change Rimworld Dir" button as it no longer has a use.
Valid thoughts, Traits and Backstories now loaded on form load rather than on save load.
A few other minor fixes that I can't remember but I know are there, problem with rushing a release while going out the door.

v0.9.6.5
Pre-release of trait editor. This MAY still have unforseen bugs so keep that backup button checked
No longer requires rimworld Directory, all necessary files have been re-parsed and inline at compile time.
Since this is a pre-release I will not be incrementing the version checker.
Older changes can be located at:
Changelog

Download:
Newest version will be attached to this post and available on Github.
https://github.com/LtStingray/RimworldSaveEditor/releases

Source:
https://github.com/LtStingray/RimworldSaveEditor

License:
This program is licensed under the MIT license
Full license:http://opensource.org/licenses/MIT
TLDR version: https://tldrlegal.com/license/mit-license

About the update checker:
This program makes NO connections to the internet without you choosing to do so. When it does, it connects only to a text file with a string representing the current publicly available version number. The only connection it will make is to the following url http://pastebin.com/raw.php?i=3LvpsTWB

Below is the relevant code so you don't have to dig through the source on github:

string releaseThreadUrl = "http://ludeon.com/forums/index.php?topic=5346.0";
string versionCheckUrl = "http://pastebin.com/raw.php?i=3LvpsTWB";

        public void CheckUpdate()
        {
            using (var WebClient = new WebClient())
            {
                string updateVersion = WebClient.DownloadString(versionCheckUrl);
                updateChecked = true;
               
                if (CompareVersions(updateVersion) == 1)
                {
                    if (MessageBox.Show("New version available, Goto release thread?", "Open Thread?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start(releaseThreadUrl);
                        Application.Exit();
                        Environment.Exit(0);
                    }
                    else { return; }
                }
                else { return; }
            }
        }

        public int CompareVersions(string stringFromNet)
        {
            string[] asmStyleParse = stringFromNet.Split('.');
            string[] currentVerParse = currentVersion.Split('.');

            for(int i = 0; i < asmStyleParse.Count(); i++)
            {
                if (Convert.ToInt32(asmStyleParse[i]) > Convert.ToInt32(currentVerParse[i]))
                {
                    return 1;
                }
            }
            return 0;
        }

I included the CompareVersions method because a call is made to it. I'm including this section about the update checker for the security conscious users. If the checkbox for checking updates is not ticked, no outside connections will be made. The update checker is disabled by default, I only included it for you, the user's, convenience.

I've seen update checkers on mods/external tools for games get a lot of backlash specifically for not being forthcoming with details on it's operation, use and, implementation and/or for being opt-out rather than opt-in thus why I see fit for this block of text. If you have ANY privacy/security concerns I'll be more than happy to address them. This software is licensed under the MIT license so you ARE allowed to decompile it and see for yourself (If I'm wrong about that, I hereby grant you permission to decompile the binaries distributed with this software).

If you wish to avoid the update all-together I have left the old version (0.9.3.0 for A6 and 0.9.1.1 for A5) available to download.

Thank you everyone for your bug reports, many of the issues are things I didn't forsee or in general errors on my part. I appreciate everyone's help and your support to stick with me during these initial phases. This project started as, "I want to edit these skills but, I hate parsing XML manually, Maybe I can write software to do it" and evolved into what it is today. If it wasn't for you guys It never would have expanded beyond what it started as. Keep those bug reports rolling in (or, well, I hope you don't have to, but if you hit one, point it out). Trust me, I'm a nice guy and I won't bite your head off for posting a stacktrace. All comments, suggestions and reports are appreciated and considered. There's on thing I request, and it probably won't be seen by as many as I'd like because I'm not bulleting it, When you post a bug report/stacktrace/unwanted behavior please to make it easier on both of us, post what version you're using and the save you're having issues with or be prepared to do soo on request. Don't worry, I don't care about your colony name, or the female raider you have hostage and keep naked (for whatever reason), I don't even look, I'm only looking for the relevant sections to this software.

NOTICE:
v0.9.6.7 is a pre-release. The trait editor SEEMS to be working as desired but I have a feeling I missed something.
I need testers for it, if you have ANY errors using the trait editor please be verbose with your reports and attach/upload the save you were working on as well as the stack trace (either in text or a screenshot). As always, be sure to make backups, once manually (for saftey) and allow the application to make it's own, THIS IS FOR YOUR SAVE'S SAFETY!. Also, being a pre-release, this has not yet been merged into the Master branch on Github, for v0.9.6.7 source see the InDev branch



[attachment deleted by admin: too old]

Mikey3131

Seems to work alright, though I received an error when selecting one of my colonists to edit:

System.NullReferenceException: Object reference not set to an instance of an object.
   at RimWorldSaveEditor.Form1.colonistListBox_SelectedIndexChanged(Object sender, EventArgs e)
   at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ListBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ListBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

If you'd like, I can try to recreate it and send you the full report it gave.

Neurotoxin

#2
Quote from: Mikey3131 on August 12, 2014, 06:16:02 PM
Seems to work alright, though I received an error when selecting one of my colonists to edit:

System.NullReferenceException: Object reference not set to an instance of an object.
   at RimWorldSaveEditor.Form1.colonistListBox_SelectedIndexChanged(Object sender, EventArgs e)
   at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ListBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ListBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

If you'd like, I can try to recreate it and send you the full report it gave.


That's not necessary, I think I know exactly what the problem is and will have it fixed with the next version. Colonists that have 0 for a skill don't have the node in the save, so with the way I initially assign nodes, if a node is 0 it'll throw an Null exception. I actually just realized this as I was firing up visual studio to work on it. I'll have a fix up by this time tomorrow and hopefully a feature update along with it. Thanks for the report though.




Quick Edit: Fixed NRE bug and uploaded a quick hotfix after getting frustrated at github for failing several commits -.-. Anyway I figured I'd rush out the NRE fix before I bothered getting to work on the next feature.

daggertx

Thanks for this, and hopefully the Alpha 6 update does not interfere to much.

Neurotoxin

#4
I don't think it should be a problem unless the node structure for pawn skills has changed. I won't be able to update until after midnight, almost over my monthly bandwidth limit, but I'll check everything out then. Let me know if there's any issues and I'll make a note.


EDIT: Update OP with Alpha 6 release.


EDIT 2: Preview of next feature:


It's still not QUITE ready for public consumption. I need to refine it a bit and figure out EXACTLY how I'm going to implement the Add thought function. It's close though and I have a few ideas to try out for it.

Neurotoxin

Updated again, Allows removing thoughts - may have unintended side-effects specifically if you remove trait related thoughts, I haven't tested that.

Thoughts are listed as <thoughtName>:<Age>, will remove the age at a later date. They're stored in a Key,value pairing and each Key (the name you see) has to be unique and colonists can have multiples of the same thought.

Added an opt-in update checker, see op where I address security/privacy concerns.

buriring

not working, dunno why.



[attachment deleted by admin: too old]

Neurotoxin

Quote from: buriring on August 15, 2014, 07:26:03 AM
not working, dunno why.

Did you load a save? Did the application itself not load the save you selected? Does it work with other saves? It looks like the controls are unlocked so I assume it loaded the save or something seriously glitched out. If it's having a problem with a specific save could you attach it or upload and send me a link to see what could be causing it?

buriring

Did you load a save? yes
Did the application itself not load the save you selected? affirmative
Does it work with other saves? no not only 0.6 but also 0.5d

and here's the save file(0.6alpha)

sorry for my poor english.




[attachment deleted by admin: too old]

daggertx


DorgoDorato

Any hope for a Linux or Mac version of this shoozbah?

Iwillbenicetou

Yeah, a mac version would be nice, especcially for me, because when I get bored... I start cheating and bad stuff happens.
Mod Help! The basics on how to download mods!

Neurotoxin

#12
For you multiplatform user hopefuls:
Sure I'll take a look into rebuilding against the Mono library for you, depending on the difficulty that presents I'll either attempt to release an OS agnostic release or work on porting this to Java. I'll get to it as soon as possible but I can't guarantee it will be quick. Check back in a few days or "Notify" this thread for updates.

Edit concerning the above: Looking into what I can find with 5 whole minutes of googling, It seems the transition shouldn't be too hard, I'll most need to fix the file path seperators in harcoded path strings, and rebuild in a *nix environment. Finally have a purpose for my dual boot haha.

@buriring I'll take a look at your save and see what I can figure out. If that doesn't help I'll add some logging to the program with the next release (specifically in the save loading methods) so maybe we can track this down.

A couple more questions, what OS are you on?
Do you have the .net framework up to at least 3.5 installed (I assume you do otherwise the program probably wouldn't even start)?


Ninja edit:
So I think I figure it out, the program checks the pawn's faction to make sure they're a colonist and not a raider or a squirrel. It seems that your save translates "Colonist" to the language you're playing the game on, in this case 정착지 (which I believe is korean?)

Luckily there's another field I can use to check for colonists, actually I should probably be using that field, So I'll work up a fix and get it out ASAP.

Edit 2:
Update out, tested against buriring's save and working as well as my own saves. Now with non-english save file support.

user27

any chance you could get the editor to work with the colonist traits?
it takes forever to randomly get a grower who also has a will of iron

Neurotoxin

Quote from: user27 on August 15, 2014, 09:55:32 PM
any chance you could get the editor to work with the colonist traits?
it takes forever to randomly get a grower who also has a will of iron

Yep, that's on the roadmap, it'll be either the next release or the one after that. I've been trying to push at least one feature per day but as the code gets longer it takes longer. I'll probably put off the health editor for final release before 1.0 because that's going to be the most involved but before I get to the next feature I need to hammer down the thought editor which is already half-implemented.

I plan to polish up the thought editor tonight as well as get my mono development set-up done to eventually push out a cross-platform release. If I've got time after all that I'll start in on the trait editor, maybe even get a workable prototype done.