[Tool] SaveGame Tool v0.34

Discuss and distribute tools and methods for modding. Moderator - Grognak
Post Reply
Cryotech
Posts: 4
Joined: Mon Sep 17, 2012 8:51 pm

[Tool] SaveGame Tool v0.34

Post by Cryotech »

Ever get that super good start, where you hit all the right beacons, and wish you could save your game? Now you can. Well, it's easier to, anyway.

It's very simple, and it's goal isn't very honest; it allows you to easily backup and restore FTL 'continue game' saves.

This is an incredibly simple program written in notepad, and therefore runs via Windows' Command Prompt system, with the .Batch file extension. Basically, you need Windows to run it.

To operate it, make an FTL game. Use the 'Save + Quit' feature in game, and launch my program. Use the 'Backup' command, and you're done. Exit the program, and load up FTL. Play as much as you want. If you die, or just want to revert back to your save, reopen my program and use the 'Restore' command. Confirm the overwrite prompt, and you're set.

Please leave any and all constructive feedback below.

Possible features to be added:
- Backup and restore profile progress (ship unlocks, etc)
- More detailed documentation
- More organized infrastructure of code
- Multiple 'game saves' (Can have more than one backup)
- Easier to understand GUI


Download: https://www.dropbox.com/s/fnrqmqcfbd0jvwy/FTLDM0.34.rar


NOTE: I personally feel this program to be dishonest. I wouldn't call it "cheating", but dishonest nonetheless.
Do not use this program if you feel it will take part of the fun out of the game.
You could already do exactly what this program does, this program just makes it slightly simpler, faster, and more organized. Mainly, it was designed for testing purposes; to easier understand any game mechanic in question.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] SaveGame Tool v0.34

Post by Vhati »

Code: Select all

@ECHO OFF
SETLOCAL
REM ...

SET MAINDIR=%~dp0
SET DATADIR=savedGame

SET DOCSDIR=%USERPROFILE%\Documents
IF NOT EXIST "%DOCSDIR%" SET DOCSDIR=%USERPROFILE%\My Documents
IF NOT EXIST "%DOCSDIR%" goto findDocsError

GOTO :menu


:exit
CLS
ENDLOCAL & EXIT /B
I almost suggested "CALL :label" and "GOTO :EOF" for real subroutines, but that got unpleasant with prompts.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] SaveGame Tool v0.34

Post by Vhati »

Batch tip you may have no use for in this project...

You can do multiline IF statements, but if you set and check any variables within the IF block, you'll need "SETLOCAL ENABLEDELAYEDEXPANSION" at the top of the script and use !var! instead of %var% within the block.

Code: Select all

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET a=2
SET z=0

IF %a%==1 (
  ECHO a was 1
) ELSE IF %a%==2 (
  ECHO a was 2
  SET z=6
  ECHO z is !z!
  ECHO z was %z%
) ELSE (
  ECHO a was unexpected: %a%
)
Parentheses cause that whole IF chain to be evaluated as a single line, which bakes all %var% strings using whatever value var had initially. Hence the need for !var!, which instead gets substituted the moment it's actually used.

The same thing happens with parentheses in FOR loops.


Or for simpler cases, multiple commands can be crammed into an IF like so:
IF %a%==1 SET ok=1 & GOTO :blah
Post Reply