Module Structure

From Data Realms Wiki

(Redirected from Module structure)
Jump to: navigation, search
Modding 101 The Basics
Start here.


Actors Actors
Anything that can be controlled.


Effects Effects
Explosions, glows, and emission.


Modding 107 Mod Creation
Learn how the pros create objects.


Devices Devices
Weapons and tools.


Scenes Scenes
How to create scenes.


Module Structure Module Structure
Setting up a module index.


Lua Lua
Scripting.


:Category:Modding Modding
All the modding pages.



Modules loaded in Cortex Command are simply directories in the Cortex Command directory with an .rte extension. On loading, the game will check for any modules in its home directory.

In order for the game to actually load your module, the folder must contain a file called index.ini This is pretty self-explanatory. It is an index for all files to be referenced in the module.

Within the index.ini file are a variety of properties and attributes--examples of which are given below:

DataModule
	Author = Me
	ModuleName = My Mod
	IconFile = ContentFile
		FilePath = Example.rte/Icon.bmp
	IncludeFile = Example.rte/Content1.ini
	IncludeFile = Example.rte/Example/Content2.ini

	//Comments are not read.

	/*
	Block comments are also ignored.
	*/

DataModule

  • This will always be the first line. The only purpose of this line is to inform the game's interpreter that the file being read is the index of a module. If this line is not included, the interpreter will throw an error: Could not find DataModule.

Author

  • This is a place for the creator to show who created the file. It has no bearing on the actual mod. It is an optional property.

ModuleName.

  • This property gives your mod a unique identifying name. It must be unique. Mods cannot share ModuleNames. This is an optional property.

IconFile.

  • This property gives your mod a uniqe banner, flag, or icon to identify it in the buy menu. The property is optional, but the attribute must be ContentFile if it is included.

FilePath

  • If you opt to create an IconFile, your next declaration will be FilePath. This is pretty straight forward. The FilePath is a parent of the IconFile. In English, it says where the image file resides in the module. The attribute of this property will always be YourMod.rte/folder/file.extension You must always include the name of the module (the .rte) that the file is contained in. This property is optional, but must be included if the IconFile property is declared.

IncludeFile

  • Finally, the meat of an index. These properties tell the interpreter where to locate other module files to include. Generally, mod contents are not contained in the index, but are organized into other .ini files for organizational purposes. If you opt to add module content to other documents, you must call IncludeFile to tell the game where to look. The attribute for this property is the file location within the module. Again, this must follow the YourMod.rte/folder/file.extension format.

The number of includes is essentially limitless. This allows you to organize your files as you see fit and increases the interpreter's flexibility. Many larger mods have separate includes for playable actors, crafts, weapons, devices, and scenes. The complexity of your project is a large factor in how you organize your includes.

Personal tools