Difference between revisions of "T4 Modules Howto Guide/Getting Started"
(→init.lua) |
m (typo: 'is to in' under long_name description) |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
<p>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.</p> | <p>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.</p> | ||
+ | <p>Good existing modules to copy are Gatecrashers (contains shaders) and Hulk (tiles) - they are only slightly bigger than the example modules, but clear and readable.</p> | ||
==init.lua== | ==init.lua== | ||
Line 17: | Line 18: | ||
<tr> | <tr> | ||
<td>long_name</td> | <td>long_name</td> | ||
− | <td>This is the long name of the module that appears | + | <td>This is the long name of the module that appears in descriptions.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 54: | Line 55: | ||
<td>no_get_name</td> | <td>no_get_name</td> | ||
<td>Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.</td> | <td>Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>no_funfacts</td> | ||
+ | <td>Set to true. This stops ToME4 gameplay stats from appearing on the loading screen.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>loading_wait_ticks</td> | ||
+ | <td>The affects the full speed of the loading bar. Set to around 30 for a small game, or tweak to get a speed that feels right to you.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 60: | Line 69: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>background_name</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> | + | <td>A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds. The game will load a logo file for each background at data/gfx/background/background_name.png if it is there</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 78: | Line 87: | ||
<tr> | <tr> | ||
<td>-M<Module></td> | <td>-M<Module></td> | ||
− | <td>Auto-loads the specified module (using the module's short_name).</td> | + | <td>Auto-loads the specified module '''(using the module's short_name)'''.</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 96: | Line 105: | ||
<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 [[ | + | Go back to [[T4 Modules Howto Guide]]. |
+ | |||
+ | {{Module Guides}} |
Latest revision as of 15:11, 5 December 2018
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.
Good existing modules to copy are Gatecrashers (contains shaders) and Hulk (tiles) - they are only slightly bigger than the example modules, but clear and readable.
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 in 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. |
no_funfacts | Set to true. This stops ToME4 gameplay stats from appearing on the loading screen. |
loading_wait_ticks | The affects the full speed of the loading bar. Set to around 30 for a small game, or tweak to get a speed that feels right to you. |
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_name | A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds. The game will load a logo file for each background at data/gfx/background/background_name.png if it is there |
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 T4 Modules Howto Guide.