Mod Mod Tutorial

From Wolfire Games Wiki
Revision as of 23:22, 9 April 2012 by Aaorris (talk | contribs) (Created page with "<!--PRIVATE // Only displayed on this page, not transcluded on pages that use this template--> <noinclude> <!--Categories--> Category: Modding <!--Constants--> <!--Content-->...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



PUBLIC This page gives a detailed overview of installing, using, and creating mods for AAorris' Mod mod.

Overview of the mod mod?

Installing

Download the mod mod from my page at: [| My forum thread] and replace the necissary scripts, as well as putting the mods folder in Data/Custom/.

Using

The mods will all be deactivated by default, unless hard-coded otherwise. Press M in game and use the mod panel to activate them as you choose. To change the default settings for a mod, go to the mod_level.as file, and set active=false; to active=true;.

creating mods

Creating mods using the existing code is not hard at all. It helps to set up a good workspace for changing scripts. My setup looks a little like this.

The mod is split into the character, level, and UI components. The character component changes the game and does all the heavy lifting, the level code supplies information on the mod, like its description, author, instructions, and if it is activated or not. The UI component is written in html and is in the Data/UI/mods folder. It gives the user buttons and such to change the mod parameters.

player code

The player code is written as a class. Its structure is that of a C++ class:

class ClassName {
  int variable;
  ClassName() {
    variable = 1;
  }
};
ClassName classname = ClassName();

The last line creates a global instance of the class for the rest of the script to interact with.

level code

Similarly, the level code is written in a class. It also creates an info class as one of its variables to track information common to all mods.

UI markup

The markup...

Updating mod mod files

Sorry, I'll continue this later!