RCTSGM -- RCT2 Save Game Modifier v1.12
Brought to you by Humble Programmer (humble_programmer@yahoo.com)    ,,,^..^,,,
(internal data structures generously provided by "ja227" of www.rct2.com)

Usage: rctsgm [flags] file.SV6
Flags
  /?   --help                Display this usage summary
  /c   --copyright           Display the copyright information

Dump Commands:
  /d   --dump                Dump all information
  /di  --dumpinfo            Dump game information
  /dm  --dumpmap             Dump all map information
  /do  --dumpobjects         Dump custom object information
  /dr  --dumprides           Dump ride information
  /ds  --dumpsprites         Dump sprite information

Make Commands:
  /mf  --makefree            Makes everything free (no cash required)
  /mm  --makemoney           Make park and ride fees modifiable
  /mt  --maketidy            Remove all trash/vomit and mow grass

Peep Commands:
  /pb  --peepsbuff           Make all peeps "buff"
  /pc  --peepscash=<value>   Give each peep <value> in cash
                             <value> must be between $0.00 and $500.00
                             defaults to $500.00 if <value> is omitted
  /pg  --peepsgone           Make all peeps disappear
  /ph  --peepshappy          Make all peeps happy
  /pr  --peepsrobbed         Take all peeps purchases away
  /ps  --peepsstarved        Make all peeps hungry & thirsty

Rides commands:
  /rf  --ridesfixed          Make all rides brand new
  /rn  --ridesnormal         Make all rides normal
  /rq  --ridesquiet          Make all rides stop playing music

Set Commands:
  /sc  --setcash=<value>     Set cash amount to <value>
                             <value> must be between $0.00 and $10,000,000.00
                             defaults to $10,000,000.00 if <value> is omitted
  /sd  --setdate=<dd-mm-yy>  Set the date to <dd-mm-yy>
                             <dd> must be between 1 and 31
                             <mm> must be between 3 and 10
                             <yy> must be between 1 and 99
                             defaults to 1-Mar-01 if <dd-mm-yy> is omitted
  /si  --setintrate=<value>  Set interest rate to <value>
                             <value> must be between 0 and 255
                             defaults to 0 if <value> is omitted
  /sl  --setloan=<value>     Set loan amount to <value>
                             <value> must be between $0.00 and $5,000,000.00
                             defaults to $0.00 if <value> is omitted
  /sm  --setmaxloan=<value>  Set maximum loan amount to <value>
                             <value> must be between $0.00 and $5,000,000.00
                             defaults to $5,000,000.00 if <value> is omitted
  /sr  --setrating=<value>   Set park rating to <value>
                             <value> must be between 0 and 999
                             defaults to 999 if <value> is omitted

Other commands:
  /e   --expand              Make an uncompressed copy of the input file
  /f   --fix                 Tries to fix invalid data and/or objects
  /q   --quiet               Quiet mode (no screen output)
  /v   --verbose             Maximum verbosity
  /w   --wait                Wait before exiting

===================
== General Flags ==
===================

--help (/?)

This flag is left as an exercise for the reader.

--copyright (/c)

Displays the copyright information and disclaimer for this application.

--expand (/e)

Creates an output file, but doesn't change any of the data (except for 
decompressing the data).  This flag is useful for creating a version of the 
input file that can be hacked using a standard hex editor.

--fix (/f)

Similar to --expand, but attempts to "fix" any invalid data found within the
.SV6 file.  Currently, the following checks are applied:
	.SV6 file signature is 0x00031144
	Ride/shop/stall "month built" must be between 1-Mar-01 and current date;
    Loan amount must be between 0 and maximum loan amount;
	Internal "financial CRCs" are recomputed;
	Overall file CRC is recomputed.

--quiet (/q)

Supresses all screen output, i.e., nothing is displayed on the screen.  Ever.
This flag is useful for running RCTSGM in "batch mode", and may even speed up
execution for very large files.

--verbose (/v)

Displays additional information about the input file and the internal workings
of RCTSGM.  This flag also automatically invokes the "--dump" flag described
below.  WARNING: this generates a LOT of information, which can be as much as 
a hundred pages or more of text for each input file!

===================
== DUMP commands ==
===================

--dump (/d)

Dumps all information extracted from the input file, including objects, rides,
sprites, and so on.  WARNING: this generates a LOT of information, which can 
be as much as a hundred pages or more of text for each input file!

--dumpinfo (/di)

Dump only the scenario level information, such as date, cash, loan, etc.  This
flag is not required if the --dump flag is specified.

--dumpobjects (/do)

Dump only the custom object information.  This flag is not required if the 
--dump flag is specified.

--dumprides (/dr)

