Modding support for Megaton Rainfall

Hey modders, here you will find instructions to create your own modifications, missions or levels for Megaton Rainfall. It will be simple and straight to the point.

We have integrated Lua scripting support in the engine so that you can completely change the behaviour of the game, and reuse lots of libraries and documentation in the web. You can turn the game into a 3rd person camera, a racing game, or anything you can imagine (but you'll need scripting skills to achieve that).

The main advantage over other games is that you'll get fully destructible massive cities from the start.

Getting started

The installation folder of the game is usually "%programfiles(x86)%\Steam\SteamApps\common\Megaton Rainfall" (Steam) or "%programfiles(x86)%\GOG Galaxy\Games\Megaton Rainfall" (GOG).

Download the samples SampleEmpty, SampleEffects, SampleEnemies and SampleTeapots, and place them in the Assets folder inside the installation folder.

Launch the game. You'll see a new option User content in the main menu. You'll be able to run any of the samples from there.

As you can see, a mod is a Assets\*.fcm file, which is a standard zip file with scripts, mesh data, animations, and whatever is needed.

The "official" content of the game can also be found in standard Assets\*.fcm files.

You can also unzip the contents of the mod in the installation folder (not the Assets folder), so that you can develop and test your mod without having to zip it each time.

When the game needs any file (for example, the texture Textures\, it looks for it first in the installation folder, then in any of the Assets\*.fcm files (prioritizing the ones that are not standard). That allows you to create a mod that replaces the contents of the game with your own, without touching the standard .fcm files.

This can be done to replace any file of the game including (undocumented) scripts. For example, You can replace Data\scene_universe.txt changing the planets of the solar system.

To create a level/mission that will appear in the User content menu, you have to add a *\*.lua file with the following content (SampleEmpty basically does this).


ModName = {}

function ModName:Init()

-- code that will be executed at the beginning


function ModName:Update()

-- code that will be executed each logical frame (60 times per second).


To allow fast development of mods, you can set the game to windowed mode by opening %userprofile%\documents\MegatonRainfall\config.txt and changing video_windowed no to video_windowed yes.

Then, launch the game, enter your user content, and press F5 key to reload all the scripts and restart the mod. In this way you don't need to relaunch the game to test any change. Errors will appear on the screen. You can try this with the samples.

About the samples

Don't forget to read the (short and simple) Lua code of the samples:

File formats

Besides the *\*.lua files for scripting, the engine supports:

Script reference

Here you can find the (scarce) documentation of all the functions available from the Lua scripts.

Future improvements

Do you have suggestions for more features that should be scriptable?

Do you think your script should work and it doesn't?

Don't hessitate to send your feedback to

If you think your script/mod should work and it doesn't, please send us a link to it and explain the problem (steps to reproduce the problem) so that we can investigate it.

If our community likes our modding support, we think about including the following features: