Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: pbgben on December 31, 2013, 05:02:32 AM

Title: [TOOL] RimCheat - Simple save hack (v.2.0.2)
Post by: pbgben on December 31, 2013, 05:02:32 AM
UPDATED

I've updated the app, many of its original features were broken so I've disabled them.

Features:
Clean Corpses (Buggy)
Clean Filth(Blood etc..)

Auto Updating
Future Features
Colonist> Skills
Colonist> Traits
Spawn> Items/Weapons/Colonists
Remove rebels
Change Money, Food, Metal
Heal Colonists
Weaken Rebels(Set's them to 0HP so the're one shot kill :D)



Bugs:
� Slag/Bricks aren't removed as filth (<CompressedThingMap> ToDo)

Video: http://www.youtube.com/watch?v=AC2_zWS-b7s

Download Link
Website (http://c38.co/RIMCheat/)
Virus Total Scan
Scan (https://www.virustotal.com/en/file/7dc4fc6e1af86bc99893167004cab12ff2fa9541041fe4b14af37d142eaa81aa/analysis/1388659293/)
Title: Re: [First Release] Simple Save Hack
Post by: ItchyFlea on December 31, 2013, 05:37:12 AM
I believe Rock Debris and Slag Debris are contained within the <CompressedThingMap> section of the save-file. They are not contained in the <Things> section.

Nice app. I look forward to seeing what else you add to it.  :)
Title: Re: [First Release] Simple Save Hack
Post by: Galileus on December 31, 2013, 05:52:22 AM
Quote from: ItchyFlea on December 31, 2013, 05:37:12 AM
I believe Rock Debris and Slag Debris are contained within the <CompressedThingMap> section of the save-file. They are not contained in the <Things> section.

Yep, that's exactly right. As of now, debris are not tagged as separate entries, and are considered part of scenery as far as save-files goes.
Title: Re: [First Release] Simple Save Hack
Post by: pbgben on December 31, 2013, 10:45:24 PM
Quote from: Galileus on December 31, 2013, 05:52:22 AM
Quote from: ItchyFlea on December 31, 2013, 05:37:12 AM
I believe Rock Debris and Slag Debris are contained within the <CompressedThingMap> section of the save-file. They are not contained in the <Things> section.

Yep, that's exactly right. As of now, debris are not tagged as separate entries, and are considered part of scenery as far as save-files goes.

Thanks for letting me know, its Base64 encoded so ill get onto that soon.
As for now, Iv just added a "Remove Raiders" feature :)

And Im going to use application deployment so I can push updates automatically :P
Title: Re: [Update V1.1] Simple Save Hack
Post by: Galileus on January 01, 2014, 05:34:20 AM
That might help:

Quote from: Tynan on November 14, 2013, 01:00:57 PM
This is the code that saves boolean grids into that compressed format. It uses Base64 to save characters after bit-packing the booleans several at a time into an array of bytes.


public static void ExposeBoolGrid( ref bool[,] grid, string label )
{
string fogBase64 = "";
int numBytes = (int)Math.Ceiling((Find.Map.Size.x * Find.Map.Size.z) / 6f );
byte[] fogBytes = new byte[ numBytes ];

if( Scribe.mode == LoadSaveMode.Saving )
{
//Pack the fog of war map into an array of bytes in base64
int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid[i,k] )
fogBytes[byteInd] |= bitInd;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}

}

fogBase64 = System.Convert.ToBase64String( fogBytes );

fogBase64 = AddLineBreaksTo(fogBase64);
}


Scribe.LookField( ref fogBase64, label);


if( Scribe.mode == LoadSaveMode.LoadingVars )
{
fogBase64.Replace("\n", "");

//Unpack the Base64 into the fog map

fogBytes = System.Convert.FromBase64String( fogBase64 );

int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid == null )
grid = new bool[Find.Map.Size.x, Find.Map.Size.z];

grid[i,k] = (fogBytes[ byteInd ] & bitInd) != 0;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}
}
}

}


Title: Re: [Update V1.1] Simple Save Hack
Post by: pbgben on January 02, 2014, 12:48:47 AM
Quote from: Galileus on January 01, 2014, 05:34:20 AM
That might help:

Quote from: Tynan on November 14, 2013, 01:00:57 PM
This is the code that saves boolean grids into that compressed format. It uses Base64 to save characters after bit-packing the booleans several at a time into an array of bytes.


public static void ExposeBoolGrid( ref bool[,] grid, string label )
{
string fogBase64 = "";
int numBytes = (int)Math.Ceiling((Find.Map.Size.x * Find.Map.Size.z) / 6f );
byte[] fogBytes = new byte[ numBytes ];

if( Scribe.mode == LoadSaveMode.Saving )
{
//Pack the fog of war map into an array of bytes in base64
int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid[i,k] )
fogBytes[byteInd] |= bitInd;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}

}

fogBase64 = System.Convert.ToBase64String( fogBytes );

fogBase64 = AddLineBreaksTo(fogBase64);
}


Scribe.LookField( ref fogBase64, label);


if( Scribe.mode == LoadSaveMode.LoadingVars )
{
fogBase64.Replace("\n", "");

//Unpack the Base64 into the fog map

fogBytes = System.Convert.FromBase64String( fogBase64 );

int byteInd = 0;
byte bitInd = 1;
for( int k=0; k< Find.Map.Size.z; k++)
{
for( int i=0; i< Find.Map.Size.x; i++)
{
if( grid == null )
grid = new bool[Find.Map.Size.x, Find.Map.Size.z];

grid[i,k] = (fogBytes[ byteInd ] & bitInd) != 0;

bitInd *= 2;
if( bitInd > 32 )
{
bitInd = 1;
byteInd++;
}
}
}
}

}



Its for the fog of war but Im sure it will help a little. Thanks :P
Title: Re: [Update V1.1] Simple Save Hack
Post by: Plasmatic on January 02, 2014, 04:55:24 AM
Another feature to implement in the future could be traits, for example changing colonists to have the "Tough" trait which means 150 hp instead of 100.

Outlined in:
http://ludeon.com/forums/index.php?topic=1401.0

And later on, Skills (enable/disable, level up etc) Outlined in: http://ludeon.com/forums/index.php?topic=1451.0

After that, maybe the weapon the colonist/raider is carrying? also found within the save file, Outlined in: http://ludeon.com/forums/index.php?topic=1092.135
Title: Re: [Update V1.1] Simple Save Hack
Post by: pbgben on January 02, 2014, 05:37:47 AM
Quote from: Plasmatic on January 02, 2014, 04:55:24 AM
Another feature to implement in the future could be traits, for example changing colonists to have the "Tough" trait which means 150 hp instead of 100.

Outlined in:
http://ludeon.com/forums/index.php?topic=1401.0

And later on, Skills (enable/disable, level up etc) Outlined in: http://ludeon.com/forums/index.php?topic=1451.0

After that, maybe the weapon the colonist/raider is carrying? also found within the save file, Outlined in: http://ludeon.com/forums/index.php?topic=1092.135

Wow, Awesome ideas! Ill add them to the list. Thanks!
Title: Re: [Update V1.1] Simple Save Hack
Post by: pbgben on January 02, 2014, 06:06:48 AM
Just created a simple download page, http://c-38.co.uk/RIMCheat/
What you think?
Title: Re: [Update V1.1] Simple Save Hack
Post by: Plasmatic on January 02, 2014, 07:18:38 AM
Quote from: pbgben on January 02, 2014, 06:06:48 AM
Just created a simple download page, http://c-38.co.uk/RIMCheat/
What you think?

Looks good, nice and clean, only you forgot to mention "Change Food"

It might be a better idea to just have one say "Change resources, or "Change Metal/Food/Money"

Another feature that you could add is to Incapacitate all the raiders at once, regardless of health.. Outlines here: http://ludeon.com/forums/index.php?topic=1498.0
Title: Re: [Update V1.1] Simple Save Hack
Post by: ItchyFlea on January 02, 2014, 07:27:51 PM
A feature request; disabling the Storyteller AI.

To do that you'd need to change this section:
<StoryState>
<LastThreatQueueTime>-1</LastThreatQueueTime>
<NumThreatsQueued>0</NumThreatsQueued>
<LastQueueTicks>
<KeyList />
<ValueList />
</LastQueueTicks>
</StoryState>


To this:
<StoryState IsNull="True" />

This effectively completely disables random events, such as raiders showing up. Unfortunately it also disables trader ships and travellers.

Also, bug reports.
• Leaves dfsvc.exe running in memory when installed, uninstalled or used.
• Does not remove the <AIKing> raider information when removing raiders. (Leaving this in does not cause any problems in-game.)
• Throws an unhandled exception when clicking on any button in the main window if a save is not opened on app start.

About the <AIKing> section.
You'll want to change it to this when raiders are removed:
<AIKingManager>
<KingList />
</AIKingManager>


Again, nice app. It's nice to be able to click a button rather than manually edit the save file.  :D

Also, would you like me to PM to you the tags for weapons? I would post it here but this post is long enough. :)
Title: Re: [Update V1.1] Simple Save Hack
Post by: pbgben on January 02, 2014, 10:33:18 PM
Quote from: ItchyFlea on January 02, 2014, 07:27:51 PM
A feature request; disabling the Storyteller AI.