Dump all available ride information; although every .SV6 file contains 255
rides, data reserved for rides that have not been built yet will be ignored.  
This flag is not required if the --dump flag is specified.

--dumpsprites (/ds)

Dump all available sprite information, which includes the staff, peeps, ride
vehicles, and trash/vomit.  Although every .SV6 file contains 10,000 sprites,
unused sprites are ignored.  This flag is not required if the --dump flag is 
specified.

===================
== MAKE commands ==
===================

--makefree (/mf)

Makes everything free, i.e., money is no longer earned, spent, or required.
The current park entry fee and all of the ride prices will be set to free as
well.  Hides the "money" tab for the park and all rides.

--makemoney (/mm)

Makes park entrance fees modifiable, and allows advertising.  Note that this 
doesn't actually change the entrance fee of the park, just makes it possible
to change it.  Note that this will cause rides to become fixed at "free".

--maketidy (/mt)

Removes all trash, litter, and vomit from paths and empties all trash cans.  
Mows the grass on all owned land.

===================
== PEEP commands ==
===================

--peepsbuff (/pb)

Makes all peeps extremely nausea tolerant and sets their nausea level to none.
Also sets their preferred ride intensity to the maximum allowed value.

--peepscash=<cash> (/pc)

Gives every peep a set amount of cash, or no cash at all if set to zero.  The
<cash> value should be in whole units only, i.e., any fractional "cents" will 
be ignored.  If you omit the <dollars> value, every peep is given the maximum 
allowed amount of cash.

--peepsgone (/pg)

Makes all the peeps disappear.  WARNING: this may trigger the "Stalled Rides"
bug described below.

--peepshappy (/ph)

Makes all peeps extremely happy and full of energy; also sets the nausea, 
and bathroom urgency levels to "none".  The hunger and thirst levels are also 
set to "none", unless the --peepsstarved flag is specified (see below).

--peepsrobbed (/pr)

Takes all peeps' purchases away, i.e., leaves them empty-handed.  Note that
this flag does NOT reset the historical information about how much each peep 
has spent on stuff.

--peepsstarved (/ps)

Makes all peeps extremely hungry and thirsty, even if the --peepshappy flag is 
used.

===================
== RIDE Commands ==
===================

--ridesfixed (/rf)

Makes all rides "brand new", i.e., it sets the month built to the current 
month, sets the reliability to 100%, and resets the internal breakdown timer.
This also will clear a "crashed" or "broken down" status if necessary.

--ridesplain (/rp)

Makes all rides "plain", i.e., clear all "Six Flags" and "indestructible"
settings.

--ridesquiet (/rq)

Turns off the music--and resets the music selection--for all rides.

==================
== SET Commands ==
==================

--setcash=<cash> (/sc)

Sets the current amount of money to <cash>; this value should be in whole 
units only, i.e., any "cents" will be ignored.  If the <cash> parameter is
omitted, then the cash is set to the maximum allowed value. 

--setdate=<dd-mm-yy> (/sd)

Sets the current park date to <dd-mm-yy>, which must be a valid calendar date
between 1-Mar-01 and 31-Oct-99, ignoring leap years.  If the park date is
changed, all rides and shops/stalls that were built AFTER the new date will be
modified so that they were built in the current month.  Note that using this
flag does NOT reset or modify any of the historical data or messages.

--setintrate=<percent> (/si)

Sets the current interest rate to the integer <percent>.  Setting this value
zero makes the loan "interest free", and appears to work as expected.  You
can also set the interest rate to as high as 250%, but why would you?

--setloan=<cash> (/sl)

Sets the current amount of the outstanding loan to <cash>; this value should be 
in whole units only, i.e., any "cents" will be ignored.  If the <cash> 
parameter is omitted, then the loan is set to zero (repaid in full).  The loan
cannot be set higher than the maximum loan amount.

--setmaxloan=<cash> (/sm)

Sets the maximum allowed loan amount to <cash>; this value should be in whole 
units only, i.e., any "cents" will be ignored.  If the <cash> parameter is 
omitted, then the maximum allowed loan amount is set to the highest allowed 
value ($5,000,000).  If the current loan exceeds the maximum allowed loan 
amount, it will be set to the maximum allowed value.

--setrating=<value> (/sr)

Sets the current park rating to <value>.  This change is only temporary, 
however, as the park rating is constantly recalculated as the game runs.

==============
== Examples ==
==============

rctsgm
Displays the command line help listed above.

rctsgm --dump "My Park.SV6"
Dumps all the internal data structures from "My Park.SV6" to rctsgm.log (and
to the screen).

rctsgm --setcash=100000 --setloan "His Park.SV6"
Makes a copy of "His Park.SV6" named "New His Park.SV6" with the cash set to 
$100,000 and the loan set to zero.

