[TOOL] RimCheat - Simple save hack (v.2.0.2)

Started by pbgben, December 31, 2013, 05:02:32 AM

Previous topic - Next topic

pbgben

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
Virus Total Scan
Scan

ItchyFlea

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.  :)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Galileus

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.

pbgben

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

Galileus

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++;
}
}
}
}

}



pbgben

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

Plasmatic

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

pbgben

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!

pbgben


Plasmatic

#9
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

ItchyFlea

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. :)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

pbgben

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. 

pbgben

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

ItchyFlea

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.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

pbgben

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