Alpha version of save editor is complete!

Post Reply
User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Alpha version of save editor is complete!

Post by Aganazer » Fri Nov 27, 2009 5:49 pm

I've been working on a save editor that I wrote in C#. Its mostly for editing Ben and the survivors. It doesn't do anything that you couldn't do in notepad, but its faster and more convenient.

I'd like to make one thing clear about why I made the save editor and what my intentions are for the save editor. I didn't make the editor so that I could max out a character and trivialize the gameplay although it could certainly be used for that. I made it so that experienced players could play the role of additional characters or to explore the game more fully in a 'free form' style of play.

My ultimate goal, and the reason I created this, is so that I can make a set of thematic characters to play on additional game scenarios. While the character creator in the game is flexible, it doesn't allow the player to edit the player name, model, or starting inventory. Hopefully people can use this to enhance the gameplay instead of bypassing it.

It is written in .NET and I'll gladly release any source code if anyone wants it or if I stop working on it. I used the free C# express release so the compiler is free for anyone.

I recommend that any saves that are edited with this tool are first backed up somewhere. This is not designed to be a robust piece of software.

If anyone at Kerberos thinks I should keep this to myself and not release it, then I'll comply with no issues.

Some screenshots attached that show what its capable of.

FortZombieSaveEditor.png

FortZombieHumanEditor.png
Last edited by Aganazer on Sat Nov 28, 2009 1:22 am, edited 1 time in total.

User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Re: Save editor is almost complete

Post by Aganazer » Sat Nov 28, 2009 1:16 am

Attached is the save editor.

I've only found one bug and that is when you paste the same inventory onto multiple characters. Even swapping out all the Guids still produced an error when I loaded the save file. You can still copy and paste a whole inventory between saves as long as you only paste it to one survivor.

If you find any problems let me know and I'll try to fix it.

Fort Zombie Save Editor.zip


Also, here is a text file that contains all the character models. The next version of the save editor will have it integrated into a listbox. For now it needs to be copy/pasted.

models.txt

Roji
Posts: 6
Joined: Sun Nov 29, 2009 3:36 am

Re: Alpha version of save editor is complete!

Post by Roji » Sun Nov 29, 2009 5:44 am

This is Awesome. I love you lol

shadowwalker
Posts: 18
Joined: Sun Nov 08, 2009 9:44 pm

Ah

Post by shadowwalker » Tue Dec 01, 2009 3:42 am

Mate A+ just one thing can i add guns that i dont have to the players inventory?

User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Re: Ah

Post by Aganazer » Tue Dec 01, 2009 3:19 pm

shadowwalker wrote:Mate A+ just one thing can i add guns that i dont have to the players inventory?


I took the easy way out and only allow copying of items from existing save files. I didn't want to mess with making sure all the X and Y coordinates of the items don't overlap in your inventory. You still need to find at least one gun of a specific type, then save, then you can start copying it around to other save files.

The program uses an inventory clipboard. Here is a step by step about how you could use it to copy a character's inventory from one save to another.

1. In the game, open the save that you want to load up on loot. Empty the character's inventory. You'll be overwriting their inventory later so you don't want to destroy anything they might already have on them. Then save the game. Make a note of the save name.

2. In the game, open an old save file that has a lot of good loot you may want to copy. Put all the loot you want on your characters. Save the game. I like to rename the save to something that I will remember like "Lots of Loot.sav". You can only rename the save from the computer file system. You could skip the renaming part if you want, but remember the name (date stamp) of the save file.

At this point you have one save file with a character that has lots of loot, and another save file with a character with no loot. Now we will copy the inventory of the one with lots of loot to the one with no loot.

3. Start the Save Editor.

4. Open the "Lots of Loot.sav" file.

5. 'Edit' the character with a loaded inventory.

6. 'Copy' their inventory to the clipboard.

7. 'Cancel' out of the edit character screen. It will keep the inventory clipboard.

8. 'Open' the save file with no loot.

9. 'Edit' the character you want to receive the loot.

