PurgeHousesIndustries

From TTWiki
Revision as of 11:25, 15 June 2011 by Pm-bot (talk | contribs) (Bot: Automated text replacement (--= +==))
Jump to navigationJump to search


Purge house and industry data

Removes unused house and industry data from the savegame

(Available since TTDPatch 2.6 r1358)

Usage

Cht: ))PurgeHouses[[]]PurgeHouses[[

Cht: ))PurgeIndustries[[]]PurgeIndustries[[

Description

When you use the newhouses or newindustries switches, TTDPatch remembers all house/industry types that have ever been enabled in your game, even if they're not available right now. This allows playing the game withouth loss of information even when the used GRFs aren't available for some reason. When the GRF is turned back on, everything can be restored correctly.

There are times, however, when you don't want this functionality. For example, when you decide to stop using a building set, the IDs will stay occupied nevertheless, and this may prevent you from enabling some other big building sets. That's the reason this cheat was implemented.

When you're using "Cht: PurgeHouses", you're saying "I don't need the house types that aren't available right now". Those houses will be permanently replaced by their substitute types, and their slots become available for re-use. Therefore, the intended way to use these cheats is:

  1. Open the GRF Settings window, and disable all house/industry GRFs that you don't want to ever use again. (It's important that everything you want to use must be enabled, since you will lose everything that isn't enabled.)
  2. Plant the "Cht: PurgeHouses" and/or "Cht: PurgeIndustries" sign cheat.
  3. (optional) Open the GRF Settings window again. Now you may be able to turn on the sets you couldn't earlier because there are more free slots available for them.

Purging industry types is a bit more complicated than purging house types. When you purge industry types, the new types that aren't currently available will be removed from the map, since they're unusable without their definitions anyway. When a set changed the behaviour of an old industry instead of adding a brand new one, though, the industry type in question will remain, and will revert to its old behaviour. That is, coal mines should stay, but potash mines should be removed. TTDPatch may make a mistake about what is a modification and what is a brand new type, though, so you might have to remove some of the industries manually. Additionally, some of the old industries may still work differently from the TTD default; if this happens, you can use Cht: ReloadIndustries to restore their default properties. (This will reset their production to the default, though.)

There is another tricky part. Industry sets can disable some of the default industry types without replacing them. When a set does that, TTDPatch can't decide what do you want when purging: do you want to re-enable those industries, or keep them disabled? The fate of these industries is decided the next time you apply GRF settings. (This happens whenever you load the game, or press Apply in the GRF Settings window.) If the disabling GRF is still enabled when that happens, the old types stay disabled; if, however, the disabling GRF is gone, the old types get available again.

Because of all the difficulties mentioned above, Cht: ))PurgeIndustries[[]]PurgeIndustries[[ is probably useful in the scenario editor only. It is possible to use it in a running game, but it can cause a great chaos in your company when some industries vanish and others start behaving differently. The damage is usually so great that you may as well start a new game from scratch.