<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://te4.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BDota</id>
		<title>Tales of Maj'Eyal - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://te4.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BDota"/>
		<link rel="alternate" type="text/html" href="https://te4.org/wiki/Special:Contributions/BDota"/>
		<updated>2026-04-09T18:36:39Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://te4.org/w/index.php?title=Doomelf&amp;diff=13244</id>
		<title>Doomelf</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Doomelf&amp;diff=13244"/>
				<updated>2017-03-22T03:05:28Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{race&lt;br /&gt;
|name=Doomelf&lt;br /&gt;
|metarace=[[Elf]]&lt;br /&gt;
|locked=[[Unlockables#Races|Yes]]&lt;br /&gt;
|life_per_level=9&lt;br /&gt;
|exp_penalty=+25%&lt;br /&gt;
|strength=-2&lt;br /&gt;
|dexterity=+1&lt;br /&gt;
|constitution=+1&lt;br /&gt;
|magic=+3&lt;br /&gt;
|willpower=+2&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The Doomelves were added in the [[Ashes of Urh'Rok]] expansion.&lt;br /&gt;
&lt;br /&gt;
Doomelves are not a real race, they are Shaloren that have been taken by demons and transformed into harbingers of doom. They enjoy unleashing torments and suffering on their victims. They possess the Haste of the Doomed talent which allows them to phase away once in a while.&lt;br /&gt;
&lt;br /&gt;
== Unlock ==&lt;br /&gt;
*  Kill [[Walrog]], [[Kryl-Feijan]], and [[Shasshhiy'Kaish]] with one character.&lt;br /&gt;
** Walrog can randomly spawn in dungeons with water and can be forced to spawn by killing both the dragon and naga bosses in the Eastern water dungeon.&lt;br /&gt;
** Kryl-Feijan can be found by entering the [[Dark Crypt]](World map event, 24+) and letting Melinda be sacrificed.&lt;br /&gt;
** Shasshhiy'Kaish is summoned through a random event. This event has cultists standing next to monoliths, and killing one will start the countdown to her arrival.  This event can be found in [[Daikara]], [[Mark of the Spellblaze]], [[Elven Ruins]], [[Reknor]], and the [[Infinite Dungeon]] and has on average a ~72% chance to be found on a run (ignoring ID).&lt;br /&gt;
* This unlock is tied to an achievement and thus cannot be obtained on [[Difficulty|Easier mode]].&lt;br /&gt;
&lt;br /&gt;
==Inscriptions==&lt;br /&gt;
*[[inscriptions|Rune: Shielding]] (Absorb 100, Duration 5, Cooldown 14)&lt;br /&gt;
*[[inscriptions|Rune: Heat Beam]] (40 Damage, Range 8, Cooldown 18)&lt;br /&gt;
*No third rune -- Likely bug&lt;br /&gt;
&lt;br /&gt;
==Starting Location==&lt;br /&gt;
[[Searing Halls]]&lt;br /&gt;
&lt;br /&gt;
== Racial Talents ==&lt;br /&gt;
{{:Doomelf_(category)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{races}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Doomelf&amp;diff=13243</id>
		<title>Doomelf</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Doomelf&amp;diff=13243"/>
				<updated>2017-03-22T03:04:55Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Added unlock information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{race&lt;br /&gt;
|name=Doomelf&lt;br /&gt;
|metarace=[[Elf]]&lt;br /&gt;
|locked=[[Unlockables#Races|Yes]]&lt;br /&gt;
|life_per_level=9&lt;br /&gt;
|exp_penalty=+25%&lt;br /&gt;
|strength=-2&lt;br /&gt;
|dexterity=+1&lt;br /&gt;
|constitution=+1&lt;br /&gt;
|magic=+3&lt;br /&gt;
|willpower=+2&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The Doomelves were added in the [[Ashes of Urh'Rok]] expansion.&lt;br /&gt;
&lt;br /&gt;
Doomelves are not a real race, they are Shaloren that have been taken by demons and transformed into harbingers of doom. They enjoy unleashing torments and suffering on their victims. They possess the Haste of the Doomed talent which allows them to phase away once in a while.&lt;br /&gt;
&lt;br /&gt;
== Unlock ==&lt;br /&gt;
**  Kill [[Walrog]], [[Kryl-Feijan]], and [[Shasshhiy'Kaish]] with one character.&lt;br /&gt;
*** Walrog can randomly spawn in dungeons with water and can be forced to spawn by killing both the dragon and naga bosses in the Eastern water dungeon.&lt;br /&gt;
*** Kryl-Feijan can be found by entering the [[Dark Crypt]](World map event, 24+) and letting Melinda be sacrificed.&lt;br /&gt;
*** Shasshhiy'Kaish is summoned through a random event. This event has cultists standing next to monoliths, and killing one will start the countdown to her arrival.  This event can be found in [[Daikara]], [[Mark of the Spellblaze]], [[Elven Ruins]], [[Reknor]], and the [[Infinite Dungeon]] and has on average a ~72% chance to be found on a run (ignoring ID).&lt;br /&gt;
** This unlock is tied to an achievement and thus cannot be obtained on [[Difficulty|Easier mode]].&lt;br /&gt;
&lt;br /&gt;
==Inscriptions==&lt;br /&gt;
*[[inscriptions|Rune: Shielding]] (Absorb 100, Duration 5, Cooldown 14)&lt;br /&gt;
*[[inscriptions|Rune: Heat Beam]] (40 Damage, Range 8, Cooldown 18)&lt;br /&gt;
*No third rune -- Likely bug&lt;br /&gt;
&lt;br /&gt;
==Starting Location==&lt;br /&gt;
[[Searing Halls]]&lt;br /&gt;
&lt;br /&gt;
== Racial Talents ==&lt;br /&gt;
{{:Doomelf_(category)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{races}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=God&amp;diff=6912</id>
		<title>God</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=God&amp;diff=6912"/>
				<updated>2014-06-11T02:41:55Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gods were powerful beings. Nearly all were killed by the Sher'Tul in the Godhunt, but some escaped. Gods are local phenomena, each world has their own gods, or possibly none at all.&lt;br /&gt;
&lt;br /&gt;
==List of Gods==&lt;br /&gt;
* Amakthel&lt;br /&gt;
* Gerlyk &lt;br /&gt;
* Quekorja&lt;br /&gt;
* Ralkur&lt;br /&gt;
* Ugg'matho&lt;br /&gt;
* Xadoch&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Modules&amp;diff=6394</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Modules&amp;diff=6394"/>
				<updated>2013-12-20T20:17:51Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Discuss modules released for [[T-Engine 4]], as well as their development, here.&lt;br /&gt;
&lt;br /&gt;
Looking to write your own module? [[T4 Modules Howto Guide|check out the documents here for some help.]]&lt;br /&gt;
&lt;br /&gt;
A list of some modules in developement &lt;br /&gt;
* [[Bone Builder]]  &lt;br /&gt;
* [[Broken Bottle]]&lt;br /&gt;
* [[Gatecrashers]]&lt;br /&gt;
* [[Iron and Steam]]&lt;br /&gt;
* [[Mosaic]]&lt;br /&gt;
* [[Qi Daozei]]&lt;br /&gt;
* [[RPG Engine for T-Engine]]&lt;br /&gt;
* [[Startide]]&lt;br /&gt;
* [[The Power of Dreams]]&lt;br /&gt;
* [[Veins of the Earth]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Tales_of_Maj%27Eyal_Wiki&amp;diff=6390</id>
		<title>Tales of Maj'Eyal Wiki</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Tales_of_Maj%27Eyal_Wiki&amp;diff=6390"/>
				<updated>2013-12-20T04:23:04Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: changed module guides link name to be more clear&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
'''Tales of Maj'Eyal 4''' (aka ToME 4) is an RPG Roguelike game, written as a module that runs in [[T-Engine 4]]. Download T-Engine and ToME for a myriad of Operating Systems from http://www.te4.org/download&lt;br /&gt;
&lt;br /&gt;
[[T-Engine 4]] is the reboot and complete rewrite of T-Engine, released in beta form on May 11, 2010.&lt;br /&gt;
----&lt;br /&gt;
* [[tome history|History of ToME]]&lt;br /&gt;
* [[tome faq|Frequently Asked Questions]]&lt;br /&gt;
* [[tome glossary|Glossary of terms in ToME]]&lt;br /&gt;
&lt;br /&gt;
'''Want to contribute to the ToME wiki?''' [[How To Contribute To The Wiki|Click here]] for how to get started.&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%; background-color:white&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid; background-color:#FFB473; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;&amp;quot;&amp;gt;Character Info&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:0px solid; padding:0.4em 1em 1em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Races]]&lt;br /&gt;
* [[Stats]]&lt;br /&gt;
* [[Talents]]&lt;br /&gt;
* [[Prodigies]]&lt;br /&gt;
* [[Resources]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid; background-color:#FFB473; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;&amp;quot;&amp;gt;Game Info&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:0px solid; padding:0.4em 1em 1em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
* [[Campaigns]]&lt;br /&gt;
* [[Achievements]]&lt;br /&gt;
* [[Backup Guardians]]&lt;br /&gt;
* [[Bosses]]&lt;br /&gt;
* [[Guides]]&lt;br /&gt;
* [[Quests]]&lt;br /&gt;
* [[Unlockables]]&lt;br /&gt;
* [[Vaults]]&lt;br /&gt;
* [[Zones]]&lt;br /&gt;
* [[Escorts]]&lt;br /&gt;
* [[Difficulty]]&lt;br /&gt;
* [[Permadeath]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%; background-color:white&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid; background-color:#FFB473; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;&amp;quot;&amp;gt;Game Mechanics&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:0px solid; padding:0.4em 1em 1em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
* [[Character sheet]]: power, damage, saves, armor&lt;br /&gt;
* [[Combat Damage]]&lt;br /&gt;
* [[Effects]]&lt;br /&gt;
* [[Experience]]&lt;br /&gt;
* [[egos|Ego Items and their Effects]]&lt;br /&gt;
* [[Resources]]&lt;br /&gt;
* [[Vision]]&lt;br /&gt;
* [[Damage Types]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid; background-color:#FFB473; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;&amp;quot;&amp;gt;Items&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:0px solid; padding:0.4em 1em 1em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
* [[Items]]&lt;br /&gt;
* [[Artifacts]]&lt;br /&gt;
* [[Gems]]&lt;br /&gt;
* [[Item_list|Full List of all Items]]&lt;br /&gt;
* [[Materials|Item materials]]&lt;br /&gt;
* [[Mindstars]]&lt;br /&gt;
* [[Item sets]]&lt;br /&gt;
* [[Inscriptions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%; background-color:white&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid; background-color:#FFB473; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;&amp;quot;&amp;gt;Development&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:0px solid; padding:0.4em 1em 1em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
* [[Source Setup]]&lt;br /&gt;
* [[How to compile]]&lt;br /&gt;
* [[Lua|Lua: The language of ToME4]]&lt;br /&gt;
* [[Addons]]&lt;br /&gt;
** [[Hooks|Hooks and what they do]]&lt;br /&gt;
** [[Resources_for_Addons_and_Modules|Addon Resources]]&lt;br /&gt;
* [[Modules]]&lt;br /&gt;
** [[T4 Modules Howto Guide|Module creation guides]]&lt;br /&gt;
** [[Resources_for_Addons_and_Modules|Module Resources]]&lt;br /&gt;
* [[Debugging]]&lt;br /&gt;
* [[Command Line Arguments]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6263</id>
		<title>T4 Modules Howto Guide/Getting Started</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6263"/>
				<updated>2013-12-06T21:46:13Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==init.lua==&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Setting&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the official name of the module as seen in module selection list.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;long_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the long name of the module that appears is descriptions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is a short name used internal to the module. Preferred to be lower case and should be the same as the folder name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;author&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Your name or pseudonym and email address.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;homepage&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Optional homepage of the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;version&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module version. Does not automatically update. Change this between releases to differentiate them.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;engine&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Expected engine version.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;description&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A description of your module. Can be multiple lines and paragraphs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;starter&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Only change if you know what you are doing. And if you have to ask, you don't.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;show_only_on_cheat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;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.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;no_get_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;allow_userchat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Registers 'space' as a key to talk, joins a channel named &amp;amp;quot;module&amp;amp;quot;, and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;background_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;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&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Launching your module using command line parameters&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Parameter&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-M&amp;amp;lt;Module&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Auto-loads the specified module (using the module's short_name).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-u&amp;amp;lt;name&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Uses the specified name for the character.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-n&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces a new character, overwriting any old saves with the same name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;.../t-engine.exe -MMyModule -udefault -n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]].&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6257</id>
		<title>T4 Modules Howto Guide/Getting Started</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6257"/>
				<updated>2013-12-04T00:49:03Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==init.lua==&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Setting&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the official name of the module as seen in module selection list.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;long_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the long name of the module that appears is descriptions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is a short name used internal to the module. Preferred to be lower case and should be the same as the folder name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;author&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Your name or pseudonym and email address.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;homepage&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Optional homepage of the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;version&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module version. Does not automatically update. Change this between releases to differentiate them.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;engine&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Expected engine version.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;description&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A description of your module. Can be multiple lines and paragraphs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;starter&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Only change if you know what you are doing. And if you have to ask, you don't.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;show_only_on_cheat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;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.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;no_get_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;allow_userchat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Registers 'space' as a key to talk, joins a channel named &amp;amp;quot;module&amp;amp;quot;, and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;background_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;logo_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen logos&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Launching your module using command line parameters&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Parameter&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-M&amp;amp;lt;Module&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Auto-loads the specified module (using the module's short_name).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-u&amp;amp;lt;name&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Uses the specified name for the character.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-n&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces a new character, overwriting any old saves with the same name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;.../t-engine.exe -MMyModule -udefault -n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]].&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=God&amp;diff=6255</id>
		<title>God</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=God&amp;diff=6255"/>
				<updated>2013-12-02T01:04:54Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gods were powerful beings. Nearly all were killed by the Sher'Tul in the Godhunt, but some escaped.&lt;br /&gt;
&lt;br /&gt;
==List of Gods==&lt;br /&gt;
* Amakthel&lt;br /&gt;
* Gerlyk &lt;br /&gt;
* Quekorja&lt;br /&gt;
* Ralkur&lt;br /&gt;
* Ugg'matho&lt;br /&gt;
* Xadoch&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Qi_Daozei&amp;diff=6252</id>
		<title>Qi Daozei</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Qi_Daozei&amp;diff=6252"/>
				<updated>2013-11-28T01:13:29Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;An oriental themed fantasy roguelike.  {{Module |name=Qi Daozei |developer=Castler |version=0.3.0 |engine=1.0.5 |page=[http://te4.org/games/qdz] |link=[http:/...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An oriental themed fantasy roguelike.&lt;br /&gt;
&lt;br /&gt;
{{Module&lt;br /&gt;
|name=Qi Daozei&lt;br /&gt;
|developer=[[User:Castler|Castler]]&lt;br /&gt;
|version=0.3.0&lt;br /&gt;
|engine=1.0.5&lt;br /&gt;
|page=[http://te4.org/games/qdz]&lt;br /&gt;
|link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38831]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Template:Module&amp;diff=6251</id>
		<title>Template:Module</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Template:Module&amp;diff=6251"/>
				<updated>2013-11-28T01:03:02Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;&amp;quot;&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border:none; margin:0; padding:0; text-align:left&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-size:larger;&amp;quot;|{{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:125px;&amp;quot; | Developer&lt;br /&gt;
| style=&amp;quot;width:175px;&amp;quot; | {{{developer}}}&lt;br /&gt;
|-&lt;br /&gt;
! Current Version&lt;br /&gt;
| {{{version}}}&lt;br /&gt;
|-&lt;br /&gt;
! Engine Version&lt;br /&gt;
| {{{engine}}}  &lt;br /&gt;
|-&lt;br /&gt;
! Standalone Version&lt;br /&gt;
| {{{standalone|N/A}}}&lt;br /&gt;
|-&lt;br /&gt;
! Module Page&lt;br /&gt;
| {{{page}}}&lt;br /&gt;
|-&lt;br /&gt;
! Forum Link&lt;br /&gt;
| {{{link}}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;[[Category:Modules]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Startide&amp;diff=6250</id>
		<title>Startide</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Startide&amp;diff=6250"/>
				<updated>2013-11-28T01:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Module&lt;br /&gt;
|name=Startide&lt;br /&gt;
|developer=[[User:BDota|BDota]]&lt;br /&gt;
|version=0.0.2&lt;br /&gt;
|engine=1.0.5&lt;br /&gt;
|standalone=[http://www.fileswap.com/dl/xoWIra1WQN/]&lt;br /&gt;
|page=[http://te4.org/games/startide]&lt;br /&gt;
|link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38429]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A sci-fi module for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Startide&amp;diff=6249</id>
		<title>Startide</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Startide&amp;diff=6249"/>
				<updated>2013-11-28T01:01:27Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Module&lt;br /&gt;
|name=Startide&lt;br /&gt;
|developer=[[User:BDota|BDota]]&lt;br /&gt;
|version=0.0.2&lt;br /&gt;
|engine=1.0.5&lt;br /&gt;
|standalone=http://www.fileswap.com/dl/xoWIra1WQN/&lt;br /&gt;
|page=[http://te4.org/games/startide]&lt;br /&gt;
|link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38429]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A sci-fi module for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Template:Module&amp;diff=6248</id>
		<title>Template:Module</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Template:Module&amp;diff=6248"/>
				<updated>2013-11-28T00:54:42Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;&amp;quot;&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border:none; margin:0; padding:0; text-align:left&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-size:larger;&amp;quot;|{{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:125px;&amp;quot; | Developer&lt;br /&gt;
| style=&amp;quot;width:175px;&amp;quot; | {{{developer}}}&lt;br /&gt;
|-&lt;br /&gt;
! Current Version&lt;br /&gt;
| {{{version}}}&lt;br /&gt;
|-&lt;br /&gt;
! Engine Version&lt;br /&gt;
| {{{engine}}}  &lt;br /&gt;
|-&lt;br /&gt;
! Standalone Version&lt;br /&gt;
| {{{standalone}}}&lt;br /&gt;
|-&lt;br /&gt;
! Module Page&lt;br /&gt;
| {{{page}}}&lt;br /&gt;
|-&lt;br /&gt;
! Forum Link&lt;br /&gt;
| {{{link}}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;[[Category:Modules]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Startide&amp;diff=6247</id>
		<title>Startide</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Startide&amp;diff=6247"/>
				<updated>2013-11-28T00:17:15Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Module&lt;br /&gt;
|name=Startide&lt;br /&gt;
|developer=[[User:BDota|BDota]]&lt;br /&gt;
|version=0.0.2&lt;br /&gt;
|engine=1.0.5&lt;br /&gt;
|page=[http://te4.org/games/startide]&lt;br /&gt;
|link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38429]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A sci-fi module for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Creating_a_standalone_release&amp;diff=6238</id>
		<title>Creating a standalone release</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Creating_a_standalone_release&amp;diff=6238"/>
				<updated>2013-11-22T19:32:52Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Creating a standalone release allows people to play your game without having to download ToME, download your module, put it in the right place, etc.  It also allows you to customize the boot module (which handles the startup screen and main menu) so that you can come up with something thematically appropriate for your module.&lt;br /&gt;
&lt;br /&gt;
How to create a standalone release and how to create your own boot module:&lt;br /&gt;
* Download http://te4.org/dl/dev/boot-example.zip as a base for the main menu.&lt;br /&gt;
* Remove the boot module from &amp;lt;code&amp;gt;game/engines/default/modules/boot*&amp;lt;/code&amp;gt;&lt;br /&gt;
* Put your new boot module in place.&lt;br /&gt;
* Edit or replace &amp;lt;code&amp;gt;boot/data/gfx/background/&amp;lt;/code&amp;gt; files with your own splash screen.&lt;br /&gt;
* Edit &amp;lt;code&amp;gt;boot/init.lua&amp;lt;/code&amp;gt; to give it a correct name, change the boot screen's startup background, etc.  (This &amp;lt;code&amp;gt;init.lua&amp;lt;/code&amp;gt; uses the same format as the one you created in [[Getting Started]].)&lt;br /&gt;
* Grab ToME's archives, inside replace the boot module by yours and tome module by yours.&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Uploading_a_module&amp;diff=6172</id>
		<title>Uploading a module</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Uploading_a_module&amp;diff=6172"/>
				<updated>2013-09-29T15:00:04Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Once your module is complete, you'll want to upload it to http://te4.org/games so that others can play it.  To do so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Request upload permission from http://te4.org/contact, if you haven't already done so.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Go to http://te4.org and click the &amp;quot;Create a module&amp;quot; link.  Fill out the form there; most of the information here can come straight out of your [[Getting_Started#init.lua|init.lua]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Zip your module up into a &amp;lt;code&amp;gt;.team&amp;lt;/code&amp;gt; file.  A &amp;lt;code&amp;gt;.team&amp;lt;/code&amp;gt; file is simply a zip file, renamed to have a &amp;lt;code&amp;gt;.team&amp;lt;/code&amp;gt; extension.  The &amp;lt;code&amp;gt;.team&amp;lt;/code&amp;gt; file's layout is slightly different than the normal [[Directory_Structure|module directory structure]]; the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; subdirectory remains unchanged, while everything else is placed in a &amp;lt;code&amp;gt;mod&amp;lt;/code&amp;gt; subdirectory.  (You'll probably also want to exclude any development documentation, .gitignore files, scripts, etc.)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Get the MD5 checksum for your module.  To do so, start ToME, load your newly zipped module, then exit.  Check &amp;lt;code&amp;gt;te4_log.txt&amp;lt;/code&amp;gt; for a line similar to the following:&lt;br /&gt;
  &amp;lt;pre&amp;gt;[MODULE LOADER] module MD5 1234567890abcdef1234567890abcdef&amp;lt;/pre&amp;gt;&lt;br /&gt;
  In this example, &amp;quot;1234567890abcdef1234567890abcdef&amp;quot; is the checksum.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Go to http://te4.org and click the &amp;quot;Upload a module&amp;quot; link.  Under &amp;quot;File:&amp;quot;, select your &amp;lt;code&amp;gt;.team&amp;lt;/code&amp;gt; file and click Upload.  Fill out the rest of the page and click Save.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Go to http://te4.org/games and bask in the pleasure of seeing it listed alongside the other T-Engine4 games.  Dream about it becoming the next smash hit.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A script to automate creating the .team file and calculating the MD5 checksum is available at https://github.com/joshkel/qdz/blob/master/dev/release.py.  Although it was written for another T-Engine module, it should work with any module.  Just run it from the command line with the path to your module directory as a command-line parameter.  (You'll need to have Python 2.7 or 3 installed.)&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Particle_Effects&amp;diff=6171</id>
		<title>Particle Effects</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Particle_Effects&amp;diff=6171"/>
				<updated>2013-09-29T14:59:37Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Particle effects can be used to add pizzazz to your game.  There are two parts to adding particles: invoking the particles from your main Lua code and actually defining them.  We'll cover invoking particle effects first, since it's considerably simpler, and you'll want to be able to invoke your new effects to test them out and tune their parameters.&lt;br /&gt;
&lt;br /&gt;
= Invoking Particles =&lt;br /&gt;
&lt;br /&gt;
Assuming your particle effect is named &amp;quot;my_particle.lua&amp;quot; (see [[#Defining Particles|below]]), there are a few main options for invoking it.  (Other alternatives also exist for more specialized circumstances.)&lt;br /&gt;
&lt;br /&gt;
== On the map ==&lt;br /&gt;
&lt;br /&gt;
The [http://te4.org/docs/t-engine4/1.0.0/modules/engine.Map.html#_M:particleEmitter Map.particleEmitter function] can add a particle effect to the map.  For example, if a talent should display an effect centered on the user, add the following code to your talent's &amp;lt;code&amp;gt;action&amp;lt;/code&amp;gt; function:&lt;br /&gt;
&lt;br /&gt;
    game.level.map:particleEmitter(self.x, self.y, 1, &amp;quot;my_particle&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Make sure that your particle effect limits how many particles it generates; otherwise, it can run forever.&lt;br /&gt;
&lt;br /&gt;
== On an entity ==&lt;br /&gt;
&lt;br /&gt;
A long-lasting particle effect can be added to an entity with [http://te4.org/docs/t-engine4/1.0.0/modules/engine.Entity.html#_M:addParticles Entity.addParticles] and removed with [http://te4.org/docs/t-engine4/1.0.0/modules/engine.Entity.html#_M:removeParticles Entity.removeParticles].  For example, to associate a particle effect with a status condition, add the following to the appropriate &amp;lt;code&amp;gt;newEffect&amp;lt;/code&amp;gt; block in your &amp;lt;code&amp;gt;timed_effects.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    activate = function(self, eff)&lt;br /&gt;
        eff.particle = self:addParticles(Particles.new(&amp;quot;my_particle&amp;quot;, 1))&lt;br /&gt;
    end,&lt;br /&gt;
    deactivate = function(self, eff)&lt;br /&gt;
        self:removeParticles(eff.particle)&lt;br /&gt;
    end,&lt;br /&gt;
&lt;br /&gt;
== As a projectile ==&lt;br /&gt;
&lt;br /&gt;
See [http://te4.org/docs/t-engine4/1.0.0/modules/engine.interface.ActorProject.html ActorProject].  Specifically:&lt;br /&gt;
&lt;br /&gt;
* To add a particle effect when the projectile hits, pass &amp;lt;code&amp;gt;{type=&amp;quot;my_particle&amp;quot;}&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;particles&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;project&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;projectile&amp;lt;/code&amp;gt;.&lt;br /&gt;
* To add a particle effect for the projectile itself, add a &amp;lt;code&amp;gt;display={particle=&amp;quot;my_particle&amp;quot;}&amp;lt;/code&amp;gt; entry in the table that you pass for the &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; parameter.  (This table will often come from a talent's &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; function.)&lt;br /&gt;
&lt;br /&gt;
== Testing your particle effects ==&lt;br /&gt;
&lt;br /&gt;
Note that particle effects files are loaded ''every time'' they're invoked.  This makes it very easy to test your particles: make up a talent that invokes the particles, give it no resource cost and no cooldown, and invoke it as much as you want as you tweak the particle parameters.&lt;br /&gt;
&lt;br /&gt;
= Defining Particles =&lt;br /&gt;
&lt;br /&gt;
To define a new particle effect, create a Lua file under your module's &amp;lt;code&amp;gt;data/gfx/particles&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The ToME source code has a huge set of existing particle effects under [http://git.net-core.org/darkgod/t-engine4/tree/master/game/modules/tome/data/gfx/particles game/modules/tome/data/gfx/particles], so you can look there to see how particular effects are implemented.&lt;br /&gt;
&lt;br /&gt;
== Basic concepts ==&lt;br /&gt;
&lt;br /&gt;
Particle effects are processed at 30 frames per second (regardless of the T-Engine's actual frame rate).&lt;br /&gt;
&lt;br /&gt;
A particle effect is a fragment of Lua code that returns the following:&lt;br /&gt;
&lt;br /&gt;
# A table of [[#parameters|parameters]] for each particle.  This table can define parameters directly, or it can contain a &amp;lt;code&amp;gt;generator&amp;lt;/code&amp;gt; function that returns a table of parameters each time it's invoked.&lt;br /&gt;
# An emitter function.  This function is called every frame (i.e., 30 times a second).  Its main job is to call &amp;lt;code&amp;gt;self:ps:emit(N)&amp;lt;/code&amp;gt; (where N is the number of particles to generate for that frame) as appropriate.&lt;br /&gt;
# (Optional) A number giving the maximum number of particles that the system will handle for this particle effect.  Setting this too high will slightly hurt performance.&lt;br /&gt;
# (Optional) A string giving an image filename (minus extension) to load and use in place of the standard dot or spherical image.&lt;br /&gt;
# (Optional) A boolean that can be set to cause the particle system to not be automatically deleted when no more particles exist.  Use with care.&lt;br /&gt;
&lt;br /&gt;
Under normal conditions, a particle system will be automatically deleted when no more particles exist.  The emitter function often limits itself to only running a certain number of times to ensure that particle systems don't go on forever.&lt;br /&gt;
&lt;br /&gt;
Some basic trigonometry may be helpful to convert between x, y coordinates and angles on a circle.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
Particle effect code can return a table of parameters directly for use with the T-Engine's simple generator, or it can return a generator function.&lt;br /&gt;
&lt;br /&gt;
=== Simple generator ===&lt;br /&gt;
&lt;br /&gt;
A table for use with the simple generator might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {&lt;br /&gt;
    base = 1000,&lt;br /&gt;
        &lt;br /&gt;
    angle = { 0, 360 }, anglev = { 2000, 4000 }, anglea = { 200, 600 },&lt;br /&gt;
        &lt;br /&gt;
    life = { 5, 10 },&lt;br /&gt;
    size = { 3, 6 }, sizev = {0, 0}, sizea = {0, 0},&lt;br /&gt;
        &lt;br /&gt;
    r = {0, 0}, rv = {0, 0}, ra = {0, 0},&lt;br /&gt;
    g = {80, 200}, gv = {0, 10}, ga = {0, 0},&lt;br /&gt;
    b = {0, 0}, bv = {0, 0}, ba = {0, 0},&lt;br /&gt;
    a = {255, 255}, av = {0, 0}, aa = {0, 0},&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that each value is given as a pair of numbers; these give the minimum and maximum values for the RNG to randomly generate each particle.  Also note that colors (r, g, b, and a) range from 0 to 255.  Only integers are permitted.&lt;br /&gt;
&lt;br /&gt;
The simple generator is fairly restrictive; it's only really suitable for particles moving outwards from a central point.&lt;br /&gt;
&lt;br /&gt;
=== Generator function ===&lt;br /&gt;
&lt;br /&gt;
The same particle effect expressed as a generator function would look like this: (UNTESTED)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return { generator = function()&lt;br /&gt;
    return {&lt;br /&gt;
        trail = 0,&lt;br /&gt;
&lt;br /&gt;
        life = rng.range(5, 10),&lt;br /&gt;
        size = rng.range(3, 6), sizev = 0, sizea = 0,&lt;br /&gt;
&lt;br /&gt;
        x = 0, xv = 0, xa = 0,&lt;br /&gt;
        y = 0, yv = 0, ya = 0,&lt;br /&gt;
        dir = math.rad(rng.range(0, 360)), dirv = 0, dira = 0,&lt;br /&gt;
        vel = rng.range(2, 4), velv = rng.range(0.2, 0.6), vela = 0,&lt;br /&gt;
&lt;br /&gt;
        r = 0, rv = 0, ra = 0,&lt;br /&gt;
        g = rng.range(80, 200)/255, gv = rng.range(0, 10)/255, ga = 0,&lt;br /&gt;
        b = 0, bv = 0, ba = 0,&lt;br /&gt;
        a = 1, av = 0, aa = 0&lt;br /&gt;
    }&lt;br /&gt;
end }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The generator function invokes the RNG itself and returns floating point numbers.&lt;br /&gt;
&lt;br /&gt;
=== Parameter values ===&lt;br /&gt;
&lt;br /&gt;
Several parameters have ...v and ...a values.  These give velocity and acceleration for that value.  Each frame, velocity is added to the base value, then acceleration is added to velocity (causing velocity to change for future frames).  For example:&lt;br /&gt;
&lt;br /&gt;
    r = 1, rv = -0.1, ra = 0&lt;br /&gt;
    g = 0, gv = 0, ga = 0,&lt;br /&gt;
    b = 0, bv = 0, ba = 0&lt;br /&gt;
&lt;br /&gt;
starts out solid red and fades to black over 10 frames.&lt;br /&gt;
&lt;br /&gt;
As another example:&lt;br /&gt;
&lt;br /&gt;
    y = 0, yv = 0, ya = -0.4&lt;br /&gt;
&lt;br /&gt;
creates a particle that is initially motionless but starts moving up faster and faster.&lt;br /&gt;
&lt;br /&gt;
Details on values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=2&amp;gt;'''''General settings'''''&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;life&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Number of frames for which the particle will exist&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;size, sizev, sizea&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Size of the particle&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=2&amp;gt;'''''Simple generator only'''''&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;base&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;All velocity and acceleration values are divided by this before being processed (since the default generator can't take fractional values directly).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;angle, anglev, anglea&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Angle along which the particle should move, in degrees, and velocity and acceleration at which it should move along that angle.  Generator functions can use dir and vel for a similar effect.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=2&amp;gt;'''''Generator function only'''''&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;trail&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Used to draw trails from one particle to another.  trail is 0-based, unlike most values in T-Engine.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;x, xv, xa&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;x coordinate, relative to the center of the particle system&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;y, yv, ry&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;y coordinate, relative to the center of the particle system&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;dir, dirv, dira&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Angle along which the particle should move, in radians.  dirv and dira give the rate at which that angle should change.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;vel, velv, vela&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Velocity to move along the angle given by dir, and the &amp;quot;velocity of velocity&amp;quot; (i.e., acceleration) and the &amp;quot;acceleration of velocity.&amp;quot;  Movement can be done via xv, xa, yv, ya or dir, vel (or both at the same time).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=2&amp;gt;'''''Color'''''&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;r, rv, ra&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Red component&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;g, gv, ga&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Green component&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;b, bv, ba&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Blue component&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;a, av, aa&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Alpha component.  255 (for the simple generator) or 1 (for a generator function) means fully opaque, 0 means fully transparent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Developing_a_static_map_using_the_Tiled_plugin&amp;diff=6170</id>
		<title>T4 Modules Howto Guide/Developing a static map using the Tiled plugin</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Developing_a_static_map_using_the_Tiled_plugin&amp;diff=6170"/>
				<updated>2013-09-29T14:59:25Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Developing a static map using the Tiled plugin&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A T-Engine map is composed of square grids and each of these grids has several content slots where the actual T-Engine entities are stored.  You will be dealing with the TERRAIN, TRAP, OBJECT and ACTOR slots.  Most maps in ToME are generated according to an algorithm (called a generator) which leads to a different map each time.  T-Engine also supports static maps that you can prepare beforehand and to help designing this type of map a T-Engine plugin has been developed for the [http://www.mapeditor.org Tiled map editor]. The T-Engine plugin will convert Tiled maps into the Lua format that T-Engine expects, or alternatively you can directly create the Lua maps.  The Lua maps are constructed by first assigning an ASCII character &amp;lt;tt&amp;gt;char&amp;lt;/tt&amp;gt; values for each of the content slots:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;defineTile = function(char, grid, obj, actor, trap, status, spot)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Then you return an ASCII map that will be interpreted by the map generator according to the tiles defined with the defineTile function.  Understanding this will help you determine if the Tiled map is being exported properly to the Lua file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc1&amp;quot;&amp;gt;ToME Vault Tutorial&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;One use for static maps in ToME is to define the various vaults that can be encountered, and we will use this as a tutorial for learning how to use Tiled.  You can grab the prepared files (&amp;lt;strong&amp;gt;coming soon&amp;lt;/strong&amp;gt;).  You can skip down to &amp;lt;strong&amp;gt;Create a Terrain layer and paint&amp;lt;/strong&amp;gt; section if you are just developing vaults, but if you are developing a map for your own module you will need to look at these two sections.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc2&amp;quot;&amp;gt;Create a tilemap image&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The first thing you need to get started is a tilemap.  The tilemap is a single image that is a collection of the individual images for each terrain that you want to add to the map.  Since T-Engine uses individual 32x32 pixel images you will need to create this, and the fastest way is to use the ImageMagick montage command.  First copy all of the individual images you want to use into a single directory and the run this command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;montage -border 0 -geometry 32x32 *png tilemap.png&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc3&amp;quot;&amp;gt;Create a Tiled terrain tileset&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Launch the Tiled program and go to &amp;lt;tt&amp;gt;Map -&amp;amp;gt; New Tileset&amp;lt;/tt&amp;gt;.  Name it whatever you want and select the tilemap image you just created.  Make sure the tile width/height (32) and margin/spacing (0) are set up correctly.  The tileset should now appear in the bottom right of the Tiled window.  Now we need to assign an ASCII character and value to each tile.  You need to right-click on each tile and select &amp;lt;tt&amp;gt;Tile Properties&amp;lt;/tt&amp;gt;.  Click on &amp;lt;tt&amp;gt;&amp;amp;lt;new property&amp;amp;gt;&amp;lt;/tt&amp;gt; and enter &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt;.  Then click in the value space next to your new display property and enter any ASCII character you would like to be associated with this tile, eg. &amp;lt;tt&amp;gt;T&amp;lt;/tt&amp;gt; for tree.  Now add another property called &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; and a corresponding value, eg. &amp;lt;tt&amp;gt;&amp;amp;quot;TREE&amp;amp;quot;&amp;lt;/tt&amp;gt;.  Note the inclusion of quotation marks since these properties will be exported directly to the Lua code and you want the Lua code to recognize this value as a string.  Keep doing this until you have a complete terrain tileset.  You can then right-click on the tileset and export it so you can re-use it in other maps.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc4&amp;quot;&amp;gt;Create a new Tiled map (and load the Tileset)&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can either create a new 10x10 map of 32x32 tiles.  Now go to &amp;lt;tt&amp;gt;Map -&amp;amp;gt; Add External Tileset&amp;lt;/tt&amp;gt; and select &amp;lt;tt&amp;gt;vault.tsx&amp;lt;/tt&amp;gt;  In this tutorial we are going to be making a bandit-themed vault, and the final results can be seen in &amp;lt;tt&amp;gt;vault-tutorial.tmx&amp;lt;/tt&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc5&amp;quot;&amp;gt;Create a Terrain layer and paint&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Tiled maps start with a default Tile Layer called &amp;lt;tt&amp;gt;Tile Layer 1&amp;lt;/tt&amp;gt;.  We will use this layer to &amp;amp;quot;paint&amp;amp;quot; the terrain content slot for the T-Engine map.  In order for the T-Engine plugin to recognize we want to use this layer for the terrain content slot we need to have the layer name start with &amp;lt;tt&amp;gt;Terrain&amp;lt;/tt&amp;gt; (case-insensitive).  You can rename the layer by double-clicking on the current name.  Now you can select a tile from the tileset and start painting on the map.  Test what you have done so far by exporting the map with the T-Engine plugin (&amp;lt;tt&amp;gt;File -&amp;amp;gt; Export as&amp;lt;/tt&amp;gt; and select &amp;lt;tt&amp;gt;T-Engine4 map files&amp;lt;/tt&amp;gt; in the format pull down).  Open up the created Lua file and see if it makes sense.  The tiles marked with a &amp;amp;quot;V&amp;amp;quot; are vault walls, so surround the exterior of the map with those.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc6&amp;quot;&amp;gt;Create an Actor object layer&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Tiled has two different types of layers: Tiles and Objects.  In the previous section we saw the Tile Layer, where we painted the terrain using the various tiles from our tileset.  We could theoretically do the same thing for Actors, but creating a tileset for all of the actors (monsters) in ToME doesn't strike me as a lot of fun and thus we will use Object Layers for this work.  Right-click in the layers window and select &amp;lt;tt&amp;gt;Add Object Layer&amp;lt;/tt&amp;gt;.  In order to link this layer to the &amp;lt;tt&amp;gt;Actor&amp;lt;/tt&amp;gt; content slot we (you guessed it) rename the new layer to start with &amp;lt;tt&amp;gt;Actor&amp;lt;/tt&amp;gt;.  Instead of selecting a tile and painting it onto the map we now create free-sized rectangles on the map.  Practice drawing, resizing and deleting the objects.  Now we need to set the &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; properties of each object we put down, so place an object and open the property editor.  Let us make this one our bandit lord.  Put &amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt; in for &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{random_filter={name=&amp;amp;quot;bandit lord&amp;amp;quot;, add_levels=15}}&amp;lt;/tt&amp;gt; in for &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;.  Note that the value does not have quotation marks this time, and is actually a Lua table!  When this table gets passed to the static map generator the generator will try to create a random actor that matches the name provided and then add an additional 15 levels (vaults are supposed to be difficult).  The full syntax of what can be passed in this table is outside the scope of this article.  Now each tile that the bandit lord object overlaps will attempt to place a matching actor there, so make sure your bandit lord object is fully contained within a single tile.  You can add another object that tries to place assassins and make it larger than one tile, though.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4 id=&amp;quot;toc7&amp;quot;&amp;gt;Use Layer Properties as defaults&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For a small vault creating and editing the properties for each individual actor is ok, but this can get really tedious when adding a lot of similar actors to the map.  Well layers can have properties just like objects and tiles, and the T-Engine plugin will look at the layer's properties if it does not find &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; in the tile/object.  To see this in action let us create a new Object Layer and call it &amp;lt;tt&amp;gt;Actor - Generic Bandit&amp;lt;/tt&amp;gt;.  Now right-click on the object layer and select &amp;lt;tt&amp;gt;Layer Properties&amp;lt;/tt&amp;gt;.  Add a &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; layer property and add some object to the new layer.  Export the map and check that the actor content from your new layer is handled correctly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Frame_Buffers&amp;diff=6169</id>
		<title>T4 Modules Howto Guide/Frame Buffers</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Frame_Buffers&amp;diff=6169"/>
				<updated>2013-09-29T14:59:14Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;        &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;&amp;lt;p&amp;gt;[Quoting Darkgod from the forums]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Hum shaders ...  You need to understand one thing about how this all works.&amp;lt;br /&amp;gt;&lt;br /&gt;
To use a fullscreen or fullmap shader the game makes a FBO (framebuffer object, like a virtual screen that outputs to a texture), displays the map inside it and then displays the FBO's texture through the shader. The shader is applied to each and every pixel drawn from the texture.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;So first you setup your FBOs, for that just copy ToME's Game:createFBOs() method and call it as tome does (in setupDisplayMode).&amp;lt;br /&amp;gt;&lt;br /&gt;
Now your fbos are created and your shaders are loaded. You need to use them now. Not all displays can do shaders or FBO though, so you need two versions of your map display code:&amp;lt;br /&amp;gt;&lt;br /&gt;
Where your module probably just does (if you copied example module):&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;      self.level.map:display(nil, nil, nb_keyframe)&lt;br /&gt;
      self.target:display()&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You instead do:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;      -- Display using Framebuffer, so that we can use shaders and all&lt;br /&gt;
      local map = game.level.map&lt;br /&gt;
      if self.fbo then&lt;br /&gt;
         self.fbo:use(true)&lt;br /&gt;
            map:display(0, 0, nb_keyframe)&lt;br /&gt;
         self.fbo:use(false, self.full_fbo)&lt;br /&gt;
         self.fbo:toScreen(map.display_x, map.display_y, map.viewport.width, map.viewport.height, self.fbo_shader.shad)&lt;br /&gt;
&lt;br /&gt;
         if self.target then self.target:display() end&lt;br /&gt;
&lt;br /&gt;
      -- Basic display; no FBOs&lt;br /&gt;
      else&lt;br /&gt;
         map:display(nil, nil, nb_keyframe)&lt;br /&gt;
         if self.target then self.target:display() end&lt;br /&gt;
      end&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This will make the map display in its own texture and then use the fbo shader on it.&amp;lt;br /&amp;gt;&lt;br /&gt;
ToME uses two fbos, one for the map and one for the whole screen.&amp;lt;br /&amp;gt;&lt;br /&gt;
The fullscreen one must thus also be used:&amp;lt;br /&amp;gt;&lt;br /&gt;
At the top of Game:display() right after the &amp;amp;quot;if self.change_res_dialog&amp;amp;quot; you add a line:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;   if self.full_fbo then self.full_fbo:use(true) end&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;And then at the very bottom of Game:display() you do:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;   if self.full_fbo then&lt;br /&gt;
      self.full_fbo:use(false)&lt;br /&gt;
      self.full_fbo:toScreen(0, 0, self.w, self.h, self.full_fbo_shader.shad)&lt;br /&gt;
   end&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This will display all the game inside a fbo and then display it with the given shader.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now shaders themselves. They live in data/gfx/shaders/ There must usualy be two file per shaders, a .lua file that describes it and a .frag one that is the shader code to run on the GPU. Try to see how main_fbo and full_fbo shaders in ToME work. They probably are enough for your needs but you can play with them as you need (or ask more specific questions).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now if you did it all right your game should display .. just as before!&amp;lt;br /&amp;gt;&lt;br /&gt;
So we need to tell the shaders to do stuff. First tell the full_fbo shader to handle gamme correction instead of the OS (it usualy looks better):&amp;lt;br /&amp;gt;&lt;br /&gt;
define&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
support_shader_gamma = true&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;in Game.lua, before the init method (like ToME does).&amp;lt;br /&amp;gt;&lt;br /&gt;
If at that point you get a fully dark screen, try to add&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
self:setGamma(config.settings.gamma_correction / 100)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;right at the end of createFBOs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now the fun part!&amp;lt;br /&amp;gt;&lt;br /&gt;
Say you want to colorize your game in red, you simply do:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
game.fbo_shader:setUniform(&amp;amp;quot;colorize&amp;amp;quot;, {1,0.2,0,1})&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Somewhere in your code. To restore default you do:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
game.fbo_shader:setUniform(&amp;amp;quot;colorize&amp;amp;quot;, {0,0,0,0})&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;ToME's relevant code for that is in Player:updateMainShader()&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Go play with those&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Colors&amp;diff=6168</id>
		<title>Colors</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Colors&amp;diff=6168"/>
				<updated>2013-09-29T14:59:03Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;T-Engine provides a number of predefined colors.  There are two ways to refer to these:&lt;br /&gt;
&lt;br /&gt;
* In your Lua code.  For example: &amp;lt;code&amp;gt;code.DARK_GREEN&amp;lt;/code&amp;gt;&lt;br /&gt;
* Embedded within strings (using # signs to mark them).  For example: &amp;lt;code&amp;gt;&amp;quot;Hello, #BLUE#world#LAST#!&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following colors are defined by T-Engine 1.0.4:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Red&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Green&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Blue&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Demo&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;BLACK&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #000000; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;WHITE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ffffff; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;SLATE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;140&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;140&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;140&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #8c8c8c; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ORANGE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;119&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ff7700; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;RED&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;201&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #c90000; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;GREEN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;134&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;69&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #008645; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;227&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #0000e3; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;UMBER&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;142&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;69&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #8e4500; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_DARK&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;80&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;80&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;80&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #505050; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_SLATE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;209&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;209&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;209&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #d1d1d1; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;VIOLET&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;192&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;175&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #c000af; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;YELLOW&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ffff00; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_RED&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;104&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ff0068; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_GREEN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #00ff00; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;81&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;221&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #51ddff; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_UMBER&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;215&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;142&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;69&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #d78e45; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_UMBER&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;87&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;94&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;37&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #575e25; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_GREY&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;67&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;67&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;67&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #434343; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;GREY&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;127&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;127&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;127&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #7f7f7f; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ROYAL_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;65&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;105&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;225&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #4169e1; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;AQUAMARINE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;127&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;212&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #7fffd4; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;CADET_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;95&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;158&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;160&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #5f9ea0; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;STEEL_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;70&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;130&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;180&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #4682b4; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;TEAL&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;128&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;128&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #008080; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LIGHT_STEEL_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;176&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;196&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;222&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #b0c4de; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;147&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #000093; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ROYAL_BLUE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;108&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #006cff; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;PINK&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;192&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;203&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ffc0cb; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;GOLD&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;215&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ffd700; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;FIREBRICK&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;178&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;34&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;34&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #b22222; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_RED&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;100&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #640000; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;VERY_DARK_RED&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;50&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #320000; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;CRIMSON&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;220&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;20&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;60&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #dc143c; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;MOCCASIN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;228&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;181&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #ffe4b5; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;KHAKI&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;240&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;230&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;130&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #f0e682; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;SANDY_BROWN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;244&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;164&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;96&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #f4a460; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;SALMON&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;250&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;128&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;114&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #fa8072; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_ORCHID&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;153&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;50&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;204&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #9932cc; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ORCHID&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;218&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;112&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;214&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #da70d6; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;PURPLE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;128&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;0&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;139&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #80008b; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;CHOCOLATE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;210&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;105&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;30&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #d2691e; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_KHAKI&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;189&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;183&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;107&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #bdb76b; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;TAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;210&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;180&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;140&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #d2b48c; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_TAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;110&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;80&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;40&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #6e5028; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;HONEYDEW&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;240&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;255&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;240&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #f0fff0; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ANTIQUE_WHITE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;250&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;235&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;215&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #faebd7; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;OLD_LACE&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;253&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;245&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;230&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #fdf5e6; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_SLATE_GRAY&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;47&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;79&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;79&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #2f4f4f; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;OLIVE_DRAB&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;107&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;142&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;35&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #6b8e23; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_SEA_GREEN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;143&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;188&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;143&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #8fbc8f; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;YELLOW_GREEN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;154&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;205&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;50&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #9acd32; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DARK_GREEN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;50&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;77&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style=&amp;quot;background: #324d0c; border: solid 1px black&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Chats&amp;diff=6167</id>
		<title>T4 Modules Howto Guide/Chats</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Chats&amp;diff=6167"/>
				<updated>2013-09-29T14:58:51Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Chats: Beyond Hack and Slash &amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;amp;quot;But this is a roguelike,&amp;amp;quot; you say, &amp;amp;quot;I &amp;lt;em&amp;gt;like&amp;lt;/em&amp;gt; the hacking and slashing.&amp;amp;quot;  Well fine... how about a chat &amp;lt;em&amp;gt;before&amp;lt;/em&amp;gt; the fight, then?  And what better an example than the Black Knight from the Monty Python and the Holy Grail?&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The first thing to do is to let the game know that an NPC can talk.  In the code below we set the &amp;amp;quot;can_talk&amp;amp;quot; variable of the entity and we also set the black knight's faction (See [[Factions]]) to be the same as the players.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newEntity{&lt;br /&gt;
    name = &amp;amp;quot;The Black Knight&amp;amp;quot;, define_as = &amp;amp;quot;BLACK_KNIGHT&amp;amp;quot;,&lt;br /&gt;
    display = &amp;amp;quot;k&amp;amp;quot;, color=colors.BLACK,&lt;br /&gt;
    desc = [[a knight dressed in black armor stands before you.]],&lt;br /&gt;
    level_range = {1, 4}, exp_worth = 1,&lt;br /&gt;
    can_talk = &amp;amp;quot;black_knight&amp;amp;quot;,&lt;br /&gt;
    faction = &amp;amp;quot;players&amp;amp;quot;,&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The game can now check for the can_talk variable when you bump into a NPC (or maybe target an NPC with a talk command, however you decide to code it).  If you are using the Combat interface from the example module I suggest you edit the bumpInto function like so&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function _M:bumpInto(target)&lt;br /&gt;
    local reaction = self:reactionToward(target)&lt;br /&gt;
    if reaction &amp;amp;lt; 0 then&lt;br /&gt;
        return self:attackTarget(target)&lt;br /&gt;
    elseif reaction &amp;amp;gt;= 0 then&lt;br /&gt;
        -- Talk ?&lt;br /&gt;
        if self.player and target.can_talk then&lt;br /&gt;
            local chat = Chat.new(target.can_talk, target, self)&lt;br /&gt;
            chat:invoke()&lt;br /&gt;
        elseif target.player and self.can_talk then&lt;br /&gt;
            local chat = Chat.new(self.can_talk, self, target)&lt;br /&gt;
            chat:invoke()&lt;br /&gt;
        -- Displace&lt;br /&gt;
        elseif self.move_others then&lt;br /&gt;
            game.level.map:remove(self.x, self.y, Map.ACTOR)&lt;br /&gt;
            game.level.map:remove(target.x, target.y, Map.ACTOR)&lt;br /&gt;
            game.level.map(self.x, self.y, Map.ACTOR, target)&lt;br /&gt;
            game.level.map(target.x, target.y, Map.ACTOR, self)&lt;br /&gt;
            self.x, self.y, target.x, target.y = target.x, target.y, self.x, self.y&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Remember how we set the black knight's faction to &amp;amp;quot;players&amp;amp;quot;?  Well that ensures us a favorable reaction between the two, taking us into the &amp;amp;quot;elseif reaction &amp;amp;gt;= 0&amp;amp;quot; loops.  The creation of a new chat takes three variables, a string with the name of the chat, the npc and the player.  In our example we will be passing &amp;amp;quot;black_knight&amp;amp;quot;, the black knight entity and finally the player entity.  Now we need to actually create the chat so T-Engine has something to find when trying to create the Chat object.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The default location for chats is in the data/chats folders of your module.  Create data/chats/black_knight.lua and open it.  Each round of dialog will be created using the newChat function.  We need to supply an id tag for each dialog round, the text that the NPC will say, and the possible responses we can select from.  The answers table is where most of the magic happens, but we will start with a simple example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newChat{ id=&amp;amp;quot;first&amp;amp;quot;,&lt;br /&gt;
    text = [[#light_green#* The black knight stares at you in silence.]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;You fight with the strength of many men, sir knight.  I am Arthur, King of the Britons.&amp;amp;quot;]], jump=&amp;amp;quot;second&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Each entry in the answers table is itself a table which I will refer to as a response rather than the singular answer.  The first entry in the response is a string and this is what will be displayed in the chat window.  Other parameters can be supplied in the response such as the &amp;amp;quot;jump&amp;amp;quot; parameter above.  The jump parameter tells the Chat the id of the round of dialog to be loaded when that option is selected.  The second response does not have a jump parameter, so selecting that option will quit the Chat.  Now we have to define the next few rounds of dialog!&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newChat{ id=&amp;amp;quot;second&amp;amp;quot;,&lt;br /&gt;
    text = [[#light_green#* The black knight continues to stare at you in silence.]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;I seek the finest and the bravest knights in the land to join me in my court of Camelot.&amp;amp;quot;]], jump=&amp;amp;quot;third&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
newChat{ id=&amp;amp;quot;third&amp;amp;quot;,&lt;br /&gt;
    text = [[#light_green#* The black knight is silent once again.]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;You have proved yourself worthy; will you join me?&amp;amp;quot;]], jump=&amp;amp;quot;fourth&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
newChat{ id=&amp;amp;quot;fourth&amp;amp;quot;,&lt;br /&gt;
    text = [[#light_green#* Silence... well what did you expect?]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;You make me sad.  So be it.  Come, Patsy.&amp;amp;quot;]], jump=&amp;amp;quot;fifth&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
newChat{ id=&amp;amp;quot;fifth&amp;amp;quot;,&lt;br /&gt;
    text = [[&amp;amp;quot;None shall pass.&amp;amp;quot;]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;What?&amp;amp;quot;]], jump=&amp;amp;quot;fifth&amp;amp;quot;},&lt;br /&gt;
        {[[&amp;amp;quot;I have no quarrel with you, good sir knight, but I must cross this bridge.&amp;amp;quot;]], jump=&amp;amp;quot;sixth&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In that last (&amp;amp;quot;fifth&amp;amp;quot;) round of dialog we see something interesting, a recursive dialog.  Nothing wrong there, and it actually saves us from coding an extra round of dialog.  We are getting near the hack-and-slash bits!&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newChat{ id=&amp;amp;quot;sixth&amp;amp;quot;,&lt;br /&gt;
    text = [[&amp;amp;quot;Then you shall die.&amp;amp;quot;]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;What?&amp;amp;quot;]], jump=&amp;amp;quot;fifth&amp;amp;quot;},&lt;br /&gt;
        {[[&amp;amp;quot;I command you as King of the Britons to stand aside!&amp;amp;quot;]], jump=&amp;amp;quot;seventh&amp;amp;quot;},&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
newChat{ id=&amp;amp;quot;seventh&amp;amp;quot;,&lt;br /&gt;
    text = [[&amp;amp;quot;I move for no man.&amp;amp;quot;]],&lt;br /&gt;
    answers = {&lt;br /&gt;
        {[[&amp;amp;quot;What?&amp;amp;quot;]], jump=&amp;amp;quot;seventh&amp;amp;quot;},&lt;br /&gt;
        {[[&amp;amp;quot;So be it!&amp;amp;quot;]], action=function(npc, player)&lt;br /&gt;
            npc.faction = &amp;amp;quot;enemies&amp;amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {[[Walk away.]]},&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The interesting response is the one below.  The &amp;amp;quot;action&amp;amp;quot; parameter should be a function that accepts the npc as a first argument and the player as the second.  What you do then is up to you, but in our case we want the game to recognize that the player and black knight are now enemies.  A simple way to do that is to change the black knight's faction from &amp;amp;quot;players&amp;amp;quot; to &amp;amp;quot;enemies.&amp;amp;quot;  The response does not have a jump entry, so the Chat will end but since we are now enemies with the knight we can attack him to our heart's content.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        {[[&amp;amp;quot;So be it!&amp;amp;quot;]], action=function(npc, player)&lt;br /&gt;
            npc.faction = &amp;amp;quot;enemies&amp;amp;quot;&lt;br /&gt;
        },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Wait, there is one more thing!  We need to return the id of the initial round of dialog, in our case &amp;amp;quot;first.&amp;amp;quot;  This should be done at the end of the chat lua file.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;return &amp;amp;quot;first&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There, you are all done.  There are some more advanced chat features like conditional responses and for now you can dig into the ToME code if you want to discover those.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Randomizing chats&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to randomize chats just use tables as in the following example:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;greeting = {&amp;amp;quot;Hi&amp;amp;quot;, &amp;amp;quot;Hello&amp;amp;quot;, &amp;amp;quot;Good day&amp;amp;quot;, &amp;amp;quot;Bonjour&amp;amp;quot;, &amp;amp;quot;Greetings&amp;amp;quot;}&lt;br /&gt;
hope = {&amp;amp;quot;hope&amp;amp;quot;, &amp;amp;quot;trust&amp;amp;quot;, &amp;amp;quot;see&amp;amp;quot;, &amp;amp;quot;perceive&amp;amp;quot;}&lt;br /&gt;
&lt;br /&gt;
newChat{ id=&amp;amp;quot;hello&amp;amp;quot;,&lt;br /&gt;
    text = rng.table(greeting) .. &amp;amp;quot; @playername@! I &amp;amp;quot; .. rng.table(hope) .. &amp;amp;quot; your quest goes well.&amp;amp;quot;,&lt;br /&gt;
    answers = {&lt;br /&gt;
         {rng.table(greeting) .. &amp;amp;quot;!&amp;amp;quot;},&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Notice the use of rng.table(foo) to pick a random string and the use of &amp;amp;quot;..&amp;amp;quot; to combine the strings.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Conditional Answers and Jumps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An answer in the newChat answers table can have a cond variable with the following signature:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cond = function(npc, player)&lt;br /&gt;
...&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If the function returns true then the answer will appear in the chat, but if it returns false it will not.  You can use this to only allow certain options in dialogs after a sub-quest has been completed, or a certain item is in the player's inventory.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can also have a single answer send the player to various places using the action function.  In the action function above we did not bother with a return value, but if there is a return value that will be used as the next chat instead of the jump variable.  For example, say you want a NPC to offer the player a side quest only 20% of the times they talk.  You could do:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;action = function(npc, player)&lt;br /&gt;
    if rng.percent(20) then&lt;br /&gt;
        return &amp;amp;quot;offer quest&amp;amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        return &amp;amp;quot;regular response&amp;amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Factions&amp;diff=6166</id>
		<title>T4 Modules Howto Guide/Factions</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Factions&amp;diff=6166"/>
				<updated>2013-09-29T14:58:42Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Factions: Taking Sides!&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Factions seem reasonably simple.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In your load.lua file include the following line near the top:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local Faction = require &amp;amp;quot;engine.Faction&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Two default factions are already included, so there is no need to create them:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-- Add a few default factions&lt;br /&gt;
_M:add{ name=&amp;amp;quot;Players&amp;amp;quot;, reaction={enemies=-100} }&lt;br /&gt;
_M:add{ name=&amp;amp;quot;Enemies&amp;amp;quot;, reaction={players=-100} }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;engine/Actor.lua includes this line in all actor's init that sets the default faction to enemies:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;self.faction = t.faction or &amp;amp;quot;enemies&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;At the time of writing ToME's load.lua also includes two additional custom factions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-- Factions&lt;br /&gt;
Faction:add{ name=&amp;amp;quot;water lair&amp;amp;quot;, reaction={} }&lt;br /&gt;
Faction:add{ name=&amp;amp;quot;assassin lair&amp;amp;quot;, reaction={} }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Without initializing the reaction list, their reaction will be 0 to everyone, aka neutral.  This is so they start out neutral, and their reaction to the different sides can change depending on in-game actions.  In-game the reactions are modified using the following code:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Faction:setFactionReaction(&amp;amp;quot;assassin-lair&amp;amp;quot;, &amp;amp;quot;players&amp;amp;quot;, -100, true)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now the assassin lair and players factions hate each other (notice the true, which means the feeling is mutual).  The setFactionReaction function uses the faction short names, which are either set explicity in the Faction:add function or are the lowercase version of the faction name with all spaces replaces with &amp;amp;quot;-&amp;amp;quot;s.  The above code will only work when in-game, though, and that means not in load.lua.  To modify reactions in load.lua you can use the Faction:setInitialReaction function with the exact same parameters as Faction:setFactionReaction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To make use of custom factions, the actor's faction variable need to be set to the desired faction.  For naturally faction creatures this can be set in the NPC definition.  For summoned creatures this is set in the talent's code when summoning and creating the creature(setting it to faction &amp;amp;quot;players&amp;amp;quot;).  Custom Actor generators may also make use of this.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to test for reaction, whether an Actor should be hostile to another, you can use the reactionToward() method.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;self:reactionToward(target)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For traps, you can set it so they only trigger against Actors hostile to themselves.  For instance, this is a modification of the ToME base elemental trap:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newEntity{ define_as = &amp;amp;quot;TRAP_ELEMENTAL&amp;amp;quot;,&lt;br /&gt;
    type = &amp;amp;quot;elemental&amp;amp;quot;, id_by_type=true, unided_name = &amp;amp;quot;trap&amp;amp;quot;,&lt;br /&gt;
    display = '^',&lt;br /&gt;
    triggered = function(self, x, y, who)&lt;br /&gt;
        if who:reactionToward(self) &amp;amp;lt; 0 then&lt;br /&gt;
            self:project({type=&amp;amp;quot;hit&amp;amp;quot;,x=x,y=y}, x, y, self.damtype, self.dam, self.particles and {type=self.particles})&lt;br /&gt;
            return true&lt;br /&gt;
        else&lt;br /&gt;
            return false&lt;br /&gt;
        end&lt;br /&gt;
    end,&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you have multiple factions that players can belong to, make sure to set the faction on the player as late as possible in the descriptor tree [That is, if you had &amp;amp;quot;race&amp;amp;quot;, &amp;amp;quot;subrace&amp;amp;quot;, and &amp;amp;quot;class&amp;amp;quot; in that order, you'd want to set it at &amp;amp;quot;class&amp;amp;quot;]. You will also want to put the statement in a copy block, as earlier copy blocks (like that used by the default faction) will over-ride later options that aren't.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;copy = {&lt;br /&gt;
    faction = &amp;amp;quot;yourfactionhere&amp;amp;quot;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=6165</id>
		<title>T4 Modules Howto Guide/Character Sheet Dialogs</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=6165"/>
				<updated>2013-09-29T14:58:32Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Character Sheet&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Player Display&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A Player Display is the sidebar usually on the left that gives you a quick summary of your stats and status.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create your own Player Display, create and copy the following code into your module's /class/PlayerDisplay.lua file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.make)&lt;br /&gt;
&lt;br /&gt;
function _M:init(x, y, w, h, bgcolor, font, size)&lt;br /&gt;
    self.display_x = x&lt;br /&gt;
    self.display_y = y&lt;br /&gt;
    self.w, self.h = w, h&lt;br /&gt;
    self.bgcolor = bgcolor&lt;br /&gt;
    self.font = core.display.newFont(font, size)&lt;br /&gt;
    self:resize(x, y, w, h)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Resize the display area&lt;br /&gt;
function _M:resize(x, y, w, h)&lt;br /&gt;
    self.display_x, self.display_y = x, y&lt;br /&gt;
    self.w, self.h = w, h&lt;br /&gt;
    self.font_h = self.font:lineSkip()&lt;br /&gt;
    self.font_w = self.font:size(&amp;amp;quot; &amp;amp;quot;)&lt;br /&gt;
    self.bars_x = self.font_w * 9&lt;br /&gt;
    self.bars_w = self.w - self.bars_x - 5&lt;br /&gt;
    self.surface = core.display.newSurface(w, h)&lt;br /&gt;
    self.surface_line = core.display.newSurface(w, self.font_h)&lt;br /&gt;
    self.texture = self.surface:glTexture()&lt;br /&gt;
&lt;br /&gt;
    self.items = {}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:makeTexture(text, x, y, r, g, b, max_w)&lt;br /&gt;
    local s = self.surface_line&lt;br /&gt;
    s:erase(0, 0, 0, 0)&lt;br /&gt;
    s:drawColorStringBlended(self.font, text, 0, 0, r, g, b, true, max_w)&lt;br /&gt;
&lt;br /&gt;
    local item = { s:glTexture() }&lt;br /&gt;
    item.x = x&lt;br /&gt;
    item.y = y&lt;br /&gt;
    item.w = self.w&lt;br /&gt;
    item.h = self.font_h&lt;br /&gt;
    self.items[#self.items+1] = item&lt;br /&gt;
&lt;br /&gt;
    return item.w, item.h, item.x, item.y&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:makeTextureBar(text, nfmt, val, max, reg, x, y, r, g, b, bar_col, bar_bgcol)&lt;br /&gt;
    local s = self.surface_line&lt;br /&gt;
    s:erase(0, 0, 0, 0)&lt;br /&gt;
    s:erase(bar_bgcol.r, bar_bgcol.g, bar_bgcol.b, 255, self.bars_x, h, self.bars_w, self.font_h)&lt;br /&gt;
    s:erase(bar_col.r, bar_col.g, bar_col.b, 255, self.bars_x, h, self.bars_w * val / max, self.font_h)&lt;br /&gt;
&lt;br /&gt;
    s:drawColorStringBlended(self.font, text, 0, 0, r, g, b, true)&lt;br /&gt;
    s:drawColorStringBlended(self.font, (nfmt or &amp;amp;quot;%d/%d&amp;amp;quot;):format(val, max), self.bars_x + 5, 0, r, g, b)&lt;br /&gt;
    if reg and reg ~= 0 then&lt;br /&gt;
        local reg_txt = (&amp;amp;quot; (%s%.2f)&amp;amp;quot;):format((reg &amp;amp;gt; 0 and &amp;amp;quot;+&amp;amp;quot;) or &amp;amp;quot;&amp;amp;quot;,reg)&lt;br /&gt;
        local reg_txt_w = self.font:size(reg_txt)&lt;br /&gt;
        s:drawColorStringBlended(self.font, reg_txt, self.bars_x + self.bars_w - reg_txt_w - 3, 0, r, g, b)&lt;br /&gt;
    end&lt;br /&gt;
    local item = { s:glTexture() }&lt;br /&gt;
    item.x = x&lt;br /&gt;
    item.y = y&lt;br /&gt;
    item.w = self.w&lt;br /&gt;
    item.h = self.font_h&lt;br /&gt;
    self.items[#self.items+1] = item&lt;br /&gt;
&lt;br /&gt;
    return item.w, item.h, item.x, item.y&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Displays the stats&lt;br /&gt;
function _M:display()&lt;br /&gt;
    local player = game.player&lt;br /&gt;
    if not player or not player.changed or not game.level then return end&lt;br /&gt;
&lt;br /&gt;
    self.items = {}&lt;br /&gt;
&lt;br /&gt;
    local h = 6&lt;br /&gt;
    local x = 2&lt;br /&gt;
    &lt;br /&gt;
    self.font:setStyle(&amp;amp;quot;bold&amp;amp;quot;)&lt;br /&gt;
    self:makeTexture((&amp;amp;quot;%s#{normal}#&amp;amp;quot;):format(player.name), 0, h, colors.GOLD.r, colors.GOLD.g, colors.GOLD.b, self.w) h = h + self.font_h&lt;br /&gt;
    self.font:setStyle(&amp;amp;quot;normal&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    self:makeTexture((&amp;amp;quot;Str/Dex/Con: #00ff00#%3d/%3d/%3d&amp;amp;quot;):format(player:getStr(), player:getDex(), player:getCon()), x, h, 255, 255, 255) h = h + self.font_h&lt;br /&gt;
    &lt;br /&gt;
    h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    self:makeTextureBar(&amp;amp;quot;#c00000#Life:&amp;amp;quot;, nil, player.life, player.max_life, player.life_regen * util.bound((player.healing_factor or 1), 0, 2.5), x, h, 255, 255, 255, colors.DARK_RED, colors.VERY_DARK_RED) h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    self:makeTextureBar(&amp;amp;quot;#ffcc80#Power:&amp;amp;quot;, nil, player:getPower(), player.max_power, player.power_regen, x, h, 255, 255, 255, colors.DARK_BLUE, {r=colors.DARK_BLUE.r/2, g=colors.DARK_BLUE.g/2, b=colors.DARK_BLUE.b/2}) h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    if savefile_pipe.saving then&lt;br /&gt;
        h = h + self.font_h&lt;br /&gt;
        self:makeTextureBar(&amp;amp;quot;Saving:&amp;amp;quot;, &amp;amp;quot;%d%%&amp;amp;quot;, 100 * savefile_pipe.current_nb / savefile_pipe.total_nb, 100, nil, x, h, colors.YELLOW.r, colors.YELLOW.g, colors.YELLOW.b, &lt;br /&gt;
        {r=49, g=54,b=42},{r=17, g=19, b=0})&lt;br /&gt;
&lt;br /&gt;
        h = h + self.font_h&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:toScreen(nb_keyframes)&lt;br /&gt;
    self:display()&lt;br /&gt;
    &lt;br /&gt;
    core.display.drawQuad(self.display_x, self.display_y, self.w, self.h, 100,100,100, 200)&lt;br /&gt;
    &lt;br /&gt;
    for i = 1, #self.items do&lt;br /&gt;
        local item = self.items[i]&lt;br /&gt;
        if type(item) == &amp;amp;quot;table&amp;amp;quot; then&lt;br /&gt;
            if item.glow then&lt;br /&gt;
                local glow = (1+math.sin(core.game.getTime() / 500)) / 2 * 100 + 120&lt;br /&gt;
                item[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, item.w, item.h, item[2], item[3], 1, 1, 1, glow / 255)&lt;br /&gt;
            else&lt;br /&gt;
                item[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, item.w, item.h, item[2], item[3])&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            item(self.display_x, self.display_y)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The class is now defined, but your game still has to be told to display it.  Add the following near to the top of your Game.lua file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local PlayerDisplay = require &amp;amp;quot;mod.class.PlayerDisplay&amp;amp;quot; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Then in the run function add&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.player_display = PlayerDisplay.new(0, 0, 200, self.h, {30,30,0}, &amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Also modify the LogFlasher's x position so it does not render underneath the PlayerDisplay. Change it as following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.flash = LogFlasher.new(208, 0, self.w, 20, nil, nil, nil, {255,255,255}, {0,0,0}) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;And finally find the display method and insert the following line:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.player_display:toScreen(nb_keyframe) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;And you are done, you should now have a working PlayerDisplay that you can modify to suit your needs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Character Sheet&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In the example module, you may notice that pressing 'C' causes an exception to occur due to a missing /dialogs/CharacterSheet.lua&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Following is two example CharacterSheet Dialogs you can use in your own module. Simply paste one of these into your /dialogs/CharacterSheet.lua, start the game and press 'C' to see how it looks.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc3&amp;quot;&amp;gt;Simple example&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This example is a very basic bare-bones Character sheet that can be customized any way necessarily. Simply update the drawDialog method with the information you wish to display of your own module.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
local Dialog = require &amp;amp;quot;engine.ui.Dialog&amp;amp;quot;&lt;br /&gt;
local Talents = require &amp;amp;quot;engine.interface.ActorTalents&amp;amp;quot;&lt;br /&gt;
local SurfaceZone = require &amp;amp;quot;engine.ui.SurfaceZone&amp;amp;quot;&lt;br /&gt;
local Stats = require &amp;amp;quot;engine.interface.ActorStats&amp;amp;quot;&lt;br /&gt;
local Textzone = require &amp;amp;quot;engine.ui.Textzone&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(Dialog))&lt;br /&gt;
&lt;br /&gt;
function _M:init(actor)&lt;br /&gt;
    self.actor = actor&lt;br /&gt;
    &lt;br /&gt;
    self.font = core.display.newFont(&amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12)&lt;br /&gt;
    Dialog.init(self, &amp;amp;quot;Character Sheet: &amp;amp;quot;..self.actor.name, math.max(game.w * 0.7, 950), 500, nil, nil, font)&lt;br /&gt;
    &lt;br /&gt;
    self.c_desc = SurfaceZone.new{width=self.iw, height=self.ih,alpha=0}&lt;br /&gt;
&lt;br /&gt;
    self:loadUI{&lt;br /&gt;
        {left=0, top=0, ui=self.c_desc},&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    self:setupUI()&lt;br /&gt;
    &lt;br /&gt;
    self:drawDialog()&lt;br /&gt;
    &lt;br /&gt;
    self.key:addBind(&amp;amp;quot;EXIT&amp;amp;quot;, function() cs_player_dup = game.player:clone() game:unregisterDialog(self) end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:drawDialog()&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
    local s = self.c_desc.s&lt;br /&gt;
&lt;br /&gt;
    s:erase(0,0,0,0)&lt;br /&gt;
&lt;br /&gt;
    local h = 0&lt;br /&gt;
    local w = 0&lt;br /&gt;
&lt;br /&gt;
    h = 0&lt;br /&gt;
    w = 0&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;Name : &amp;amp;quot;..(player.name or &amp;amp;quot;Unnamed&amp;amp;quot;), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;Role : &amp;amp;quot;..(player.descriptor.role or player.type:capitalize()), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
    h = h + self.font_h -- Adds an empty row&lt;br /&gt;
    &lt;br /&gt;
    h = 0&lt;br /&gt;
    w = self.w * 0.25 &lt;br /&gt;
    -- start on second column&lt;br /&gt;
        &lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;STR : &amp;amp;quot;..(player:getStr()), w, h, 0, 255, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;DEX : &amp;amp;quot;..(player:getDex()), w, h, 255, 0, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;CON : &amp;amp;quot;..(player:getCon()), w, h, 255, 255, 0, true) h = h + self.font_h&lt;br /&gt;
    &lt;br /&gt;
    self.c_desc:generate()&lt;br /&gt;
    self.changed = false&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc4&amp;quot;&amp;gt;Complex example&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This example is a cut down version of the character sheet used in ToME. It includes tabs, tooltips and the ability to dump your character to a text file. Simply update the drawDialog method with the information you wish to display of your own module.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To see how the ToME character sheet performs some of its more advanced functions, refer to its source code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
local Dialog = require &amp;amp;quot;engine.ui.Dialog&amp;amp;quot;&lt;br /&gt;
local Talents = require &amp;amp;quot;engine.interface.ActorTalents&amp;amp;quot;&lt;br /&gt;
local Tab = require &amp;amp;quot;engine.ui.Tab&amp;amp;quot;&lt;br /&gt;
local SurfaceZone = require &amp;amp;quot;engine.ui.SurfaceZone&amp;amp;quot;&lt;br /&gt;
local Separator = require &amp;amp;quot;engine.ui.Separator&amp;amp;quot;&lt;br /&gt;
local Stats = require &amp;amp;quot;engine.interface.ActorStats&amp;amp;quot;&lt;br /&gt;
local Textzone = require &amp;amp;quot;engine.ui.Textzone&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(Dialog))&lt;br /&gt;
&lt;br /&gt;
function _M:init(actor)&lt;br /&gt;
    self.actor = actor&lt;br /&gt;
    Dialog.init(self, &amp;amp;quot;Character Sheet: &amp;amp;quot;..self.actor.name, math.max(game.w * 0.7, 950), 500)&lt;br /&gt;
&lt;br /&gt;
    self.font = core.display.newFont(&amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12)&lt;br /&gt;
    self.font_h = self.font:lineSkip()&lt;br /&gt;
&lt;br /&gt;
    self.c_general = Tab.new{title=&amp;amp;quot;General&amp;amp;quot;, default=true, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;general&amp;amp;quot;) end end}&lt;br /&gt;
    self.c_attack = Tab.new{title=&amp;amp;quot;Attack&amp;amp;quot;, default=false, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;attack&amp;amp;quot;) end end}&lt;br /&gt;
    self.c_defence = Tab.new{title=&amp;amp;quot;Defense&amp;amp;quot;, default=false, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;defence&amp;amp;quot;) end end}&lt;br /&gt;
&lt;br /&gt;
    local tw, th = self.font_bold:size(self.title)&lt;br /&gt;
&lt;br /&gt;
    self.vs = Separator.new{dir=&amp;amp;quot;vertical&amp;amp;quot;, size=self.iw}&lt;br /&gt;
&lt;br /&gt;
    self.c_tut = Textzone.new{width=self.iw * 0.6, auto_height=true, no_color_bleed=true, font = self.font, text=[[&lt;br /&gt;
Keyboard: #00FF00#'d'#LAST# to save character dump. #00FF00#TAB key#LAST# to switch between tabs.&lt;br /&gt;
Mouse: Hover over stat for info&lt;br /&gt;
]]}&lt;br /&gt;
&lt;br /&gt;
    self.c_desc = SurfaceZone.new{width=self.iw, height=self.ih - self.c_general.h - self.vs.h - self.c_tut.h,alpha=0}&lt;br /&gt;
&lt;br /&gt;
    self.hoffset = 17 + self.c_tut.h + self.vs.h + self.c_general.h&lt;br /&gt;
&lt;br /&gt;
    self:loadUI{&lt;br /&gt;
        {left=0, top=0, ui=self.c_tut},&lt;br /&gt;
        {left=15, top=self.c_tut.h, ui=self.c_general},&lt;br /&gt;
        {left=15+self.c_general.w, top=self.c_tut.h, ui=self.c_attack},&lt;br /&gt;
        {left=15+self.c_general.w+self.c_attack.w, top=self.c_tut.h, ui=self.c_defence},&lt;br /&gt;
        {left=0, top=self.c_tut.h + self.c_general.h, ui=self.vs},&lt;br /&gt;
&lt;br /&gt;
        {left=0, top=self.c_tut.h + self.c_general.h + 5 + self.vs.h, ui=self.c_desc},&lt;br /&gt;
    }&lt;br /&gt;
    self:setFocus(self.c_general)&lt;br /&gt;
    self:setupUI()&lt;br /&gt;
&lt;br /&gt;
    self:switchTo(&amp;amp;quot;general&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    self:updateKeys()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:switchTo(kind)&lt;br /&gt;
    self:drawDialog(kind, cs_player_dup)&lt;br /&gt;
    if kind == &amp;amp;quot;general&amp;amp;quot; then self.c_attack.selected = false self.c_defence.selected = false&lt;br /&gt;
    elseif kind == &amp;amp;quot;attack&amp;amp;quot; then self.c_general.selected = false self.c_defence.selected = false&lt;br /&gt;
    elseif kind == &amp;amp;quot;defence&amp;amp;quot; then self.c_attack.selected = false self.c_general.selected = false&lt;br /&gt;
    end&lt;br /&gt;
    self:updateKeys()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:updateKeys()&lt;br /&gt;
    self.key:addCommands{&lt;br /&gt;
    _TAB = function() self:tabTabs() end,&lt;br /&gt;
    __TEXTINPUT = function(c)&lt;br /&gt;
        if c == 'd' or c == 'D' then&lt;br /&gt;
            self:dump()&lt;br /&gt;
        end&lt;br /&gt;
    end,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    self.key:addBinds{&lt;br /&gt;
        EXIT = function() cs_player_dup = game.player:clone() game:unregisterDialog(self) end,&lt;br /&gt;
    }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:tabTabs()&lt;br /&gt;
    if self.c_general.selected == true then self.c_attack:select() elseif&lt;br /&gt;
    self.c_attack.selected == true then self.c_defence:select() elseif&lt;br /&gt;
    self.c_defence.selected == true then self.c_general:select() end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:mouseTooltip(text, _, _, _, w, h, x, y)&lt;br /&gt;
    self:mouseZones({&lt;br /&gt;
        { x=x, y=y+self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) end},&lt;br /&gt;
    }, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:mouseZones(t, no_new)&lt;br /&gt;
    -- Offset the x and y with the window position and window title&lt;br /&gt;
    if not t.norestrict then&lt;br /&gt;
        for i, z in ipairs(t) do&lt;br /&gt;
            if not z.norestrict then&lt;br /&gt;
                z.x = z.x + self.display_x + 5&lt;br /&gt;
                z.y = z.y + self.display_y + 20 + 3&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if not no_new then self.mouse = engine.Mouse.new() end&lt;br /&gt;
    self.mouse:registerZones(t)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:drawDialog(kind)&lt;br /&gt;
    self.mouse:reset()&lt;br /&gt;
&lt;br /&gt;
    self:setupUI()&lt;br /&gt;
&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
    local s = self.c_desc.s&lt;br /&gt;
&lt;br /&gt;
    s:erase(0,0,0,0)&lt;br /&gt;
&lt;br /&gt;
    local h = 0&lt;br /&gt;
    local w = 0&lt;br /&gt;
&lt;br /&gt;
    if kind == &amp;amp;quot;general&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;Name : &amp;amp;quot;..(player.name or &amp;amp;quot;Unnamed&amp;amp;quot;), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;Role : &amp;amp;quot;..(player.descriptor.role or player.type:capitalize()), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
        h = h + self.font_h -- Adds an empty row&lt;br /&gt;
        &lt;br /&gt;
        -- Draw some text with an attatched tooltip&lt;br /&gt;
        self:mouseTooltip([[#GOLD#A Tooltip!!#LAST#]], s:drawColorStringBlended(self.font, (&amp;amp;quot;#c00000#Life: #00ff00#%d/%d&amp;amp;quot;):format(player.life, player.max_life), w, h, 255, 255, 255, true)) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
        h = 0&lt;br /&gt;
        w = self.w * 0.25 &lt;br /&gt;
        -- start on second column&lt;br /&gt;
        &lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;STR : &amp;amp;quot;..(player:getStr()), w, h, 0, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;DEX : &amp;amp;quot;..(player:getDex()), w, h, 255, 0, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;CON : &amp;amp;quot;..(player:getCon()), w, h, 255, 255, 0, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
    elseif kind==&amp;amp;quot;attack&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        &lt;br /&gt;
        -- draw the attack tab here&lt;br /&gt;
&lt;br /&gt;
    elseif kind==&amp;amp;quot;defence&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        &lt;br /&gt;
        -- draw the defence tab here&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    self.c_desc:generate()&lt;br /&gt;
    self.changed = false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:dump()&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
&lt;br /&gt;
    fs.mkdir(&amp;amp;quot;/character-dumps&amp;amp;quot;)&lt;br /&gt;
    local file = &amp;amp;quot;/character-dumps/&amp;amp;quot;..(player.name:gsub(&amp;amp;quot;[^a-zA-Z0-9_-.]&amp;amp;quot;, &amp;amp;quot;_&amp;amp;quot;))..&amp;amp;quot;-&amp;amp;quot;..os.date(&amp;amp;quot;%Y%m%d-%H%M%S&amp;amp;quot;)..&amp;amp;quot;.txt&amp;amp;quot;&lt;br /&gt;
    local fff = fs.open(file, &amp;amp;quot;w&amp;amp;quot;)&lt;br /&gt;
    local labelwidth = 17&lt;br /&gt;
    local w1 = function(s) s = s or &amp;amp;quot;&amp;amp;quot; fff:write(s:removeColorCodes()) fff:write(&amp;amp;quot;\n&amp;amp;quot;) end&lt;br /&gt;
    --prepare label and value&lt;br /&gt;
    local makelabel = function(s,r) while s:len() &amp;amp;lt; labelwidth do s = s..&amp;amp;quot; &amp;amp;quot; end return (&amp;amp;quot;%s: %s&amp;amp;quot;):format(s, r) end&lt;br /&gt;
&lt;br /&gt;
    w1(&amp;amp;quot;  [MyModule Character Dump]&amp;amp;quot;)&lt;br /&gt;
    w1()&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;%-32s&amp;amp;quot;):format(makelabel(&amp;amp;quot;Name&amp;amp;quot;, player.name)))&lt;br /&gt;
    w1((&amp;amp;quot;%-32s&amp;amp;quot;):format(makelabel(&amp;amp;quot;Role&amp;amp;quot;, player.descriptor.role or player.type:capitalize())))&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;STR:  %d&amp;amp;quot;):format(player:getStr()))&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;DEX:  %d&amp;amp;quot;):format(player:getDex()))&lt;br /&gt;
&lt;br /&gt;
    w1((&amp;amp;quot;CON:  %d&amp;amp;quot;):format(player:getCon()))&lt;br /&gt;
&lt;br /&gt;
    fff:close()&lt;br /&gt;
&lt;br /&gt;
    Dialog:simplePopup(&amp;amp;quot;Character dump complete&amp;amp;quot;, &amp;amp;quot;File: &amp;amp;quot;..fs.getRealPath(file))&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Dialogs&amp;diff=6164</id>
		<title>Dialogs</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Dialogs&amp;diff=6164"/>
				<updated>2013-09-29T14:58:18Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc29&amp;quot;&amp;gt;Dialogs - Customizing your UI experience&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc30&amp;quot;&amp;gt;Drawing Dialogs&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The draw code for dialogs can be customized by overriding the drawDialog(s) function in your custom dialog class.  The passed 's' represents the passed sdl surface.  Always use this to draw.  Though the Dialog class has a Dialog.surface property, it is the whole dialog surface including the borders and title.  The passed s is just the internal surface of the dialog.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To draw text, 3 functions are provided on the surface for drawing of text:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Function&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;drawString&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Draws uncolored strings.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;drawColoredString&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Draws colored strings.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;drawColoredStringCentered&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Draws centered colored strings.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To illustrate, here is code from ToME's CharacterSheet.lua:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local h = 0&lt;br /&gt;
local w = 0&lt;br /&gt;
s:drawString(self.font, &amp;amp;quot;Sex:   &amp;amp;quot;..game.player.descriptor.sex, w, h, 0, 200, 255) h = h + self.font_h&lt;br /&gt;
s:drawString(self.font, &amp;amp;quot;Race:  &amp;amp;quot;..game.player.descriptor.subrace, w, h, 0, 200, 255) h = h + self.font_h&lt;br /&gt;
s:drawString(self.font, &amp;amp;quot;Class: &amp;amp;quot;..game.player.descriptor.subclass, w, h, 0, 200, 255) h = h + self.font_h&lt;br /&gt;
h = h + self.font_h&lt;br /&gt;
s:drawColorString(self.font, &amp;amp;quot;Level: #00ff00#&amp;amp;quot;..game.player.level, w, h, 255, 255, 255) h = h + self.font_h&lt;br /&gt;
s:drawColorString(self.font, (&amp;amp;quot;Exp:  #00ff00#%2d%%&amp;amp;quot;):format(100 * cur_exp / max_exp), w, h, 255, 255, 255) h = h + self.font_h&lt;br /&gt;
s:drawColorString(self.font, (&amp;amp;quot;Gold: #00ff00#%0.2f&amp;amp;quot;):format(game.player.money), w, h, 255, 255, 255) h = h + self.font_h &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The parameters for all 3 drawstring methods are identical, and are as follows:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Parameter&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;font&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Font object.  Unless you want to draw different parts of your dialog with different fonts, this will always be self.font (the dialog's set font).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;v&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Text.  The ColorString variants recognise the replacement #xxxxxx#.  This is a color code value, with 2 characters per r, g and b in hex(0-f). Lua text:format() method is advised to output numbers.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;x&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;x position coordinate of text. Unless its a monospaced font, every character can potentially have a different width.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;y&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;y position coordinate of text. self.font:lineSkip() can be used to get the font height.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;r&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Red color value of text. (0-255)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;g&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Green color value of text. (0-255)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;b&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Blue color value of text. (0-255)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc31&amp;quot;&amp;gt;Drawing Images&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To load an image the simpliest way is to do:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local img = core.display.loadImage(&amp;amp;quot;/data/..../foo.png&amp;amp;quot;) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Then you can draw it on an other surface with:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; dest:merge(img, x, y) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can also directly display a surface on screen:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; img:toScreen(x, y) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If the surface wont change later you can make an opengl texture from it to speed up rendering:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local tex = im:glTexture() &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
and display it:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; tex:toScreen(x, y, w, h) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
You can actually update the texture if the surface changes (this is how dialogs work internally) this is faster than just drawing the surface.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc32&amp;quot;&amp;gt;Player Display&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Player Displays is the quick summary of stats you get on the left side while playing.  This is related to dialogs, but this class does not inherit from the dialog class.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;ToME implements this by defining a display() function in the PlayerDisplay.lua class and calling it in game:display(), updating the surface whenever the player's changed property is true.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc33&amp;quot;&amp;gt;Registering and Displaying Dialogs&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Displaying dialogs from code is simple:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local d = CustomDialog.new()&lt;br /&gt;
game:registerDialog(d) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To remove it(usually called from the dialog itself):&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; game:unregisterDialog(self) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This will set the dialog to open and display.  If key or mousebindings are set for the dialog, these will also be made current.  Note that dialogs do not automatically pause the game.  In real-time games the action will continue, and even in turn-based games, animations and particles will continue in the background.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Most Dialogs will also need keyboard or mouse bindings.  You use the following methods to define these in the dialog's init() function:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;keyCommands(KeyCommands, KeyBinds)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sets keyboard keys recognised by this dialog. KeyCommands and KeyBinds are tables containing keyboard binding functions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;mouseZones(zones)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sets a table of mouse zones recognised by the dialog.  Note that the x and y coordinates are automatically offset by the dialog's extents.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc34&amp;quot;&amp;gt;Keyboard Input&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Manually setting keyCommands are strongly unadvised.  Use keyBindings whenever possible, since these can be remapped by the user.  There are however some exceptions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;keyCommand&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;_ _DEFAULT&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Matches any key press.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;_ _TEXTINPUT&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Used to receive alphanumeric text from keyboard.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This example code is taken from ToME's DeathDialog.lua:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self:keyCommands({&lt;br /&gt;
    __TEXTINPUT = function(c)&lt;br /&gt;
        if c == 'd' or c == 'D' then&lt;br /&gt;
            self:dump()&lt;br /&gt;
        end&lt;br /&gt;
    end,&lt;br /&gt;
}, {&lt;br /&gt;
    ACCEPT = &amp;amp;quot;EXIT&amp;amp;quot;,&lt;br /&gt;
    EXIT = function()&lt;br /&gt;
        game:unregisterDialog(self)&lt;br /&gt;
    end,&lt;br /&gt;
}) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Inventory_Dialogs&amp;diff=6163</id>
		<title>T4 Modules Howto Guide/Inventory Dialogs</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Inventory_Dialogs&amp;diff=6163"/>
				<updated>2013-09-29T14:58:05Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Inventory and Equipment Dialogs&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This section assumes that objects and inventory has already been enabled by following the instructions in the [[Objects]] guide.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Picking up and dropping items&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;To start, lets add the ability to actually pickup and drop items.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;First, in your Game.lua file, find the setupCommands() method.  Inside this method add the following entry to the self.key:addBinds command:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; PICKUP_FLOOR = function()&lt;br /&gt;
    if self.player.no_inventory_access then return end&lt;br /&gt;
    self.player:playerPickup()&lt;br /&gt;
end,&lt;br /&gt;
DROP_FLOOR = function()&lt;br /&gt;
    if self.player.no_inventory_access then return end&lt;br /&gt;
    self.player:playerDrop()&lt;br /&gt;
end, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This allows the pickup and drop commands to be mapped, which causes the player:playerPickup() or player:playerDrop() methods to execute. Now lets add these methods to the Player.lua file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; function _M:playerPickup()&lt;br /&gt;
    -- If 2 or more objects, display a pickup dialog, otherwise just picks up&lt;br /&gt;
    if game.level.map:getObject(self.x, self.y, 2) then&lt;br /&gt;
        local d d = self:showPickupFloor(&amp;amp;quot;Pickup&amp;amp;quot;, nil, function(o, item)&lt;br /&gt;
            self:pickupFloor(item, true)&lt;br /&gt;
            self.changed = true&lt;br /&gt;
            d:used()&lt;br /&gt;
        end)&lt;br /&gt;
    else&lt;br /&gt;
        self:pickupFloor(1, true)&lt;br /&gt;
        self:sortInven()&lt;br /&gt;
        self:useEnergy()&lt;br /&gt;
    self.changed = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:playerDrop()&lt;br /&gt;
    local inven = self:getInven(self.INVEN_INVEN)&lt;br /&gt;
    local d d = self:showInventory(&amp;amp;quot;Drop object&amp;amp;quot;, inven, nil, function(o, item)&lt;br /&gt;
        self:dropFloor(inven, item, true, true)&lt;br /&gt;
        self:sortInven(inven)&lt;br /&gt;
        self:useEnergy()&lt;br /&gt;
        self.changed = true&lt;br /&gt;
        return true&lt;br /&gt;
    end)&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now you can play and pick up and drop your items!&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Inventory and equipment Screen&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now that you can pick up and drop items, you need to be able to obtain an inventory list and equip items.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;First, as above, add the following to the key mappings in Game.lua:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; SHOW_INVENTORY = function()&lt;br /&gt;
    if self.player.no_inventory_access then return end&lt;br /&gt;
    local d&lt;br /&gt;
    d = self.player:showEquipInven(&amp;amp;quot;Inventory&amp;amp;quot;, nil, function(o, inven, item, button, event)&lt;br /&gt;
        if not o then return end&lt;br /&gt;
        local ud = require(&amp;amp;quot;mod.dialogs.UseItemDialog&amp;amp;quot;).new(event == &amp;amp;quot;button&amp;amp;quot;, self.player, o, item, inven, function(_, _, _, stop)&lt;br /&gt;
            d:generate()&lt;br /&gt;
            d:generateList()&lt;br /&gt;
            if stop then self:unregisterDialog(d) end&lt;br /&gt;
        end)&lt;br /&gt;
        self:registerDialog(ud)&lt;br /&gt;
    end)&lt;br /&gt;
end, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once done, you can try run the game and enjoy your new inventory listing.  You may however notice that the game will crash if you try to actually use or equip anything in your inventory.  This is because we have not yet defined the UseItemDialog.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In your module's Dialogs directory, create a new file file UseItemDialog.lua and paste the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
require &amp;amp;quot;engine.ui.Dialog&amp;amp;quot;&lt;br /&gt;
local List = require &amp;amp;quot;engine.ui.List&amp;amp;quot;&lt;br /&gt;
local Savefile = require &amp;amp;quot;engine.Savefile&amp;amp;quot;&lt;br /&gt;
local Map = require &amp;amp;quot;engine.Map&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(engine.ui.Dialog))&lt;br /&gt;
&lt;br /&gt;
function _M:init(center_mouse, actor, object, item, inven, onuse)&lt;br /&gt;
    self.actor = actor&lt;br /&gt;
    self.object = object&lt;br /&gt;
    self.inven = inven&lt;br /&gt;
    self.item = item&lt;br /&gt;
    self.onuse = onuse&lt;br /&gt;
&lt;br /&gt;
    self:generateList()&lt;br /&gt;
    local name = object:getName()&lt;br /&gt;
    local w = self.font_bold:size(name)&lt;br /&gt;
    engine.ui.Dialog.init(self, name, 1, 1)&lt;br /&gt;
&lt;br /&gt;
    local list = List.new{width=math.max(w, self.max) + 10, nb_items=#self.list, list=self.list, fct=function(item) self:use(item) end}&lt;br /&gt;
&lt;br /&gt;
    self:loadUI{&lt;br /&gt;
        {left=0, top=0, ui=list},&lt;br /&gt;
    }&lt;br /&gt;
    self:setupUI(true, true, function(w, h)&lt;br /&gt;
        if center_mouse then&lt;br /&gt;
            local mx, my = core.mouse.get()&lt;br /&gt;
            self.force_x = mx - w / 2&lt;br /&gt;
            self.force_y = my - (self.h - self.ih + list.fh / 3)&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
&lt;br /&gt;
    self.key:addBinds{ EXIT = function() game:unregisterDialog(self) end, }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:use(item)&lt;br /&gt;
    if not item then return end&lt;br /&gt;
    game:unregisterDialog(self)&lt;br /&gt;
&lt;br /&gt;
    local act = item.action&lt;br /&gt;
&lt;br /&gt;
    --if act == &amp;amp;quot;use&amp;amp;quot; then&lt;br /&gt;
        --self.actor:playerUseItem(self.object, self.item, self.inven, self.onuse)&lt;br /&gt;
        --self.onuse(self.inven, self.item, self.object, true)&lt;br /&gt;
    --else&lt;br /&gt;
    if act == &amp;amp;quot;drop&amp;amp;quot; then&lt;br /&gt;
        self.actor:doDrop(self.inven, self.item, function() self.onuse(self.inven, self.item, self.object, false) end)&lt;br /&gt;
    elseif act == &amp;amp;quot;wear&amp;amp;quot; then&lt;br /&gt;
        self.actor:doWear(self.inven, self.item, self.object)&lt;br /&gt;
        self.onuse(self.inven, self.item, self.object, false)&lt;br /&gt;
    elseif act == &amp;amp;quot;takeoff&amp;amp;quot; then&lt;br /&gt;
        self.actor:doTakeoff(self.inven, self.item, self.object)&lt;br /&gt;
        self.onuse(self.inven, self.item, self.object, false)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:generateList()&lt;br /&gt;
    local list = {}&lt;br /&gt;
&lt;br /&gt;
    --if self.object:canUseObject() then list[#list+1] = {name=&amp;amp;quot;Use&amp;amp;quot;, action=&amp;amp;quot;use&amp;amp;quot;} end&lt;br /&gt;
    if self.inven == self.actor.INVEN_INVEN and self.object:wornInven() and self.actor:getInven(self.object:wornInven()) then list[#list+1] = {name=&amp;amp;quot;Wield/Wear&amp;amp;quot;, action=&amp;amp;quot;wear&amp;amp;quot;} end&lt;br /&gt;
    if self.inven ~= self.actor.INVEN_INVEN and self.object:wornInven() then list[#list+1] = {name=&amp;amp;quot;Take off&amp;amp;quot;, action=&amp;amp;quot;takeoff&amp;amp;quot;} end&lt;br /&gt;
    if self.inven == self.actor.INVEN_INVEN then list[#list+1] = {name=&amp;amp;quot;Drop&amp;amp;quot;, action=&amp;amp;quot;drop&amp;amp;quot;} end&lt;br /&gt;
&lt;br /&gt;
    self.max = 0&lt;br /&gt;
    self.maxh = 0&lt;br /&gt;
    for i, v in ipairs(list) do&lt;br /&gt;
        local w, h = self.font:size(v.name)&lt;br /&gt;
        self.max = math.max(self.max, w)&lt;br /&gt;
        self.maxh = self.maxh + self.font_h&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    self.list = list&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In your Player.lua class file paste the following two functions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; function _M:doDrop(inven, item, on_done, nb)&lt;br /&gt;
    if self.no_inventory_access then return end&lt;br /&gt;
    &lt;br /&gt;
    if nb == nil or nb &amp;amp;gt;= self:getInven(inven)[item]:getNumber() then&lt;br /&gt;
        self:dropFloor(inven, item, true, true)&lt;br /&gt;
    else&lt;br /&gt;
        for i = 1, nb do self:dropFloor(inven, item, true) end&lt;br /&gt;
    end&lt;br /&gt;
    self:sortInven(inven)&lt;br /&gt;
    self:useEnergy()&lt;br /&gt;
    self.changed = true&lt;br /&gt;
    if on_done then on_done() end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:doWear(inven, item, o)&lt;br /&gt;
    self:removeObject(inven, item, true)&lt;br /&gt;
    local ro = self:wearObject(o, true, true)&lt;br /&gt;
    if ro then&lt;br /&gt;
        if type(ro) == &amp;amp;quot;table&amp;amp;quot; then self:addObject(inven, ro) end&lt;br /&gt;
    elseif not ro then&lt;br /&gt;
        self:addObject(inven, o)&lt;br /&gt;
    end&lt;br /&gt;
    self:sortInven()&lt;br /&gt;
    self:useEnergy()&lt;br /&gt;
    self.changed = true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:doTakeoff(inven, item, o)&lt;br /&gt;
    if self:takeoffObject(inven, item) then&lt;br /&gt;
        self:addObject(self.INVEN_INVEN, o)&lt;br /&gt;
    end&lt;br /&gt;
    self:sortInven()&lt;br /&gt;
    self:useEnergy()&lt;br /&gt;
    self.changed = true&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You should now be able to drop items from within the inventory screen as well as equip and takeoff items.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc3&amp;quot;&amp;gt;Consumable and activatable items&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Right now you can only &amp;amp;quot;wear&amp;amp;quot;, &amp;amp;quot;takeoff&amp;amp;quot;, &amp;amp;quot;pickup&amp;amp;quot; and &amp;amp;quot;drop&amp;amp;quot; items. This section deals with allowing objects to be &amp;amp;quot;used&amp;amp;quot;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;First, return to the UseItemDialog.lua file in the dialogs directory and uncomment the commented lines in the use and generateList methods.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next you need to add a new method to the object class to allow the code to check whether an object can be used.  If you have not already, this will involve actually creating an objects class.  Paste the following into the Object.lua class file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
require &amp;amp;quot;engine.Object&amp;amp;quot;&lt;br /&gt;
require &amp;amp;quot;engine.interface.ObjectActivable&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
local Stats = require(&amp;amp;quot;engine.interface.ActorStats&amp;amp;quot;)&lt;br /&gt;
local Talents = require(&amp;amp;quot;engine.interface.ActorTalents&amp;amp;quot;)&lt;br /&gt;
local DamageType = require(&amp;amp;quot;engine.DamageType&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(&lt;br /&gt;
    engine.Object,&lt;br /&gt;
    engine.interface.ObjectActivable,&lt;br /&gt;
    engine.interface.ActorTalents&lt;br /&gt;
))&lt;br /&gt;
&lt;br /&gt;
function _M:init(t, no_default)&lt;br /&gt;
    t.encumber = t.encumber or 0&lt;br /&gt;
&lt;br /&gt;
    engine.Object.init(self, t, no_default)&lt;br /&gt;
    engine.interface.ObjectActivable.init(self, t)&lt;br /&gt;
    engine.interface.ActorTalents.init(self, t)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:canAct()&lt;br /&gt;
    if self.power_regen or self.use_talent then return true end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:act()&lt;br /&gt;
    self:regenPower()&lt;br /&gt;
    self:cooldownTalents()&lt;br /&gt;
    self:useEnergy()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:use(who, typ, inven, item)&lt;br /&gt;
    inven = who:getInven(inven)&lt;br /&gt;
&lt;br /&gt;
    if self:wornInven() and not self.wielded and not self.use_no_wear then&lt;br /&gt;
        game.logPlayer(who, &amp;amp;quot;You must wear this object to use it!&amp;amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local types = {}&lt;br /&gt;
    if self:canUseObject() then types[#types+1] = &amp;amp;quot;use&amp;amp;quot; end&lt;br /&gt;
&lt;br /&gt;
    if not typ and #types == 1 then typ = types[1] end&lt;br /&gt;
&lt;br /&gt;
    if typ == &amp;amp;quot;use&amp;amp;quot; then&lt;br /&gt;
        local ret = {self:useObject(who, inven, item)}&lt;br /&gt;
        if ret[1] then&lt;br /&gt;
            if self.use_sound then game:playSoundNear(who, self.use_sound) end&lt;br /&gt;
            who:useEnergy(game.energy_to_act * (inven.use_speed or 1))&lt;br /&gt;
        end&lt;br /&gt;
        return unpack(ret)&lt;br /&gt;
    end&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You will also need to modify you Game.lua class: In the loaded function modify the Zone:setup call to also include your new Object class:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Zone:setup{npc_class=&amp;amp;quot;mod.class.NPC&amp;amp;quot;, grid_class=&amp;amp;quot;mod.class.Grid&amp;amp;quot;, object_class=&amp;amp;quot;mod.class.Object&amp;amp;quot;} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Also add the following function to the Player.lua class:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; function _M:playerUseItem(object, item, inven)&lt;br /&gt;
    local use_fct = function(o, inven, item)&lt;br /&gt;
        if not o then return end&lt;br /&gt;
        local co = coroutine.create(function()&lt;br /&gt;
            self.changed = true&lt;br /&gt;
&lt;br /&gt;
            local ret = o:use(self, nil, inven, item) or {}&lt;br /&gt;
            if not ret.used then return end&lt;br /&gt;
            if ret.destroy then&lt;br /&gt;
                if o.multicharge and o.multicharge &amp;amp;gt; 1 then&lt;br /&gt;
                    o.multicharge = o.multicharge - 1&lt;br /&gt;
                else&lt;br /&gt;
                    local _, del = self:removeObject(self:getInven(inven), item)&lt;br /&gt;
                    if del then&lt;br /&gt;
                        game.log(&amp;amp;quot;You have no more %s.&amp;amp;quot;, o:getName{no_count=true, do_color=true})&lt;br /&gt;
                    else&lt;br /&gt;
                        game.log(&amp;amp;quot;You have %s.&amp;amp;quot;, o:getName{do_color=true})&lt;br /&gt;
                    end&lt;br /&gt;
                    self:sortInven(self:getInven(inven))&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end)&lt;br /&gt;
        local ok, ret = coroutine.resume(co)&lt;br /&gt;
        if not ok and ret then print(debug.traceback(co)) error(ret) end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if object and item then return use_fct(object, inven, item) end&lt;br /&gt;
&lt;br /&gt;
    local titleupdator = self:getEncumberTitleUpdator(&amp;amp;quot;Use object&amp;amp;quot;)&lt;br /&gt;
    self:showEquipInven(titleupdator(),&lt;br /&gt;
        function(o)&lt;br /&gt;
            return o:canUseObject()&lt;br /&gt;
        end,&lt;br /&gt;
        use_fct&lt;br /&gt;
    )&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Congratulations, you now have usable items.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now all you need to do is define your items usable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For consumable objects like potions:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; use_simple = { name = &amp;amp;quot;power name&amp;amp;quot;,&lt;br /&gt;
  use = function(self,who)&lt;br /&gt;
    &amp;amp;lt;Code for power use here&amp;amp;gt;&lt;br /&gt;
    return {used = true, destroy = true}&lt;br /&gt;
  end&lt;br /&gt;
}, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For an object like a wand with limited charges:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; multicharge = &amp;amp;lt;charges&amp;amp;gt;,&lt;br /&gt;
use_simple = { name = &amp;amp;quot;power name&amp;amp;quot;,&lt;br /&gt;
  use = function(self,who)&lt;br /&gt;
    &amp;amp;lt;Code for power use here&amp;amp;gt;&lt;br /&gt;
    return {used = true, destroy = true}&lt;br /&gt;
  end&lt;br /&gt;
}, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For a magical object with regenerating power:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; max_power = &amp;amp;lt;max power&amp;amp;gt;,&lt;br /&gt;
power_regen = &amp;amp;lt;power regained per turn&amp;amp;gt;,&lt;br /&gt;
use_power = {name = &amp;amp;quot;power name&amp;amp;quot;, power = &amp;amp;lt;power use per charge&amp;amp;gt;,&lt;br /&gt;
  use = function(self, who)&lt;br /&gt;
    &amp;amp;lt;Code for power use here&amp;amp;gt;&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
}, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For a magical object that activates a talent on use:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; max_power = &amp;amp;lt;max power&amp;amp;gt;,&lt;br /&gt;
power_regen = &amp;amp;lt;power regained per turn&amp;amp;gt;,&lt;br /&gt;
use_talent = {id = Talents.T_SOMETALENT, level = &amp;amp;lt;level of talent&amp;amp;gt;, power = &amp;amp;lt;power use per charge&amp;amp;gt; }, &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Objects&amp;diff=6162</id>
		<title>T4 Modules Howto Guide/Objects</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Objects&amp;diff=6162"/>
				<updated>2013-09-29T14:57:44Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Objects: Loot and Equipment&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Editing the Example Module to use ActorInventory&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If your module will make use of objects and equipment, some changes are needed to the code since the example module does not by default use the ActorInventory class.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In your load.lua you should call at the top of the file &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local ActorInventory = require &amp;amp;quot;engine.interface.ActorInventory&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
You can then define slots through the command:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ActorInventory:defineInventory(&amp;amp;quot;SLOT&amp;amp;quot;, &amp;amp;quot;slot name&amp;amp;quot;, IS_WORN, &amp;amp;quot;slot desc&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
with SLOT being the slot's codeside identifier, &amp;amp;quot;slot name&amp;amp;quot; being the display name of the slot, IS_WORN being a boolean that determines if its a worn slot or a container slot and &amp;amp;quot;slot_desc&amp;amp;quot; is the description of the slot.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You will also then have to edit the module's /class/Actor.lua file.&amp;lt;br /&amp;gt;&lt;br /&gt;
Add&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;require &amp;amp;quot;engine.interface.ActorInventory&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
to the requires at the top of the file and add the engine.interface.ActorInventory to its inheritances:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;module(..., package.seeall, class.inherit(&lt;br /&gt;
    engine.Actor,&lt;br /&gt;
    engine.interface.ActorInventory,    -- Add this line to whatever is already there!&lt;br /&gt;
    engine.interface.ActorTemporaryEffects,&lt;br /&gt;
    engine.interface.ActorLife,&lt;br /&gt;
    engine.interface.ActorProject,&lt;br /&gt;
    engine.interface.ActorLevel,&lt;br /&gt;
    engine.interface.ActorStats,&lt;br /&gt;
    engine.interface.ActorTalents,&lt;br /&gt;
    engine.interface.ActorResource,&lt;br /&gt;
    engine.interface.ActorFOV,&lt;br /&gt;
    mod.class.interface.Combat&lt;br /&gt;
))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;THEN, in the _M:init(t, no_default) function add:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;engine.interface.ActorInventory.init(self, t)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now you need to tell the game what slots each specific Actor can use.  Say you used the defineInventory function to add the &amp;amp;quot;MAINHAND&amp;amp;quot;, &amp;amp;quot;OFFHAND&amp;amp;quot;, &amp;amp;quot;HEAD&amp;amp;quot;, and &amp;amp;quot;BODY&amp;amp;quot; slots to the game.  You should put the following table into the birth descriptor for your player:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    body = { INVEN = 10, MAINHAND = 1, OFFHAND = 1, BODY = 1, HEAD = 1 },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Your player can know carry 10 items (the INVEN slots) and have one piece of equipment in each of the other slots.  NPCs work the same way, by adding a body table to their [[NPCs]] newEntity definition. For example a headless horseman would use this code:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    body = { INVEN = 10, MAINHAND = 1, OFFHAND = 1, BODY = 1 },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Notice the missing HEAD slot, which tells the game that this NPC cannot use any equipment marked for the HEAD slot!&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Adding objects&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now that the game has an inventory system implemented you can start making objects.  For now let us put the objects into the &amp;amp;quot;data/zones/dungeon/objects.lua&amp;amp;quot; file.  How about adding some weapons to the Example module?  Let us start with a two-handed battleaxe:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newEntity{&lt;br /&gt;
    define_as = &amp;amp;quot;BASE_BATTLEAXE&amp;amp;quot;,&lt;br /&gt;
    slot = &amp;amp;quot;MAINHAND&amp;amp;quot;,&lt;br /&gt;
    slot_forbid = &amp;amp;quot;OFFHAND&amp;amp;quot;,&lt;br /&gt;
    type = &amp;amp;quot;weapon&amp;amp;quot;, subtype=&amp;amp;quot;battleaxe&amp;amp;quot;,&lt;br /&gt;
    display = &amp;amp;quot;/&amp;amp;quot;, color=colors.SLATE,&lt;br /&gt;
    encumber = 3,&lt;br /&gt;
    rarity = 5,&lt;br /&gt;
    combat = { sound = &amp;amp;quot;actions/melee&amp;amp;quot;, sound_miss = &amp;amp;quot;actions/melee_miss&amp;amp;quot;, },&lt;br /&gt;
    name = &amp;amp;quot;a generic battleaxe&amp;amp;quot;,&lt;br /&gt;
    desc = [[t4modules massive two-handed battleaxes.]],&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
newEntity{ base = &amp;amp;quot;BASE_BATTLEAXE&amp;amp;quot;,&lt;br /&gt;
    name = &amp;amp;quot;iron battleaxe&amp;amp;quot;,&lt;br /&gt;
    level_range = {1, 10},&lt;br /&gt;
    require = { stat = { str=11 }, },&lt;br /&gt;
    cost = 5,&lt;br /&gt;
    combat = {&lt;br /&gt;
        dam = 10,&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There is a lot going on in there.  First, notice we define a &amp;amp;quot;BASE_BATTLEAXE&amp;amp;quot; that specific types of battleaxes can inherit from.  This stores things like which slots the battleaxe can be equipped in (this is what we set up above), which slots this will stop us from using, and some other properties like encumbrance, rarity and description.  Second, we make a specific type of iron battleaxe that inherits using the &amp;amp;quot;base&amp;amp;quot; variable.  The resulting entity will have all of the properties of the base entity except when there is an explicit conflict.  An example of this is the &amp;amp;quot;name&amp;amp;quot; variable.  The name variable from the iron battleaxe will overwrite the &amp;amp;quot;a generic battleaxe&amp;amp;quot; name from the base entity.  Tables will not overwrite each other, instead they will merge.  This can be seen in the &amp;amp;quot;combat&amp;amp;quot; variable, which in the iron battleaxe will be a table with the &amp;amp;quot;sound&amp;amp;quot; and &amp;amp;quot;sound_miss&amp;amp;quot; from the base class and the &amp;amp;quot;dam&amp;amp;quot; from the child class.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc3&amp;quot;&amp;gt;Adding objects to a Zone&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;amp;quot;objects.lua&amp;amp;quot; file for the dungeon zone now has some objects in it, but we need to tell T-Engine how many objects to add to the zone and where to put them.  This is handled by a generator, and we tell T-Engine which generator to use in the &amp;amp;quot;zone.lua&amp;amp;quot; file.  If you open up zone.lua you see that there are already generator entries for the map and the actors:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    generator =  {&lt;br /&gt;
        map = {&lt;br /&gt;
            class = &amp;amp;quot;engine.generator.map.Roomer&amp;amp;quot;,&lt;br /&gt;
            nb_rooms = 10,&lt;br /&gt;
            rooms = {&amp;amp;quot;simple&amp;amp;quot;, &amp;amp;quot;pilar&amp;amp;quot;},&lt;br /&gt;
            lite_room_chance = 100,&lt;br /&gt;
            ['.'] = &amp;amp;quot;FLOOR&amp;amp;quot;,&lt;br /&gt;
            ['#'] = &amp;amp;quot;WALL&amp;amp;quot;,&lt;br /&gt;
            up = &amp;amp;quot;UP&amp;amp;quot;,&lt;br /&gt;
            down = &amp;amp;quot;DOWN&amp;amp;quot;,&lt;br /&gt;
            door = &amp;amp;quot;DOOR&amp;amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        actor = {&lt;br /&gt;
            class = &amp;amp;quot;engine.generator.actor.Random&amp;amp;quot;,&lt;br /&gt;
            nb_npc = {20, 30},&lt;br /&gt;
        },&lt;br /&gt;
    },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Well we need to add a generator for objects, too!  This code will do the trick if added right after the actor = {...} line:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        object = {&lt;br /&gt;
            class = &amp;amp;quot;engine.generator.object.Random&amp;amp;quot;,&lt;br /&gt;
            nb_object = {20, 30},&lt;br /&gt;
        },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Now T-Engine will randomly generate and drop 20-30 objects.  Give it a try!&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The next step is to implement [[Inventory Dialogs]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/NPCs&amp;diff=6161</id>
		<title>T4 Modules Howto Guide/NPCs</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/NPCs&amp;diff=6161"/>
				<updated>2013-09-29T14:57:35Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Actors: NPCs and Monsters&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Important NPC Definitions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that these are also used in the copy table in a player descriptor. These expand on the properties available to all entities, see [[Entities]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Displayed NPC name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;NPC identifier. name is used if unset&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;desc&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Optional description of NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;NPC Type (No known hardcoded types)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;subtype&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Better categorization for NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;display&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Character that the NPC is displayed as in text mode.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;faction&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor faction.  Defaults to &amp;amp;quot;enemies&amp;amp;quot;.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ai&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Selects which ai to use for NPC.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ai_state&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;(?) Depends on AI class.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;rarity&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;How common this NPC is to generate.  Higher is rarer.  If not set will not ever generate.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level_range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Minimum and maximum levels for NPC. Read NPC Level Scaling below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;autolevel&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Which leveling function to use to level up NPC.  Read NPC Level Scaling below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;max_life&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Max life at level 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;energy.mod&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Scales how much energy is gained per tick.  Defaults to 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;sight&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sight radius.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp_mod&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Scales how much exp is needed to reach a new level.  Defaults to 1.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp_worth&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Indicator of Actor exp value.  By default, exp for killing an Actor is its level times this value.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;See ego section in [[Entities]]&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos_chance&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;See ego section in [[Entities]]&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These variables are not set in the definitions file, though they can be.  They can be useful to access in code however.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important runtime variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;energy.value&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current energy of this actor. Defaults to 0.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;self.energy.used&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Set to true if some energy was used this tick.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;life&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current life.  Defaults to max_life.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;dead&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;true if entity is dead.  Different from undead.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current Actor level.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;exp&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Current experience.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;max_level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum level for the Actor.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example module implements several other variables in its Actor class and Combat interface.  These are not hardcoded, but can be used as a base or example for implementing your own module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;combat_armor&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Removes this amount from damage taken.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;combat.dam&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is added to strength to determine the damage done by attacks.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Actor class important methods&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, read the documentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;act()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Code that gets executed every time the entity gets to act.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canSee(actor)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Test if the actor can see the target actor.  This does not check LOS or such, only the actual ability to see it, such as influenced by stealth, invisibility or telepathy.  Returns true or false and a number from 0 to 100 representing the 'chance' to be seen.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTarget()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Gets the Actor target. Redefined by player and AI.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;setTarget(target)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sets the actor target.  Redefined by player and AI.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;move(x, y, force)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td style=&amp;quot;text-align: left;&amp;quot;&amp;gt;Do NOT manually set the actor's x and y values.  Use this method instead.  Set force to true to not test for the presence of other entities.  Returns true if a move was attempted and energy should propably be used.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;moveDir(dir)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Moves in a certain direction.  Calls move() internally.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canMove(x, y, terrain_only)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Checks if the Actor can go there.  if terrain_only is true it only checks terrain and ignores the presence of actors and other entities.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;teleportRandom(x, y, dist, min_dist)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Teleports randomly to x,y.  dist is the radius of the effect, min_dist is a minimum radius of the effect and defaults to 0.  Set dist to 0 for precise teleport.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useEnergy(amount)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Amount of energy to subtract from the actor in energy based time systems.  Often used in the act() method after taking an action that takes time.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;reactionToward(target)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Uses factions to check for hostility.  -100 is fully hostile, 0 is neutral and 100 is friendly.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;addTemporaryValue(prop, v, noupdate)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Changes a property on the actor, but returns an id so the value change can be reversed with a call to removeTemporaryValue(). If noupdate is true the property is not actually changed.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;removeTemporaryValue(prop, id, noupdate)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Reverses a previous call to addTemporaryValue().  Use its returned id to reverse its change.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;onTemporaryValueChange(prop, sub, v)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Does nothing.  Redefine to perform some action when temporary values are applied or removed.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;attr(prop, v, fix)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Non-temporarily increases or decreases an actor property. Use this for compatibility with temporary values above.  If fix is set the property is set to v, not increased or decreased. Commonly, attr(prop) alone is used to check for the existance of a property instead of modifying it.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;isNear(x, y, radius)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Checks whether the actor is within a certain radius of the passed coordinate.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, defining stats automatically creates a getStat() function.  For example, defining the stat str creates a getStr() function for you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc3&amp;quot;&amp;gt;NPC Egos&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc4&amp;quot;&amp;gt;NPC Level Scaling&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Depending on the zone settings, the spawned creatures can actually level with the player.  This requires a level_range variable to be properly set and a levelup() method in the Actor class.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The level_range variable defines the possible range the creature can be. The entity will always be leveled up to at least its minimum level in the level range.  It will also never be leveled above that range either.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The leveling method should be defined in Actor.lua.  In ToME this method adds to the life, stamina and mana of actors.  Alternatively, you can create several, and use the autolevel variable to pick which to call.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;All creatures are always generated at level 1, then leveled up to reach their required level.  Keep this is mind when creating the NPC descriptor.  Note also that you can create your own levelup() function in the NPC descriptor if a unique levelup method is needed.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [[Dev-Zones]] for more info&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Zones&amp;diff=6160</id>
		<title>T4 Modules Howto Guide/Zones</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Zones&amp;diff=6160"/>
				<updated>2013-09-29T14:57:25Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Zones: Your local adventurer hangouts&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Zones are description files for areas.  The dungeon is a zone, the ice themed cave is a zone, the overland map is a zone, the town is a zone.  They can be relatively simple or complex, and can be interconnected in various ways.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;What a zone is to the module writer is a directory in the /data/zones folder with 5 files in it:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;File&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;zone.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone description file&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;grids.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Description of the zone terrain&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;npcs.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;NPCs that exist in the zone&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;objects.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Objects in the zone&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;traps.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Traps in the zone&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Zone Description: zone.lua&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The zone name, as referred to by other files, is the same as the folder name that this file is in.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Display name of this zone.  May contain punctuation and spacing.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level_scheme&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If &amp;amp;quot;player&amp;amp;quot;, scale zone and NPC levels to match player level, if &amp;amp;quot;fixed&amp;amp;quot;, do not scale NPC levels.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level_range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If level_scheme is &amp;amp;quot;player&amp;amp;quot;, this limits the min and max that NPC levels can scale to.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;max_level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Depth of a multi-level dungeon&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;actor_adjust_level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;See below under &amp;amp;quot;On level_scheme and level_range&amp;amp;quot;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;width&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Width of levels. No effect if static level generated.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;height&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Height of levels. No effect if static level generated.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;all_remembered&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If true, level starts explored.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;all_lited&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If true, level starts lit.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;persistant&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If not set, randomizes the level again every time it is entered. If true it saves one level per file.  If &amp;amp;quot;zone&amp;amp;quot; it saves all levels in a zone file.  If &amp;amp;quot;memory&amp;amp;quot; it saves the level with the mail savefile.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;generator&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines the generators used for this zone, read below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;levels&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Used to override zone defaults for single levels, such as to add a static boss level at lowest level of zone.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Generator&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are four kinds of generators at the time of writing.  You can only select one of each type per zone, though you can override this in the levels variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc3&amp;quot;&amp;gt;map&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc4&amp;quot;&amp;gt;engine.generator.map.Cavern&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Generates a caven-like level. Used e.g. for Ardhungol in the tome module.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc5&amp;quot;&amp;gt;engine.generator.map.Empty&amp;lt;/h5&amp;gt;&lt;br /&gt;
**makes an empty level&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc6&amp;quot;&amp;gt;engine.generator.map.Forest&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Generates a forest level with possible ponds of water. Used for the Trollshaws.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc7&amp;quot;&amp;gt;engine.generator.map.GOL&amp;lt;/h5&amp;gt;&lt;br /&gt;
**GOL is game of life I should rename it&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc8&amp;quot;&amp;gt;engine.generator.map.Heightmap&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Heightmap is just a bad experiment;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc9&amp;quot;&amp;gt;engine.generator.map.Maze&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Maze makes well, a maze...like in .. the maze ;)&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc10&amp;quot;&amp;gt;engine.generator.map.Roomer&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Roomer is the standard dungeon builder&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc11&amp;quot;&amp;gt;engine.generator.map.Rooms&amp;lt;/h5&amp;gt;&lt;br /&gt;
**yeah Rooms is badly named and half working&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc12&amp;quot;&amp;gt;engine.generator.map.Static&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Loads a map file from the data/maps/ folder. It is used e.g. for towns or special levels (the map is then fixed) or for placing special fixed rooms/structures in a random map (e.g. the last level of Amon-Sûl).&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc13&amp;quot;&amp;gt;engine.generator.map.TileSet&amp;lt;/h5&amp;gt;&lt;br /&gt;
**TileSet splits the level in tiles of 3x3, 5x5, .. (customizable) each with a set of defined tiles possibilities and it randomly places them, matching existing ones. Examples are the ancient elven ruins, the moria, the first level of the lost merchant quest&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc14&amp;quot;&amp;gt;engine.generator.map.Town&amp;lt;/h5&amp;gt;&lt;br /&gt;
**Generates a random town composed by L-shaped and rectangular buildings. Used e.g. for the Rak'shor Pride.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc15&amp;quot;&amp;gt;actor&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc16&amp;quot;&amp;gt;engine.generator.actor.Random&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc17&amp;quot;&amp;gt;object&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc18&amp;quot;&amp;gt;engine.generator.object.Random&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc19&amp;quot;&amp;gt;trap&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;h5 id=&amp;quot;toc20&amp;quot;&amp;gt;engine.generator.trap.Random&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc21&amp;quot;&amp;gt;Additional file contents&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The files grids.lua, npcs.lua, objects.lua and traps.lua are used to load or define the features available in the zone.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;At its simplest, a load() call to one of the files defined in the /data/general/ directory is used, but zone special features can also be defined here, such as ice tiles in a ice cave or a boss that appears only in that zone.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The reason for this is so you can have only orcs or trolls appear in your zone, with a forest tileset and only outdoor traps.  This is also one of the main reasons for segmenting your definition files.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc22&amp;quot;&amp;gt;Static maps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc23&amp;quot;&amp;gt;Travelling between zones&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc24&amp;quot;&amp;gt;Word of DarkGod&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc25&amp;quot;&amp;gt;On level_scheme and level_range&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;amp;lt;&amp;amp;gt; max_level is the &amp;amp;quot;physical&amp;amp;quot; depth&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; and level_range is the range of levels allowed&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; if the scheme is set to &amp;amp;quot;fixed&amp;amp;quot;, or not set, then actors will only have their natural level&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; if it is set to &amp;amp;quot;player&amp;amp;quot; then the zone calls game:getPlayer() to get a player, takes its level and uses it to select a level for the zone&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; imagine:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; if you haev a zone with max_level = 5; level_range={10,20}&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; then if a level 12 player enters, the zone &amp;amp;quot;levels itself&amp;amp;quot; to be level 12 for the first level and then one more per level&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; basically it means that you can have zones that levelup with the player, as to provide a challenge even if the player is not at the exact right level&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; actors are always created as level 1, then they are leveled up to theuir minimun level (their own level_range)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; then the zone force levelup to the selected level\&amp;amp;lt;dg_&amp;amp;gt; using the &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt;  actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end,&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;lt;&amp;amp;gt; field of the zone&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Entities&amp;diff=6159</id>
		<title>T4 Modules Howto Guide/Entities</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Entities&amp;diff=6159"/>
				<updated>2013-09-29T14:57:14Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Entities and Egos: Everything comes from here=&lt;br /&gt;
&lt;br /&gt;
==Entity Definitions==&lt;br /&gt;
&amp;lt;p&amp;gt;These variables are valid for all entities, that is, grid, actors, objects, stores or traps.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Default&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;display&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;'.'&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Character to display in ASCII mode.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;image&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;nil&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Image to use as a tile.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;color&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;0,0,0&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Display color.  No effect on images.  A table of r,g,b.  Sets color_r, color_g and color_b.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;back_color&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-1,-1,-1&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Back display color.  No effect on images.  A table of r,g,b.  Sets color_br, color_bg and color bb.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;tint&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;1,1,1&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Color to tint the display texture with.  Has an effect on both image and ASCII displays.  Sets tint_r, tint_g and tint_b.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unique&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unset&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If true, only one of these will ever be generated.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;changed&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unset&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Gets set to true whenever an entity undergoes changes.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Egos: Adding some variety==&lt;br /&gt;
&amp;lt;p&amp;gt;Egos are defined as 'special' versions of usually items that grant additional properties or effects to the user beyond the normal.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Egos are a very generic system in T-Engine.  NPCs, objects, traps, grids or even stores can potentially have egos.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In the entity definitions, 3 ego-related variables are recognized:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Property&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String pointing to a lua file containing ego definitions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;egos_chance&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Number between 0 and 100 defining the chance of this entity being an ego entity.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;force_ego&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces the entity to be generated with the ego named by this variable.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Egos are defined the same way as normal entities, in a newEntity{...} block.  Unlike other entities though they do not have a base (unless the base is another ego).  In addition, the following variables are recognized:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Property&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the suffix the ego will add to the base entity.  If prefix is set to true, this is a prefix instead.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;prefix&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;If true, the ego is a prefix instead of a suffix.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This allows one ego to apply to a wide range of entities, such as a +strength ego apply to weapons and armor.  It also makes silliness possible such as a 'sharpened troll'.  Take care.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Ego Grids===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;p&amp;gt;Note that while its possible to have ego grids, the way the map works at the moment all grids that are the same are the same object.  This means that the ego chance doesn't get evaluated per grid tile, it gets evaluated once per tile type for the whole level.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It may be possible and has been suggested to force every grid to be a unique object in future versions, but this is still not advised due to increased memory use and larger resulting save files.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Talents&amp;diff=6158</id>
		<title>T4 Modules Howto Guide/Talents</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Talents&amp;diff=6158"/>
				<updated>2013-09-29T14:57:04Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Talents: Your special skills=&lt;br /&gt;
&lt;br /&gt;
==Talent Definitions==&lt;br /&gt;
&lt;br /&gt;
By default, Talent definitions are stored in the /data/talents.lua file.  This file can include other files through the use of the Load(file) method.&lt;br /&gt;
&lt;br /&gt;
Talent definitions require talent type definitions first.  These are defined in newTalentType{...} blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important TalentType Variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Display name of this talent type.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Identifier of this talent type.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;description&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String description of this talent type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;points&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum amount of points in this talent type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Talent definitions are defined in newTalent{...} blocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important Talent Variables&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Displayed Talent name. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent identifier.  name is used if unset.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;points&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Maximum amount of points that can be put into the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;require&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Requirements table for adding points.  See the requirements definition below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;mode&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent mode.  One of either: &amp;amp;quot;passive&amp;amp;quot; - always on, &amp;amp;quot;sustained&amp;amp;quot; - can be turned on or off and &amp;amp;quot;activated&amp;amp;quot; - can be used.  Default is &amp;amp;quot;activated&amp;amp;quot;.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;info&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String description of the talent.  REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent group. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cooldown&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Amount of turns to wait before a talent can be used again.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Range of talent.  May be a number or function, but use getTalentRange(t) below as a getter in that case.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identifiers for the talents are created by uppercasing the short_name (or name if no short_name is defined), replacing spaces with underscores ('_') and appending T_ in the front.  These can then be accessed statically through [ActorTalents.*].&lt;br /&gt;
&lt;br /&gt;
In this way the talent &amp;amp;quot;Wind Walk&amp;amp;quot; can be accessed by [ActorTalents.T_WIND_WALK].&lt;br /&gt;
&lt;br /&gt;
Some talent variables require functions to be defined.  These are of the form function(self, t), where self is the invoking actor and t is the talent being invoked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Important Talent Functions&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;action&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;activated&amp;amp;quot; mode talents only. Function that gets used when talent is activated.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;activate&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;sustained&amp;amp;quot; mode talents only.  Function that gets used when talent gets turned on.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;deactivate&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;sustained&amp;amp;quot; mode talents only.  Function that gets used when talent gets turned off.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;on_learn&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Function that gets used when talent is learned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;on_unlearn&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Function that gets used when talent is unlearned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to add stat, level or other talent requirements, a requirement table is required.  These are the recognised variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Requirement Definition&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;stat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor must have these stats at these levels.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;level&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Actor must be at least this level.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talent&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Prerequisite talents.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance if a talent requires another talent and stats you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;require = { stat = { str = 10, dex = 10 }, talent = { Talents.T_STONE_SKIN }, },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a talent requires that another talent NOT be taken you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;require = { talent = { { Talents.T_STONE_SKIN, false }, }, },&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Talent Targeting==&lt;br /&gt;
&lt;br /&gt;
Many activatable talents require some user targeting input.  This is done through a coroutine.  This is an example of the standard targeting and dealing damage case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local tg = {type=&amp;amp;quot;bolt&amp;amp;quot;, range=self:getTalentRange(t), talent=t}&lt;br /&gt;
local x, y = self:getTarget(tg)&lt;br /&gt;
if not x or not y then return nil end&lt;br /&gt;
self:project(tg, x, y, DamageType.FIRE, 10, nil)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, tg contains the targeting and damage settings.  Possible variables are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Targeting Settings&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Targeting type. See below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;range&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Range limit.  Usually always self:getTalentRange(t).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talent&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;The talent being used.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;friendlyfire&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;(?) Defaults to true.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;no_restrict&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Makes no restrictions regarding targeting&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;stop_block&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Denotes that the projection will be blocked by entities that block move (bolts have this true by default)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;radius&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;ball&amp;amp;quot; and &amp;amp;quot;cone&amp;amp;quot; targeting modes use this.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cone_angle&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;amp;quot;cone&amp;amp;quot; targeting mode uses this.  Defaults to 55.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;msg&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Message to display during targeting.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The possible targeting modes are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;type&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;hit&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Simple single target.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;bolt&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits first thing in path.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;beam&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in path.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;ball&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in a ball around the target.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cone&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Hits everything in a cone in the direction.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
getTarget(tg) is a method that is overriden by an AI for NPCs, or by the game module class.&lt;br /&gt;
&lt;br /&gt;
Note that the last parameter of the project() method is the particle system to use.&lt;br /&gt;
&lt;br /&gt;
==ActorTalents Class==&lt;br /&gt;
&lt;br /&gt;
By default, Actors inherit from the ActorTalents class, even in the example module.  This class provides an interface for manipulating and accessing talents.  These are some of the valuable methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Useful Talent Related ActorTalents class methods&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces the Actor to use the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;useTalents()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Shows the use talent dialog.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;knowTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the talent is known.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;knowTalentType(tt)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the talent group is known.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;learnTalent(t, force, nb)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has an Actor learn a talent.  force prevents a canLearnTalent(t) test. nb is the amount of points to put into the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unlearnTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Makes the Actor forget the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;learnTalentType(tt, v)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has the Actor learns a Talent Type. (v is true or false?)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;unlearnTalentType(tt)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Has the Actor forget a Talent Type.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;canLearnTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the Actor meets the requirements for the talent.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentLevel(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Gets the amount of points in talent.  0 if unlearned.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;isTalentCoolingDown(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns true if the specified talent is in the process of cooldown.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentRange(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Returns the talent range.  Use this instead of checking the range variable, since this allows the range variable to be either a function or a number.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;cooldownTalents()&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Cools down all talents by 1.  This needs to be in your act() method.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All of the above methods can also be redefined in your own class if their functionality needs to be expanded.  In addition, the following may also be useful to redefine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Method&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Use&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;preUseTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Called before an actor uses a talent.  Not returning true stops the talent from invoking.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;postUseTalent(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Called after an actor uses a talent.  Not returning true stops stops cooldown or sustained state from happening.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;getTalentFullDescription(t)&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Used in Dialogs.  Overload to add more information such as mana use.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Player_Descriptors&amp;diff=6157</id>
		<title>T4 Modules Howto Guide/Player Descriptors</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Player_Descriptors&amp;diff=6157"/>
				<updated>2013-09-29T14:56:53Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Who do you want to be today?=&lt;br /&gt;
&lt;br /&gt;
==Important variables==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Variable&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Display name of this option in the selection menu. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Identifier of this option.  name is used if unset.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;type&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines which birth stage this descriptor belongs to. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;descriptor_choices&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Selects which later descriptors are allowed or disallowed.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talents_types&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Talent types learned at start of game&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;talents&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;List of starting learned talents.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;desc&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;String that describes the descriptor.  Appears in the selection menu. REQUIRED.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;body&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Initializes available slots.  Requires ActorInventory defineInventory() calls in load.lua beforehand(?) which is NOT done in the example module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;copy&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;These variables and values will be copied to the resulting player object.  See [[NPCs|NPCs]] for values.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;experience&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Experience rate.  1 being normal experience gain.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;stats&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Initial stats for character.  Is added to default stat values.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Important to note is that these variables do not overwrite, they add every time.  If your race adds 2 strength, and your class adds 2 strength again you will end up with 4 strength.  The exception to this is the copy variable.  All elements in this will overwrite previous copy elements.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Editing the Example Module for your own use&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;At the time of writing, ToME has descriptors for world, race, subrace, sex, class and subclass.  However, the example module only has a descriptor for role.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you want to expand this and introduce your own descriptors for races and classes like ToME, or different descriptors entirely, you need to edit the following line in your /class/Game.lua file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local birth = Birther.new(self.player, {&amp;amp;quot;base&amp;amp;quot;, &amp;amp;quot;role&amp;amp;quot; }, function()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For comparison, ToME has this line:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local birth = Birther.new(self.player, {&amp;amp;quot;base&amp;amp;quot;, &amp;amp;quot;world&amp;amp;quot;, &amp;amp;quot;race&amp;amp;quot;, &amp;amp;quot;subrace&amp;amp;quot;, &amp;amp;quot;sex&amp;amp;quot;, &amp;amp;quot;class&amp;amp;quot;, &amp;amp;quot;subclass&amp;amp;quot; }, function()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now you just need to create your own descriptors in the /data/birth/descriptors.lua file.  If you want to organize your descriptors in multiple files for organization such as ToME does, remember to make a load call with your file path, such as the following ToME uses for its elf descriptor file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;load(&amp;amp;quot;/data/birth/races/elf.lua&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Leveling up==&lt;br /&gt;
&amp;lt;p&amp;gt;Once you gain enough xp to level, the levelup() method on the player gets called.&amp;lt;br /&amp;gt;&lt;br /&gt;
Use this method to include specific special code that runs on a new level up, such as gaining hp and stats.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Note that if you make use of NPC level scaling, its important to define a levelup() on the Actor class as well.  Since Player inherits from Actor, you can have the Player class call Actor's levelup() method through:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mod.class.Actor.levelup(self)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Guide==&lt;br /&gt;
&amp;lt;p&amp;gt;This guide is roughly based on the [[t4modules t3modules module_guide_part_1|te3 player descriptor guide]].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In the default ToME module, you get to choose from a race, a sub-race, gender, a background, a class, and then a subclass. To the T-Engine, these are all the same thing, called 'player descriptors' (Charcter descriptors would be more accurate, but that's nitpicking), or PDs for short. PDs are what let you alter the player character in all sorts of different ways. Player descriptors typically stack, so any modifications done to one will usually add with any other modifications, rather than replacing them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There's no definition or distinction between different types of PDs by the engine. They can all have the same functionality, the only place any consistency is found is by the module author. So, if you only want stats to come from races, and skills from classes, you will have to make sure that only races gain stat bonuses and only classes have skill bonuses. The engine will not discriminate against this for you.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;All the example below will be from the ToME module, so you should be able to see pretty easily where everything came from and can easily modify it and see what happens.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Possibly the most important PD is the one that the player will never see, the base descriptor, found in /data/birth/descriptors.lua. This is the one that is loaded for every character, and provides the universal traits that each character will share.  This one has been edited slightly for clarity.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newBirthDescriptor{&lt;br /&gt;
    type = &amp;amp;quot;base&amp;amp;quot;,&lt;br /&gt;
    name = &amp;amp;quot;base&amp;amp;quot;,&lt;br /&gt;
    desc = {&lt;br /&gt;
    },&lt;br /&gt;
    talents = {},&lt;br /&gt;
    experience = 1.0,&lt;br /&gt;
    body = { INVEN = 1000, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },&lt;br /&gt;
&lt;br /&gt;
    copy = {&lt;br /&gt;
        -- Mages are unheard of at first, nobody but them regenerates mana&lt;br /&gt;
        mana_rating = 6,&lt;br /&gt;
        mana_regen = 0,&lt;br /&gt;
&lt;br /&gt;
        max_level = 50,&lt;br /&gt;
        money = 10,&lt;br /&gt;
        resolvers.equip{ id=true,&lt;br /&gt;
            {type=&amp;amp;quot;lite&amp;amp;quot;, subtype=&amp;amp;quot;lite&amp;amp;quot;, name=&amp;amp;quot;brass lantern&amp;amp;quot;},&lt;br /&gt;
        },&lt;br /&gt;
        resolvers.inventory{ id=true,&lt;br /&gt;
            {type=&amp;amp;quot;potion&amp;amp;quot;, subtype=&amp;amp;quot;potion&amp;amp;quot;, name=&amp;amp;quot;potion of lesser healing&amp;amp;quot;, ego_chance=-1000},&lt;br /&gt;
            {type=&amp;amp;quot;potion&amp;amp;quot;, subtype=&amp;amp;quot;potion&amp;amp;quot;, name=&amp;amp;quot;potion of lesser healing&amp;amp;quot;, ego_chance=-1000},&lt;br /&gt;
            {type=&amp;amp;quot;potion&amp;amp;quot;, subtype=&amp;amp;quot;potion&amp;amp;quot;, name=&amp;amp;quot;potion of lesser healing&amp;amp;quot;, ego_chance=-1000},&lt;br /&gt;
            {type=&amp;amp;quot;potion&amp;amp;quot;, subtype=&amp;amp;quot;potion&amp;amp;quot;, name=&amp;amp;quot;potion of cure poison&amp;amp;quot;, ego_chance=-1000},&lt;br /&gt;
            {type=&amp;amp;quot;potion&amp;amp;quot;, subtype=&amp;amp;quot;potion&amp;amp;quot;, name=&amp;amp;quot;potion of cure poison&amp;amp;quot;, ego_chance=-1000},&lt;br /&gt;
        },&lt;br /&gt;
        resolvers.generic(function(e)&lt;br /&gt;
            e.hotkey[9] = {&amp;amp;quot;inventory&amp;amp;quot;, &amp;amp;quot;potion of lesser healing&amp;amp;quot;}&lt;br /&gt;
        end),&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This defines out the body and inventory slots for each character, the base experience rate and starting gold and the minimum equipment each character will need to have.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The second PD applied by the ToME module is your race, followed by subrace, found appropriate in /data/birth/races/. Races are where ToME typically grants the charcter their most unique abilities and major stat adjustments. Below is the PD for elves, and then a subrace of elf.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;newBirthDescriptor{&lt;br /&gt;
    type = &amp;amp;quot;race&amp;amp;quot;,&lt;br /&gt;
    name = &amp;amp;quot;Elf&amp;amp;quot;,&lt;br /&gt;
    desc = {&lt;br /&gt;
        &amp;amp;quot;Quendi are Elves, the first children of Eru.&amp;amp;quot;,&lt;br /&gt;
        &amp;amp;quot;The first Elves awoke by Cuiviénen, the Water of Awakening in the far east of Middle-earth, long Ages before the Rising of the Sun or Moon.&amp;amp;quot;,&lt;br /&gt;
        &amp;amp;quot;Unlike Men, the Elves are not subject to death by old age.&amp;amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    descriptor_choices =&lt;br /&gt;
    {&lt;br /&gt;
        subrace =&lt;br /&gt;
        {&lt;br /&gt;
            Nandor = &amp;amp;quot;allow&amp;amp;quot;,&lt;br /&gt;
            Avari = &amp;amp;quot;allow&amp;amp;quot;,&lt;br /&gt;
            __ALL__ = &amp;amp;quot;never&amp;amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
    },&lt;br /&gt;
    talents = {&lt;br /&gt;
--        [ActorTalents.T_IMPROVED_MANA_I]=1,&lt;br /&gt;
    },&lt;br /&gt;
    copy = {&lt;br /&gt;
        type = &amp;amp;quot;humanoid&amp;amp;quot;, subtype=&amp;amp;quot;elf&amp;amp;quot;,&lt;br /&gt;
        default_wilderness = {39, 17},&lt;br /&gt;
        starting_zone = &amp;amp;quot;tower-amon-sul&amp;amp;quot;,&lt;br /&gt;
        starting_quest = &amp;amp;quot;start-dunadan&amp;amp;quot;,&lt;br /&gt;
        starting_intro = &amp;amp;quot;elf&amp;amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    experience = 1.05,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
newBirthDescriptor&lt;br /&gt;
{&lt;br /&gt;
    type = &amp;amp;quot;subrace&amp;amp;quot;,&lt;br /&gt;
    name = &amp;amp;quot;Nandor&amp;amp;quot;,&lt;br /&gt;
    desc = {&lt;br /&gt;
        &amp;amp;quot;Elves who turned aside from the Great Journey in the early days and settled in th east of the Misty Mountains.&amp;amp;quot;,&lt;br /&gt;
        &amp;amp;quot;Both the Wood-Elves of Mirkwood and the Elves of Lórien are Nandor.&amp;amp;quot;,&lt;br /&gt;
        &amp;amp;quot;They posses the Grace of the Eldar talent which allows them a boost of speed every once in a while.&amp;amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    stats = { str=-2, mag=2, wil=3, cun=1, dex=1, con=0 },&lt;br /&gt;
    experience = 1.3,&lt;br /&gt;
    talents = { [ActorTalents.T_NANDOR_SPEED]=1 },&lt;br /&gt;
    copy = {&lt;br /&gt;
        life_rating = 9,&lt;br /&gt;
    },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Engine_Structure&amp;diff=6156</id>
		<title>T4 Modules Howto Guide/Engine Structure</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Engine_Structure&amp;diff=6156"/>
				<updated>2013-09-29T14:56:39Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How it all fits together=&lt;br /&gt;
&lt;br /&gt;
==Global Variables==&lt;br /&gt;
&amp;lt;p&amp;gt;These objects are global and are available from anywhere in the program:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Object&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;game&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is your game class, core of your game and allows access to pretty much any other object in the game.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;world&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is your world class.  By default this doesn't do much, but a custom world class allows persistance between new characters and savefiles.  Think history, or bones files.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;profile&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the player profile.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Directory_Structure&amp;diff=6155</id>
		<title>T4 Modules Howto Guide/Directory Structure</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Directory_Structure&amp;diff=6155"/>
				<updated>2013-09-29T14:56:29Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=An Overview=&lt;br /&gt;
==Player Profiles==&lt;br /&gt;
&lt;br /&gt;
When you run T-Engine or a module for the first time a player profile will be created. This contains your settings and keybindings, as well as module specific settings and achievements.&lt;br /&gt;
&lt;br /&gt;
On linux this profile can be found in your home directory.&lt;br /&gt;
&lt;br /&gt;
For Windows the profile folder will be called T-Engine. It will be located in the following locations.&lt;br /&gt;
&lt;br /&gt;
    Windows 7 - C:\Users\&amp;lt;username&amp;gt;\T-Engine&lt;br /&gt;
    Windows XP - C:\Documents and Settings\&amp;lt;username&amp;gt;\T-Engine&lt;br /&gt;
&lt;br /&gt;
Future plans involve moving the profile online, making it easier to compare, rank and show off individual accomplishments to friends. (As of April 2011, this appears to have been implemented.)&lt;br /&gt;
&lt;br /&gt;
==T-Engine Root Directory==&lt;br /&gt;
&lt;br /&gt;
In your T-Engine directory, the one where your executable is located, you will find a game directory. This directory contains all the Lua scripts used by the game and all its modules. The script is interpreted at runtime, so no recompilation is needed after modifying a file.&lt;br /&gt;
&lt;br /&gt;
If you are writing a custom module you should avoid editing any file outside your module directory, since you will not be able to distribute those changes along with your module if you do.&lt;br /&gt;
modules directory&lt;br /&gt;
&lt;br /&gt;
This directory is located in your game folder and contains every module currently available to T-Engine. Every module has its own folder and copying a module directory here is sufficient for it to be detected and appear on the list of available modules when starting a new game.&lt;br /&gt;
&lt;br /&gt;
For all of these guides, the convention to refer to a filepath will use the game's module directory as its root. This is the folder that contains your init.lua file.&lt;br /&gt;
&lt;br /&gt;
Note that the structure described here is only a convention used by ToME, but it is advised that third party module writers follow it for consistency. Few of these paths are hardcoded.&lt;br /&gt;
&lt;br /&gt;
Directories and files not in the example module are underlined. Directories are boldface.&lt;br /&gt;
&lt;br /&gt;
ToME uses many more than listed here, this is only intended to be a rough guide for structuring your own modules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Directory or file&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Purpose&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Root Module directory&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/init.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Description and basic information about the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/load.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This file loads all the basic code and definitions needed to run the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/resolvers.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Contains additional custom resolvers.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/ai/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Directory for custom AI definitions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/class/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Directory for module custom class files.  These usually extend the generic T-Engine classes of the same name and are used instead of them if they exist.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/Actor.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Both the player and all NPCs use this class.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/Game.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles game initialization, lower level code like keybindings and changing levels and displaying to screen.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/Grid.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines tooltips for grids and methods that handle what terrain blocks movement.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/NPC.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles non-player actors.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/class/Object.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles all objects in the game.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/Player.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles all player specific code that isn't generic to all Actors.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/class/PlayerDisplay.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles displaying the player's stats.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/class/Store.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles stores.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/class/Trap.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles traps.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;/class/World.lua&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Handles saving and Achievements.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/class/generator/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Directory for custom generators in zones.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/class/interface/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Directory for custom interfaces.  These are inherited by other classes to help segment and seperate code and improve readability for complex classes.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/class/interface/Combat.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module custom combat code is defined here.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Most of T-Engine is data-driven, not code-driven.  This directory contains all the module custom definitions loaded to make your game unique.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/damage_types.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines the default damage projector and all the different damage types used in the module. (fire, water, acid, etc)&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/talents.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Default talents file loaded by /init.lua.  This file often Load()'s other talent files to improve readability.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/timed_effects.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines various timed effects available to the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/achievements/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Stores module achievements.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/birth/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Birth descriptors folder.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/birth/descriptors.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Default birth descriptors file.  Often Load()'s other descriptor files to improve readability..&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/chats/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Stores NPC chats for mobs that can speak.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/general/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines entities available to your module. Note that zones may define their own entities, such as bosses or special items, in the zone directories.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/general/grids/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines general grids (terrain).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/general/npcs/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines general NPCs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/general/objects/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines general objects.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/general/stores/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines general stores.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/general/traps/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Defines general traps.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/gfx/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Special module image or particle assets.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/gfx/particles/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Particle script files.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/maps/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Static map definitions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/music/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module music.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/quest/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module quests.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/rooms/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Special generators for rooms.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/sound/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Sound effects directory.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/talents/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Stores talent description files.  These are Load()'ed by the /data/talents.lua file.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/texts/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Special non-quest or monster related texts.  Used in ToME for introduction messages and new class unlock texts.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;u&amp;gt;&amp;lt;strong&amp;gt;/data/tilesets/&amp;lt;/strong&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Data folder for the map generator.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/data/zones/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zones folder.  Each zone has its own directory.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/ZONE/grids.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone load file for grids.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/ZONE/npcs.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone load file for npcs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/ZONE/objects.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone load file for objects.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/ZONE/traps.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone load file for traps.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/data/ZONE/zone.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Zone description file.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&amp;lt;strong&amp;gt;/dialogs/&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Contains module specific dialogs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/dialogs/DeathDialog.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Dialog displayed on death.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;/dialogs/Quit.lua&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Dialog displayed when a quit is requested.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Module team files==&lt;br /&gt;
The team files are renamed zip files. However, they have a different directory structure. The data folder remains the same and everything else is put in a mod folder.&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6154</id>
		<title>T4 Modules Howto Guide/Getting Started</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Getting_Started&amp;diff=6154"/>
				<updated>2013-09-29T14:56:18Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==init.lua==&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Setting&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the official name of the module as seen in module selection list.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;long_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is the long name of the module that appears is descriptions.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;short_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;This is a short name used internal to the module. Preferred to be lower case and should be the same as the folder name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;author&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Your name or pseudonym and email address.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;homepage&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Optional homepage of the module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;version&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Module version. Does not automatically update. Change this between releases to differentiate them.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;engine&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Expected engine version.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;description&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A description of your module. Can be multiple lines and paragraphs.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;starter&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Only change if you know what you are doing. And if you have to ask, you don't.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;show_only_on_cheat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;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.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;no_get_name&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Prevents the new character name dialog from showing up for your module. Use this if you set the character name yourself in your module.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;allow_userchat&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Registers 'space' as a key to talk, joins a channel named &amp;amp;quot;module&amp;amp;quot;, and inits the chat system. If the game implements a game.logChat(str, ...) method it'll send chat listens to there.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;background&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;A list of filenames (without the extension) of PNG images under the data/gfx/background directory to use as startup screen backgrounds&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Launching your module using command line parameters&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Parameter&amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;Effect&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-M&amp;amp;lt;Module&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Auto-loads the specified module (using the module's short_name).&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-u&amp;amp;lt;name&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Uses the specified name for the character.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;-n&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;Forces a new character, overwriting any old saves with the same name.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;.../t-engine.exe -MMyModule -udefault -n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4 Modules Howto Guide]].&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Category:Module_Guides&amp;diff=6153</id>
		<title>Category:Module Guides</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Category:Module_Guides&amp;diff=6153"/>
				<updated>2013-09-29T14:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;How to guides for T-Engine 4.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[T4 Modules Howto Guide|How to guides]] for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide&amp;diff=6152</id>
		<title>T4 Modules Howto Guide</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide&amp;diff=6152"/>
				<updated>2013-09-29T14:54:57Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How to start making a module for the T-Engine 4:&lt;br /&gt;
----&lt;br /&gt;
*[[Getting Started]]&lt;br /&gt;
*[[Directory Structure]]&lt;br /&gt;
*[[Engine Structure]]&lt;br /&gt;
*[[Player Descriptors]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Talents|Talents]]&lt;br /&gt;
*[[Entities]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Zones|Zones]]&lt;br /&gt;
*[[NPCs]]&lt;br /&gt;
*[[Objects]]&lt;br /&gt;
*[[Inventory Dialogs]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Traps|Traps]] (not created)&lt;br /&gt;
*[[Dialogs]]&lt;br /&gt;
*[[Character Sheet Dialogs]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Stores|Stores]] (not created)&lt;br /&gt;
*[[Factions]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Quests|Quests]] (not created)&lt;br /&gt;
*[[Chats]]&lt;br /&gt;
*[[Colors]]&lt;br /&gt;
*[[Frame Buffers]]&lt;br /&gt;
*[[Developing a static map using the Tiled plugin]]&lt;br /&gt;
*[[T4 Modules Howto Guide/Resolvers|Resolvers]] (not created)&lt;br /&gt;
*[[Particle Effects]]&lt;br /&gt;
*[[Uploading a module]]&lt;br /&gt;
&lt;br /&gt;
{{Module Guides}}&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Template:Module_Guides&amp;diff=6151</id>
		<title>Template:Module Guides</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Template:Module_Guides&amp;diff=6151"/>
				<updated>2013-09-29T14:52:47Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;&amp;lt;includeonly&amp;gt;Category:Module Guides&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt; A placeholder for now. Will for navigating the guides eventually. Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;[[Category:Module Guides]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
A placeholder for now. Will for navigating the guides eventually.&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Startide&amp;diff=6145</id>
		<title>Startide</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Startide&amp;diff=6145"/>
				<updated>2013-09-20T19:42:40Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;{{Module |name=Startide |developer=User:BDota| |version=0.0.1 |engine=1.0.4 |page=[http://te4.org/games/startide] |link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38429] ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Module&lt;br /&gt;
|name=Startide&lt;br /&gt;
|developer=[[User:BDota|BDota]]&lt;br /&gt;
|version=0.0.1&lt;br /&gt;
|engine=1.0.4&lt;br /&gt;
|page=[http://te4.org/games/startide]&lt;br /&gt;
|link=[http://forums.te4.org/viewtopic.php?f=40&amp;amp;t=38429]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A sci-fi module for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Template:Module&amp;diff=6144</id>
		<title>Template:Module</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Template:Module&amp;diff=6144"/>
				<updated>2013-09-20T19:39:04Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;&amp;quot;&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border:none; margin:0; padding:0; text-align:left&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-size:larger;&amp;quot;|{{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:125px;&amp;quot; | Developer&lt;br /&gt;
| style=&amp;quot;width:175px;&amp;quot; | {{{developer}}}&lt;br /&gt;
|-&lt;br /&gt;
! Current Version&lt;br /&gt;
| {{{version}}}&lt;br /&gt;
|-&lt;br /&gt;
! Engine Version&lt;br /&gt;
| {{{engine}}}  &lt;br /&gt;
|-&lt;br /&gt;
! Module Page&lt;br /&gt;
| {{{page}}}&lt;br /&gt;
|-&lt;br /&gt;
! Forum Link&lt;br /&gt;
| {{{link}}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;[[Category:Modules]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Template:Module&amp;diff=6143</id>
		<title>Template:Module</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Template:Module&amp;diff=6143"/>
				<updated>2013-09-20T19:32:05Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;&amp;lt;div style=&amp;quot;margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;&amp;quot;&amp;gt; {|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border:none; margin:0; padding:0; text-align:lef...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;margin: 1.4em; margin-top:0; margin-right:0; padding: 0px; float: right; border:none;&amp;quot;&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border:none; margin:0; padding:0; text-align:left&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-size:larger;&amp;quot;|{{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:125px;&amp;quot; | Developer&lt;br /&gt;
| style=&amp;quot;width:175px;&amp;quot; | {{{developer}}}&lt;br /&gt;
|-&lt;br /&gt;
! Current Version&lt;br /&gt;
| {{{version}}}&lt;br /&gt;
|-&lt;br /&gt;
! Engine Version&lt;br /&gt;
| {{{version}}}  &lt;br /&gt;
|-&lt;br /&gt;
! Module Page&lt;br /&gt;
| {{{page}}}&lt;br /&gt;
|-&lt;br /&gt;
! Forum Link&lt;br /&gt;
| {{{link}}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;[[Category:Modules]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Modules&amp;diff=6142</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Modules&amp;diff=6142"/>
				<updated>2013-09-19T19:32:17Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Discuss modules released for [[T-Engine 4]], as well as their development, here.&lt;br /&gt;
&lt;br /&gt;
Looking to write your own module? [[T4 Modules Howto Guide|check out the documents here for some help.]]&lt;br /&gt;
&lt;br /&gt;
A list of some modules in developement &lt;br /&gt;
* [[Bone Builder]]  &lt;br /&gt;
* [[Broken Bottle]]&lt;br /&gt;
* [[Iron and Steam]]&lt;br /&gt;
* [[Mosaic]]&lt;br /&gt;
* [[Qi Daozei]]&lt;br /&gt;
* [[RPG Engine for T-Engine]]&lt;br /&gt;
* [[Startide]]&lt;br /&gt;
* [[The Power of Dreams]]&lt;br /&gt;
* [[Veins of the Earth]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Modules&amp;diff=6141</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Modules&amp;diff=6141"/>
				<updated>2013-09-19T19:24:52Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Discuss modules released for [[T-Engine 4]], as well as their development, here.&lt;br /&gt;
&lt;br /&gt;
Looking to write your own module? [[T4 Modules Howto Guide|check out the documents here for some help.]]&lt;br /&gt;
&lt;br /&gt;
A list of some modules in developement &lt;br /&gt;
* [[Bone Builder]]  &lt;br /&gt;
* [[Broken Bottle]]&lt;br /&gt;
* [[Iron and Steam]]&lt;br /&gt;
* [[Mosaic]]&lt;br /&gt;
* [[RPG Engine for T-Engine]]&lt;br /&gt;
* [[Startide]]&lt;br /&gt;
* [[The Power of Dreams]]&lt;br /&gt;
* [[Veins of the Earth]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Category:Modules&amp;diff=6140</id>
		<title>Category:Modules</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Category:Modules&amp;diff=6140"/>
				<updated>2013-09-19T19:24:15Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;Modules for T-Engine 4.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modules for T-Engine 4.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Veins_of_the_Earth&amp;diff=6139</id>
		<title>Veins of the Earth</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Veins_of_the_Earth&amp;diff=6139"/>
				<updated>2013-09-19T19:24:00Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Veins of the Earth is a module for T-Engine 4.0.1.&lt;br /&gt;
&lt;br /&gt;
'''Updated''': 16 Sep 2013 (v.0.0.13 aka beta 2.8)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The standalone version (T-Engine + module) can be downloaded from https://github.com/Zireael07/The-Veins-of-the-Earth/releases. The ModDB site downloads come later due to their authorization process.&lt;br /&gt;
&lt;br /&gt;
The game is a playable beta.&lt;br /&gt;
&lt;br /&gt;
'''Contributors WANTED!''' The to-debug branch contains WIP code which isn't working properly for some reason. Any help debugging it is welcome!&lt;br /&gt;
&lt;br /&gt;
Just fork the repo, make your changes and then make a pull request back. There's a list of issues (bugs and ideas) available on git, too.&lt;br /&gt;
&lt;br /&gt;
Remember, do NOT include anything that's not OGL (i.e. no kuo-toa or illithids).&lt;br /&gt;
&lt;br /&gt;
Anything that IS OGL - for example, SRD, Incursion, or the D&amp;amp;D Wiki portions marked as Open Game Content - is fine.&lt;br /&gt;
&lt;br /&gt;
Any contributors will be credited in the Readme. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Features currently implemented include:&lt;br /&gt;
* brand-new start-up screen and menu [standalone version only]&lt;br /&gt;
* 8 classes: fighter, rogue, mage, ranger, cleric, barbarian, druid, warlock&lt;br /&gt;
* 2 prestige classes: shadowdancer, assasin&lt;br /&gt;
* 10 races: human, half-elf, elf, dwarf, half-orc; drow, duergar, deep gnomes&lt;br /&gt;
* a random name generator, taking into account your race and sex&lt;br /&gt;
* working ECL (Effective Character Level)&lt;br /&gt;
* multiclassing &amp;amp; prestige classes&lt;br /&gt;
* colored character sheet&lt;br /&gt;
* randomized unarmed and weapon damage; archery and weapon finesse&lt;br /&gt;
* attack roll &amp;amp; AC &amp;amp; critical hits &amp;amp; offhand attacks &amp;amp; iterative attacks&lt;br /&gt;
* saving throws [Seb]; now take the best of two stats (Dex-Int; Con-Str; Wis-Cha)&lt;br /&gt;
* hp, exp, dungeon level on-screen display&lt;br /&gt;
* inventory &amp;amp; encumbrance&lt;br /&gt;
* spellbook, an iconed hotbar for spells, some 0 and 1st level spells [Seb]&lt;br /&gt;
* armor spell failure chance; key stat must be 9 to cast spells&lt;br /&gt;
* attributes roller before character creation; now guarantees higher stats&lt;br /&gt;
* some monsters up to CR 1; CR displayed in tooltips; monsters drop equipment and corpses&lt;br /&gt;
* feat and skill select [Seb]&lt;br /&gt;
* skill checks and opposed checks, including armor check penalty and racial bonuses; more skill points at first character level&lt;br /&gt;
* skill tests printed to log; max skill ranks implemented&lt;br /&gt;
* most weapons from SRD; magic armors and shields; light sources; amulet of natural armor; cure x wounds potions [Seb]&lt;br /&gt;
* ranged weapons as starting equipment; deep-dwelling races no longer get a torch&lt;br /&gt;
* most melee &amp;amp; skill enhancing feats from SRD&lt;br /&gt;
* working Intuition skill and item identification&lt;br /&gt;
* colored in-game help screen; legend screen&lt;br /&gt;
* stairs have a chance of not changing the dungeon level [Seb]&lt;br /&gt;
* calendar&lt;br /&gt;
* colored tooltips; colored log messages&lt;br /&gt;
* item tooltips&lt;br /&gt;
* terrain effects&lt;br /&gt;
* speed bonuses&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=God&amp;diff=6107</id>
		<title>God</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=God&amp;diff=6107"/>
				<updated>2013-09-01T15:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: Created page with &amp;quot;Gods were powerful beings. Nearly all were killed by the Sher'Tul in the Godhunt, but some escaped.  ==List of Gods== * Amakthel * Gerlyk * Quekorja * Ralkur&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gods were powerful beings. Nearly all were killed by the Sher'Tul in the Godhunt, but some escaped.&lt;br /&gt;
&lt;br /&gt;
==List of Gods==&lt;br /&gt;
* Amakthel&lt;br /&gt;
* Gerlyk&lt;br /&gt;
* Quekorja&lt;br /&gt;
* Ralkur&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Ruins_of_Kor%27Pul&amp;diff=6106</id>
		<title>Ruins of Kor'Pul</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Ruins_of_Kor%27Pul&amp;diff=6106"/>
				<updated>2013-09-01T03:10:30Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: alternate zone info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Zone&lt;br /&gt;
|name=Ruins of Kor'Pul&lt;br /&gt;
|guardian=[[The Shade]], [[The Possessed]], [[Kor's Fury]]&lt;br /&gt;
|floors=3&lt;br /&gt;
|min_level=1&lt;br /&gt;
|max_level=5&lt;br /&gt;
|min_ilevel=1&lt;br /&gt;
|max_ilevel=4&lt;br /&gt;
|width=50&lt;br /&gt;
|height = 50&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Zone Information==&lt;br /&gt;
The ruins of Kor'Pul are a first-tier zone in the northern region of [[Maj'Eyal]], between [[Derth]] and the mountain pass leading to the frozen north.&lt;br /&gt;
&lt;br /&gt;
It has a &amp;quot;dungeon&amp;quot; layout, with darkened corridors connecting rooms that may be lit or dark. It is inhabited by rodents and weak undead.&lt;br /&gt;
&lt;br /&gt;
Its boss is [[The Shade]], a spellcasting undead, who always appears in a special predefined room in the southern part of the third level.&lt;br /&gt;
&lt;br /&gt;
In the alternate zone layout, The Shade has been killed by a gang of bandits but their leader was possessed.&lt;br /&gt;
&lt;br /&gt;
Kor'Pul may have 4 kinds of [[vaults]]: circle, amon sul crypt, rat nest, and skeleton mage cabal.&lt;br /&gt;
&lt;br /&gt;
After returning from the Far East, the [[backup guardian]] is [[Kor's Fury]], yet another undead. This guy just doesn't know when to quit.&lt;br /&gt;
&lt;br /&gt;
The material level range is 1-2 (or 3-4 after returning from the Far East).&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Trollmire&amp;diff=6105</id>
		<title>Trollmire</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Trollmire&amp;diff=6105"/>
				<updated>2013-09-01T02:54:11Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Zone&lt;br /&gt;
|name=Trollmire&lt;br /&gt;
|floors=3&lt;br /&gt;
|guardian=[[Prox the Mighty]], [[Bill]], [[Aluin the Fallen]], [[Shax the Slimy]]&lt;br /&gt;
|min_level=1&lt;br /&gt;
|max_level=5&lt;br /&gt;
|min_ilevel=1&lt;br /&gt;
|max_ilevel=4&lt;br /&gt;
|width=65&lt;br /&gt;
|height=40&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Zone Information==&lt;br /&gt;
The Trollmire is a first-tier dungeon in the northern part of [[Maj'Eyal]], near [[Derth]]. It has a [[material]] level range of 1 to 2 (or 3 to 4 after returning from the Far East). The Trollmire is the starting zone for any race/class combination that doesn't have its own special starting zone.&lt;br /&gt;
&lt;br /&gt;
The Trollmire is inhabited mostly by trolls and animals. It uses a dense forest layout, mostly trees with highly irregular, short, random paths and some clearings. Since beta 32, there is a road connecting the exits and leading to the boss's clearing.&lt;br /&gt;
&lt;br /&gt;
The official boss is [[Prox the Mighty]], a troll; but Prox's boss is [[Bill]] (also a troll, and substantially tougher), whose treasure-filled dwelling is on the secret fourth level. (If you started in the Trollmire, and have only beaten Prox, you are probably level 4-5 and should postpone your chat with Bill, unless you want a seriously challenging fight.)&lt;br /&gt;
&lt;br /&gt;
If you are playing the &amp;quot;alternate&amp;quot; Trollmire (which you can tell by a high level of water), the boss will be [[Shax the Slimy]].&lt;br /&gt;
&lt;br /&gt;
After the returning from the Far East, the [[backup guardian]] is [[Aluin the Fallen]], a fallen [[Sun Paladin]].&lt;br /&gt;
&lt;br /&gt;
The Trollmire can have 6 kinds of [[vaults]]: honey glade, ruined building 1 through 3, snake pit, and mage hideout.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Heart_of_the_Gloom&amp;diff=6104</id>
		<title>Heart of the Gloom</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Heart_of_the_Gloom&amp;diff=6104"/>
				<updated>2013-09-01T02:48:29Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: alternate zone info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Zone| name = Heart of the Gloom| floors = 3| guardian = [[The Withering Thing]], [[The Dreaming One]]| min_level = 1| max_level = 5| min_ilevel = 1| max_ilevel = 2| width = 50| height = 50}}&lt;br /&gt;
&lt;br /&gt;
==Zone Information==&lt;br /&gt;
The Heart of the Gloom is a first-tier dungeon in the northern forest region of [[Maj'Eyal]], near [[Shatur]]. It has a forest layout with one large central clearing with paths leading to numerous smaller outlying clearings. It is fully lit.&lt;br /&gt;
&lt;br /&gt;
The zone is inhabited by corrupted animals and plants; these have been given random [[Cursed]] and [[Doomed]] talents. The boss is [[The Withering Thing]], a corrupted wolf, who appears randomly on the third level.&lt;br /&gt;
&lt;br /&gt;
The alternate zone layout has a dream theme, with [[The Dreaming One]] as the boss.&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Category:Classes&amp;diff=6088</id>
		<title>Category:Classes</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Category:Classes&amp;diff=6088"/>
				<updated>2013-08-24T17:35:25Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ToME4 [[Classes]].&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Category:Class_Guides&amp;diff=6087</id>
		<title>Category:Class Guides</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Category:Class_Guides&amp;diff=6087"/>
				<updated>2013-08-24T17:34:41Z</updated>
		
		<summary type="html">&lt;p&gt;BDota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Guides for ToME classes.&lt;br /&gt;
&lt;br /&gt;
[[Category:Classes]]&lt;/div&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	</feed>