10. 'Paste' the clipboard loot to the character.

11. Press 'OK' to accept the change.

12. 'Save' the file.

13. Start Fort Zombie and load the save game. You character will now have the loot that you copied to them.

There is one rule to follow that if broken, could corrupt the save file. Don't paste the same inventory onto multiple characters in the same save file. Each item has a unique identifier (Guid) that will cause the program to choke if there is more than one that has the same number.

You can, however, copy it to one character, load the save in the game, put their inventory into the Fort inventory, save the game, then open it in the editor again and paste the same clipboard inventory onto the same character. I think it regenerates the Guids when you save the game. So you can still give yourself multiple copies of some rare weapon if that is what you want.

User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Re: Alpha version of save editor is complete!

Post by Aganazer » Tue Dec 01, 2009 3:43 pm

I've got some plans for the next revision.

1. Put all the models from that models.txt into a drop down list. That will make changing the character model a bit easier. Ideally, you could choose from a list of screenshots, but that will have to wait for a later version.

2. I need to add the scale factor to the player model. This will let you adjust your character's height. I had a blast making a child with a baseball bat turn into a giant. It looked hilarious!

3. I'll add some logic that will enforce that rule about pasting only one inventory. I'll simply disable the paste button after it has been used one time per file. That should catch most accidents.

4. I may adjust the stats and skill values to be sliders. That could force the values to remain in a reasonable 1-60 range.

I'll wait till after the next patch before I make any changes just to make sure its compatible with the new version.

If I continue to play FZ then I'll eventually make a character creator program that is designed for ease of use rather than utility like the save editor. It will let you choose your character model and show a screenshot of what you are selecting. In addition to that it will allow you to enter your own name, age, sex, etc with more flexibility in the starting stats, skills, and inventory. Unfortunately, it will probably bypass the 'clear out your base' mission and instead start you in your fort.

shadowwalker
Posts: 18
Joined: Sun Nov 08, 2009 9:44 pm

Mods

Post by shadowwalker » Tue Dec 01, 2009 5:03 pm

Well i would like to say if you need any help ill be happy to get the word out for ya.
great mod by a great modder. I have some mates that are A+ at modding scrips so ill get some info from them then i will see what i can do.

P.S if that don't work i will be sure to make sure your mods are heard of and talked about all over the form and other modding communitys.

:thumbsup:

XELA NAMYT
Posts: 278
Joined: Fri Aug 03, 2007 1:02 pm

Re: Alpha version of save editor is complete!

Post by XELA NAMYT » Mon Dec 14, 2009 9:23 pm

Good job!

I was in the process of writing an editor too, but then the patch came out and fixed a load of the stuff I was working on so I kinda left it!

A couple of things I noticed while rooting through your code that I was curious about:
1. Why do you use the evil goto commands?! Everytime someone uses one a puppy dies, did you know that?!
2. Any reason you didn't use LinQ over the XML?
3. Interesting use of 'continue', never used it myself, I might have too look into the uses of that.

Anyway, if you want any help, please let me know.

And most importantly, keep up the good work!

User avatar
Profound_Darkness
Posts: 3700
Joined: Wed Nov 29, 2006 12:46 am

Re: Alpha version of save editor is complete!

Post by Profound_Darkness » Tue Dec 15, 2009 2:38 am

Continue can be quite handy. Especially if you have several more conditionals following some work you just did and KNOW that the work you just did is all the work needed in the current pass. Generally speaking conditionals assume entry into the block following and so you can speed things up a bit. It also lets you write something like a select block on variables that are inconsistent with a select statement.

I became familiar with continue from a friend who's instructor insisted the loops and program structure had 1 and only 1 exit pathway (ie - no break commands and 1 and only 1 exit/end type command in the entire program).

As for the GOTO - there are still a few languages and situations where that is useful if not necessary. Also some of the higher level languages still use it in more intermediate (interpreted) code... Even if you didn't use it. I don't know that much about .NET anymore though so...
Mecron wrote:... "Hey aliens!! Candygram from the planet of crazy talking monkeys!!" ...