To do that you'd need to change this section:
<StoryState>
<LastThreatQueueTime>-1</LastThreatQueueTime>
<NumThreatsQueued>0</NumThreatsQueued>
<LastQueueTicks>
<KeyList />
<ValueList />
</LastQueueTicks>
</StoryState>


To this:
<StoryState IsNull="True" />

This effectively completely disables random events, such as raiders showing up. Unfortunately it also disables trader ships and travellers.

Also, bug reports.
• Leaves dfsvc.exe running in memory when installed, uninstalled or used.
• Does not remove the <AIKing> raider information when removing raiders. (Leaving this in does not cause any problems in-game.)
• Throws an unhandled exception when clicking on any button in the main window if a save is not opened on app start.

About the <AIKing> section.
You'll want to change it to this when raiders are removed:
<AIKingManager>
<KingList />
</AIKingManager>


Again, nice app. It's nice to be able to click a button rather than manually edit the save file.  :D

Also, would you like me to PM to you the tags for weapons? I would post it here but this post is long enough. :)

Thanks for the suggestions and bug's, Ill get onto those asap! And I'd love the weapon list :P It will save me time later when I add the colonist customization system. 
Title: Re: [V2.0] Simple Save Hack
Post by: pbgben on January 03, 2014, 03:31:47 AM
Woop just updated! added a feature to modify individual colonists, More will be added to this editor soon.

Bug Fixes
Leaves dfsvc.exe running in memory when installed, uninstalled or used. > Its part of the Oneclick feature(Auto Updates)
Throws an unhandled exception when clicking on any button in the main window if a save is not opened on app start. > Re-designed the app, you must select a save now
Title: Re: [V2.0] Simple Save Hack
Post by: ItchyFlea on January 03, 2014, 07:50:51 AM
There's two bugs with the weapon part of the colonist editor:

• If the colonist does have a weapon, the tag <Pos> is left empty, causing the game to crash when it tries to load the save.
• If the colonist does not have a weapon, the tag <Primary IsNull="True" /> stays, preventing the game from seeing the added weapon.
Title: Re: [V2.0] Simple Save Hack
Post by: pbgben on January 03, 2014, 04:56:20 PM
Quote from: ItchyFlea on January 03, 2014, 07:50:51 AM
There's two bugs with the weapon part of the colonist editor:

• If the colonist does have a weapon, the tag <Pos> is left empty, causing the game to crash when it tries to load the save.
• If the colonist does not have a weapon, the tag <Primary IsNull="True" /> stays, preventing the game from seeing the added weapon.

Hmm, thats strange it worked when I first tested :/ Ill fix that asap
Title: Re: [V2.0] Simple Save Hack
Post by: pbgben on January 03, 2014, 05:33:51 PM
Ok I've fixed those bugs, sorry about that.  :(

Iv also added a simple backup that makes a copy of the save at the beginning of each load (If it corrupts then DONT OPEN THE CHEAT) Just remove the .bak from the end :P
Title: Re: [V2.0] Simple Save Hack
Post by: ItchyFlea on January 03, 2014, 08:26:05 PM
Quote from: pbgben on January 03, 2014, 05:33:51 PM
Ok I've fixed those bugs, sorry about that.  :(
No worries. I have strange hobbies, one of them is finding bugs in software.  :)

Speaking of bugs, I think it's safe to ignore the one about the <AIKing>. The game appears to take care of that itself.
Title: Re: [V2.0.2] Simple Save Hack
Post by: King on January 18, 2014, 10:53:34 PM
From what I've read this seems like a very good mod, but I have a problem
Whenever I start the application and try to choose a save file I'm not able to find my RimWorld folder through it but I am through my start menu, In case you need to know this is the directory to it
Computer>OS(C:)>Users>KingHighLander>AppData>LocalLow>Ludeon Studios>RimWorld
Also to get to the AppData junction from the start menu I have to search %appdata% then go back from the Roaming folder to get the LocalLow folder
Hope you can help  :)
Title: Re: [V2.0.2] Simple Save Hack
Post by: randommonicle on January 28, 2014, 11:58:19 AM
Hello there, thanks for the hack. I am having a few issues with it however, i can use it to remove bodies and filth, however when i try to do anything else i get the following message:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at RIMWorld_Cheet.Main.Button2_Click(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(MouseEventArgs 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.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)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
RIMWorld Cheet
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Ben's%20baby/AppData/Local/Apps/2.0/Z6DGM3CJ.MZ9/9ZQEH5T2.EAT/rimw..tion_4d19c5c83f4c4358_0002.0000_f7d153247ec54f95/RIMWorld%20Cheet.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 11.0.50938.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Title: Re: [TOOL] RimCheat - Simple save hack (v.2.0.2)
Post by: pbgben on May 01, 2014, 06:05:45 AM
I've just updated the code for removing filth and corpses.
I'll try to be more active on this and fix the rest and continue