Difference between revisions of "T4 Modules Howto Guide/Getting Started"

From Tales of Maj'Eyal
Jump to: navigation, search
(init.lua)
Line 6: Line 6:
  
  
<table>
+
<table class="wikitable">
 
     <tr>
 
     <tr>
 
         <th>Setting</th>
 
         <th>Setting</th>
Line 58: Line 58:
 
         <td>allow_userchat</td>
 
         <td>allow_userchat</td>
 
         <td>Registers 'space' as a key to talk, joins a channel named &quot;module&quot;, and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.</td>
 
         <td>Registers 'space' as a key to talk, joins a channel named &quot;module&quot;, and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.</td>
 +
    </tr>
 +
    <tr>
 +
        <td>background</td>
 +
        <td>A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds</td>
 
     </tr>
 
     </tr>
 
</table>
 
</table>
Line 67: Line 71:
  
  
<table>
+
<table class="wikitable">
 
     <tr>
 
     <tr>
 
         <th>Parameter</th>
 
         <th>Parameter</th>
Line 88: Line 92:
 
<p>To take advantage of this in windows, you need to right-click on t-engine.exe and select 'Create Shortcut'. On the created shortcut right-click again and select properties. In the dialog add the following to the Target field:</p>
 
<p>To take advantage of this in windows, you need to right-click on t-engine.exe and select 'Create Shortcut'. On the created shortcut right-click again and select properties. In the dialog add the following to the Target field:</p>
  
<p>.../t-engine.exe -MMyModule -udefault -n</p>
+
<code>.../t-engine.exe -MMyModule -udefault -n</code>
  
 
<p>Replacing MyModule with your module name and default with whichever character name you desire. Using this shortcut now will launch your module directly, saving you some time while prototyping.</p>
 
<p>Replacing MyModule with your module name and default with whichever character name you desire. Using this shortcut now will launch your module directly, saving you some time while prototyping.</p>
  
 
Go back to [[T4modules-module-howto-guides]]
 
Go back to [[T4modules-module-howto-guides]]

Revision as of 01:18, 1 June 2013

In order to start your own module, you need to create a new directory in the /game/modules/ directory, into which you copy the contents of either /game/modules/example/ or /game/modules/example_realtime/, which will give you bare-bones but working base to work off of.

init.lua

The first file you need to customize is the init.lua file. This file has a few things you need to edit to make this module your own:


Setting Effect
name This is the official name of the module as seen in module selection list.
long_name This is the long name of the module that appears is descriptions.
short_name This is a short name used internal to the module. Preferred to be lower case and should be the same as the folder name.
author Your name or pseudonym and email address.
homepage Optional homepage of the module.
version Module version. Does not automatically update. Change this between releases to differentiate them.
engine Expected engine version.
description A description of your module. Can be multiple lines and paragraphs.
starter Only change if you know what you are doing. And if you have to ask, you don't.
show_only_on_cheat If true, prevents this module from appearing in the mods list normally. This is enabled by default on the example module and should be disabled in your module.
no_get_name Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.
allow_userchat Registers 'space' as a key to talk, joins a channel named "module", and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.
background A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds


Launching your module using command line parameters

By now you should be able to start t-engine normally and see your module in the list when you select new game. However, when changing features then quickly wanting to see its effects, this process involves a lot of unneeded clicks and wasted time. For this reason t-engine.exe supports various command line parameters.


Parameter Effect
-M<Module> Auto-loads the specified module (using the module's short_name).
-u<name> Uses the specified name for the character.
-n Forces a new character, overwriting any old saves with the same name.

To take advantage of this in windows, you need to right-click on t-engine.exe and select 'Create Shortcut'. On the created shortcut right-click again and select properties. In the dialog add the following to the Target field:

.../t-engine.exe -MMyModule -udefault -n

Replacing MyModule with your module name and default with whichever character name you desire. Using this shortcut now will launch your module directly, saving you some time while prototyping.

Go back to T4modules-module-howto-guides