my fav tactical w/fav races :)

User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Re: Alpha version of save editor is complete!

Post by Aganazer » Tue Dec 15, 2009 3:18 pm

XELA NAMYT wrote:Good job!

I was in the process of writing an editor too, but then the patch came out and fixed a load of the stuff I was working on so I kinda left it!

A couple of things I noticed while rooting through your code that I was curious about:
1. Why do you use the evil goto commands?! Everytime someone uses one a puppy dies, did you know that?!


I don't deliberately use goto or continue. I hate them both. If you saw those then they were in auto-generated code. Possibly under the hood in a 'foreach'?

XELA NAMYT wrote:2. Any reason you didn't use LinQ over the XML?


LinQ is great for reading the data, but not so much for modifying and saving it. If you noticed, the read and the write methods are nearly identical. Since I had to write it the long way to modify and save the XML, then I just copied the format for reading with minimal changes.

I was also trying to keep it in .NET Framework 2.0 and not 3.5. If I remember correctly that is one of the things Fort Zombie requires to run.

XELA NAMYT wrote:3. Interesting use of 'continue', never used it myself, I might have too look into the uses of that.


Again, it must be in some auto-generated code since I don't use it, at least not deliberately.

XELA NAMYT wrote:Anyway, if you want any help, please let me know.

And most importantly, keep up the good work!


Thanks! I'll zip up the project and attach it to the next version. When I first put this together I thought we were just a few days from the next patch. The delay is good for me since I am now getting a real itch to start playing again... and SMG's... :thumbsup: :D

VampLena
Posts: 58
Joined: Wed Sep 23, 2009 3:59 pm

Re: Alpha version of save editor is complete!

Post by VampLena » Tue Dec 22, 2009 4:29 am

Thanks for this! I had about given up given up with how difficult and time consuming the game is (I dont blame Kerberos, i just dont think im their target audience) but now i can just 'casualize' the game for myself and enjoy it!

User avatar
Gazz
Posts: 16
Joined: Thu Nov 12, 2009 5:41 pm

Re: Alpha version of save editor is complete!

Post by Gazz » Tue Dec 22, 2009 3:18 pm

Feature suggestion:

A button to turn back the clock to this day's morning.

It's easy enough to do manually, the saves being plain UTF-8/XML and all, but would be a neat feature.
And STAY down!

User avatar
Aganazer
Posts: 38
Joined: Fri Nov 13, 2009 9:37 pm

Re: Alpha version of save editor is complete!

Post by Aganazer » Tue Dec 22, 2009 3:37 pm

Gazz wrote:Feature suggestion:

A button to turn back the clock to this day's morning.

It's easy enough to do manually, the saves being plain UTF-8/XML and all, but would be a neat feature.


That sounds easy enough. I'll try to get that into the next version. Which should be shortly after Impulse gets their version updated and I get to try out 1.04! :)

User avatar
Nspace
Kerbicron Cleric
Kerbicron Cleric
Posts: 4666
Joined: Thu Dec 29, 2005 7:26 pm

Re: Alpha version of save editor is complete!

Post by Nspace » Wed Dec 23, 2009 11:52 pm

I'd like to see the source code for this. I'm still learning C# and I'd love to be able to see how you do things. I imagine that it's possible to disassemble it myself, as XELA NAMYT seems to have done, but as I said I'm still a n00b when it comes to bending C# to my will. :)
"Quando omni flunkus, mortati" - "When all else fails, play dead"
SotS 1 wiki: http://wiki.swordofthestars.com/sots1/Main_Page
SotS 2 wiki: http://wiki.swordofthestars.com/sots2/SotS2_Codex

SIB
Posts: 44
Joined: Mon Dec 28, 2009 6:55 am

Re: Alpha version of save editor is complete!

Post by SIB » Wed Dec 30, 2009 10:48 am

Cmon Aganazar come on with the character creation program alreadys

Post Reply

Return to “FZ Modding”

Who is online

Users browsing this forum: No registered users and 2 guests