Skip to content
Branch: master
Find file History

README.md

The ModCreatorKit adds a bunch of cheats and utilities that are useful to modders.

Dev Cheats

  • devContext
  • devAnimLog
  • devRaid
  • devSpace
  • devBadge
  • devMission
  • devAri
  • devBake
  • devRTT
  • devApp
  • devEffects
  • devEffect
  • devTerraform
  • devViewMgr
  • devStarMgr
  • devGtn

Most of these cheats were unused leftovers in the Spore code, so they are not added as conventional cheats; instead, we forcefully add a cheat stored at a certain address in code.

There are two exceptions:

  • devContext: Just switches the game mode to whatever the player says. Very simple implementation using the GameModeManager.
  • devAnimLog: When enabled, the ID of all animations loaded will be printed to the console. To do this, we've had to detour the function that loads .animation files.

File Debugging

Another feature of this mod is file debugging: the ability of changing certain mod files without having to repack the mod. We've done this by detouring the function that opens a file from a .package file: if that package has a certain "debugging information" (basically file paths) that SporeModderFX has packed, instead of opening the file in the .package we will find the file in the disk.

Effects Editor

This mod also adds a new game mode and a cheat to access it, effectsEditor. This can be used with SMFX to test and edit effects in real time, check the tutorial.

This editor relies on the "file debugging" feature exposed before. We also detour the SwarmManager that checks what EffectDirectory must be used for a certian effect. When the effect ID is _effect_editor, we force a reload of the main.effdir file that is generated by SporeModder FX when using the effects editor there.

The effects editor mode itself is very simple. It just loads its own camera (which is a copy of the editor camera) and loads the _effect_editor effect. In the Update method, every second, checks if main.effdir was modified and reloads the effect if necessary.

Part Thumbnail Capture

This mod also includes a cheat tht lets you create thumbnails for your custom parts that fit perfectly into the part preview. To do that it uses the ThumbnailCaptureScript class, which is many things at a time: a cheat, a renderable, an UI listener, and a message listener.

When the cheat is executed, it navigates the Palettes hierarchy to add an UI listener (itself) to all palette items. It also adds itself as a renderable in the render layer 40, which is after everything has already been rendered. The message listener is used to detect when the editor is exited, to remove all the UI listeners.

The UI listener just detects when the mouse enters a palette item, which is when the part preview will start displaying. It just stores in the class which palette item is about to be previewed.

The renderable Render function doesn't render anything; it just waits until the UI listener has detected a previewed item, and that item has loaded its model. Then it clears the entire screen (during the capture frame, the screen will go black) to remove any background. It renders the palette item model and uses the model viewer VIEWPORT properties to know at which screen coordinates it has been rendered. It then saves that fragment into a .png, having captured the first frame of the model preview animation.

You can’t perform that action at this time.