rctsgm --peepsrobbed --peepsstarved --peepscash=250 "Her Park.SV6"
Makes a copy of "Her Park.SV6" named "New Her Park.SV6" with all items bought
by the peeps taken away, all the peeps hungry and thirsty, and each peep has 
$250 in cash.  (Try this combination and watch your income from shops and 
stalls skyrocket!)

================
== Known Bugs ==
================

BUG:  Stalled Rides

Peeps stand in line for an open ride, but the ride never starts and continues
to display message like "Unloading passengers [at station]" for some or all of 
the vehicles.  This happens if the "--peepsgone" flag is used to remove peeps 
that were on a ride.  The ride is stalled waiting for non-existent peeps to 
get off the ride.  FIX: Close the ride and either repair it or set the number 
of cars/vehicles, then re-open the ride.  You don't have to actually change 
anything, just cause the ride to be reset.  A better fix is to close all the 
rides and wait for them to empty of riders before using the "--peepsgone" flag.

==============
== Mini-FAQ ==
==============

Q:	When I clicked on the icon nothing happened; what's wrong?

A:	Nothing is wrong.  This is an old-fashioned type of program called a 
"console application", which were very popular before the invention of the 
mouse.  To use RCTSGM, you will have to run it from a Command Window, also 
known as an "MS-DOS Prompt".  If you have never used a console application 
before, find a linux user (or any computer literate person over the age of 30)
and ask for help...

Q:	Console programs are a pain: why isn't there a GUI?

A: Because (1) that way the code is simpler and easier for other people to 
understand, and (2) because I don't have the time to write a GUI.  RCTSGM 
was written in less than a week--mostly during my lunch hour--and was never 
intended to be user friendly.  Hopefully someone with more spare time will 
take the source code and use it to build a "point & click" interface.

Q:	I ran RCTSGM, but it didn't make any changes to my park?

A:	RCTSGM never (repeat...NEVER) changes the original .SV6 file; in fact, it
is opened in "Read Only" mode, so RCTSGM can't change it, even by accident!  A
copy of the original file is created--with "New " stuck on the front--and all
changes are made to that file.  For example, if your original park is named
"Jungle Island.SV6", then RCTSGM will create "New Jungle Island.SV6" in the 
same folder.  Of course, if you don't make any changes to the original file,
then the new file isn't created.

Q:	Why is the new file created by RCTSGM so big?

A:	RCT2 uses a custom compression technique to make the data files smaller.
Since writing the code to compress data is usually much more complicated than
writing the decompressor, RCTSGM writes out the modified .SV6 file as plain
(uncompressed) data.  So far, RCT2 has read these uncompressed .SV6 files 
without any problems, and will even shrink the file back down once you save it 
from within the game.  As a side benefit, leaving the .SV6 file uncompressed 
also allows you to use a traditional hex editor on it for even more hacking
fun.

Q:	I found a bug...can you fix it?

A:	Yes, but only if you can describe the problem well enough for me to re-
create it.  At the very least, I'll need the .SV6 file and command line flags 
that caused the error.  You don't need to go into great detail about your 
computer, but knowing which version of Windows you're using would help. 

Q:	Can you add a (insert wish here) feature to RCTSGM?

A:	Sure...as soon as someone figures out how to do it.  This version of 
RCTSGM is intended to prove that such a utility is possible, and really only
includes the most basic functionality, i.e., the stuff that I wanted for my
own use.  Adding new features isn't very difficult, but does require that I 
know where in the .SV6 file the data resides and what format it's in.  Most 
of the information actually came from "ja227" of www.rct2.com and from the 
"RCT Technical Information Depot" (www.strategyplanet.com/rctuk/tid/).  
Without the hard work of these people, RCTSGM would never have been possible.  

Q:	Is RCTSGM shareware?

A:	No...it's freeware.  In fact, not only is RCTSGM free, but it's also 
"open source", which means you can have the C/C++ source code, too.  RCTSGM 
contains no proprietary or commercial code, but be sure to read copyright.h!

Q:	So RCTSGM is really free?

A:	Yup.  Besides, any money I could make from selling RCTSGM wouldn't even 
begin to cover the legal expenses of being sued by Infogrames for the rather
blatant copyright infringement(s).

Q:	Who are you?

A:	I am a professional developer and manage a small group of programmers that
are part of a larger corporate project.  I am an American, and have been alive
for at least 40 years, a C/C++ programmer for 25 years, happily married for 
nearly 15 years, a father for over 10 years, and been living in Europe for 
almost 5 years.

Cheers!
	Humble Programmer
	humble_programmer@yahoo.com
	,,,^..^,,,
