<?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=Ratbuddy</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=Ratbuddy"/>
		<link rel="alternate" type="text/html" href="https://te4.org/wiki/Special:Contributions/Ratbuddy"/>
		<updated>2026-04-06T09:47:53Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://te4.org/w/index.php?title=Addons&amp;diff=23174</id>
		<title>Addons</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Addons&amp;diff=23174"/>
				<updated>2026-01-19T21:11:57Z</updated>
		
		<summary type="html">&lt;p&gt;Ratbuddy: note on the addon dir structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]][[Category:Addons]]&lt;br /&gt;
Addons are way for third parties to modify existing modules inside t-engine, as well as publish them in the Steam Workshop. (Here's a non-comprensive [[Addon List]].)  This page covers how you write addons for ToME.&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
&lt;br /&gt;
You're making an addon. The addon is named &amp;quot;coolstuff&amp;quot;. The first thing you do is make a directory &amp;quot;tome-coolstuff&amp;quot; ('''the tome- prefix is mandatory or your addon will not load!''') inside your Steam install of ToME. On my mac, that path is:&lt;br /&gt;
 ~/Library/Application Support/Steam/SteamApps/common/TalesMajEyal/game/addons/&lt;br /&gt;
&lt;br /&gt;
And on Windows, it's usually something like&lt;br /&gt;
 C:\Program Files (x86)\Steam\SteamApps\common\TalesMajEyal\game\addons&lt;br /&gt;
&lt;br /&gt;
On Linux, the path is&lt;br /&gt;
 ~/.steam/steam/SteamApps/common/TalesMajEyal/game/addons&lt;br /&gt;
&lt;br /&gt;
Your addons directory should have these files in it already:&lt;br /&gt;
 tome-addon-dev.teaa&lt;br /&gt;
 tome-items-vault.teaa&lt;br /&gt;
 tome-possessors.teaa&lt;br /&gt;
&lt;br /&gt;
If you can't find the directory, search for one of those file names.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
Every addon has an &amp;lt;nowiki&amp;gt;init.lua&amp;lt;/nowiki&amp;gt; file. The &amp;lt;nowiki&amp;gt;init.lua&amp;lt;/nowiki&amp;gt; file looks like this:&lt;br /&gt;
&lt;br /&gt;
 -- My Cool Addon&lt;br /&gt;
 -- tome-coolstuff/init.lua&lt;br /&gt;
 &lt;br /&gt;
 long_name = &amp;quot;My Awesome Addon&amp;quot;&lt;br /&gt;
 short_name = &amp;quot;coolstuff&amp;quot; -- Determines the name of your addon's file.&lt;br /&gt;
 for_module = &amp;quot;tome&amp;quot;&lt;br /&gt;
 version = {1,3,1}&lt;br /&gt;
 addon_version = {1,0,0}&lt;br /&gt;
 weight = 100 -- The lower this value, the sooner your addon will load compared to other addons.&lt;br /&gt;
 author = {'coolguy@invalid.com'}&lt;br /&gt;
 homepage = 'iamsocool.geocities.com'&lt;br /&gt;
 description = [[Oh my god this stuff is so totally cool.&lt;br /&gt;
 Holy crap I mean it's really super cool, like, wow.&lt;br /&gt;
 ]] -- the [[ ]] things are like quote marks that can span multiple lines&lt;br /&gt;
 tags = {'cool', &amp;quot;stuff&amp;quot;, 'cool stuff'} -- tags MUST immediately follow description&lt;br /&gt;
 &lt;br /&gt;
 overload = true&lt;br /&gt;
 superload = false&lt;br /&gt;
 data = true&lt;br /&gt;
 hooks = true&lt;br /&gt;
&lt;br /&gt;
''addon_version'' is (unsurprisingly) the version of your addon. This is used by the game for automatically downloading addon updates. It's also useful if players want to see which addon version they're currently using. Set it to {1,0,0} initially and increment the value when releasing updates.&lt;br /&gt;
&lt;br /&gt;
''version'' is the module (i.e., ToME) version required for the addon. When making a new addon, you should typically set this to the current ToME version. When releasing addon updates, you should modify this value if your addon changes rely on features from a more recent ToME version.&lt;br /&gt;
&lt;br /&gt;
Properly setting ''overload'', ''superload'', ''hooks'', and ''data'' is super important, because they determine which directories in your addon will be loaded by the game.&lt;br /&gt;
&lt;br /&gt;
===Directory Structure===&lt;br /&gt;
&lt;br /&gt;
* '''overload''': Files in this directory will automatically replace files in the base game. This is very powerful but also incredibly dangerous. (Of course, replacing things like icons is less dangerous than replacing code.)&lt;br /&gt;
* '''superload''': Files in this directory will be read and executed after the base game's file of the same name. This is very powerful but much less dangerous. This is a great way to add content (like new Artifact items) or tweak content (modify a talent's cost or requirements) without accidentally stepping on other tweaks or future content updates.&lt;br /&gt;
* '''data''': Files in this directory will just sit there and be ignored unless you explicitly tell the game to read them. Files in this area live in their own &amp;quot;namespace&amp;quot; and filenames here will never interfere with other addons or the base game. This is a great place to put new classes, talent trees, or races.&lt;br /&gt;
* '''hooks''': Only one file in this directory is automatically executed: &amp;lt;nowiki&amp;gt;load.lua&amp;lt;/nowiki&amp;gt;. This file is a great way to get your &amp;quot;data&amp;quot; files executed at the proper time. It's also a way to augment some parts of the game which specifically support hooks: the Example module shows how the &amp;quot;Actor:takeHit&amp;quot; function is hooked to make the tourist take no damage.  You can also use hooks to load add-on data in to the module, eg. new talents. Find a list of available hooks [[hooks|here]].&lt;br /&gt;
&lt;br /&gt;
The Example addon can be found here: http://te4.org/dl/tmp/tome-example.teaa&lt;br /&gt;
&lt;br /&gt;
A .teaa file is simply a renamed zip that contains the whole addon, so feel free to rename and unzip your favorite addon to see a living example of all the stuff discussed in this article. The &amp;lt;nowiki&amp;gt;tome-example.teaa&amp;lt;/nowiki&amp;gt; addon illustrates how to add a new class, new talents, new timed effects and how to hook onto a few useful locations in the code. (Note that it's a bit old, though.)  When zipping, make sure to zip the files but not the folder.  For example, tome-addonname.zip/init.lua, not tome-addonname.zip/tome-addonname/init.lua.&lt;br /&gt;
&lt;br /&gt;
You can also just put a folder 'tome-addonname' in addons and it will be loaded directly, no need to zip or rename.&lt;br /&gt;
&lt;br /&gt;
== Grammar and Syntax ==&lt;br /&gt;
* The addon folder must be in the format &amp;lt;nowiki&amp;gt;[ModuleName]-[AddonShortName]&amp;lt;/nowiki&amp;gt;. For you, that means &amp;lt;nowiki&amp;gt;tome-coolstuff&amp;lt;/nowiki&amp;gt; is your folder name.&lt;br /&gt;
&lt;br /&gt;
===Overloading===&lt;br /&gt;
Each &amp;lt;nowiki&amp;gt;.teaa&amp;lt;/nowiki&amp;gt; file is just a zip file. The main ToME game code is stored in &amp;lt;nowiki&amp;gt;game/modules/tome.team&amp;lt;/nowiki&amp;gt;, and it is also just a renamed zip file.&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;nowiki&amp;gt;tome.team&amp;lt;/nowiki&amp;gt; somewhere, rename it to &amp;lt;nowiki&amp;gt;tome-1.1.5.zip&amp;lt;/nowiki&amp;gt; and unzip it.&lt;br /&gt;
&lt;br /&gt;
You'll see two directories: &amp;quot;data&amp;quot; and &amp;quot;mod&amp;quot;. Most of the stuff you'll want to mess with at first is in &amp;quot;data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When you use overload to replace a file, the path and name must match exactly the structure in &amp;lt;nowiki&amp;gt;tome.team&amp;lt;/nowiki&amp;gt;. So for example, to replace the types of leather boots in the game, I'd look in the unzipped ToME code and find:&lt;br /&gt;
 tome-1.1.5/data/general/objects/leather-boots.lua&lt;br /&gt;
... and so to overload that, I'd create a file in my addon:&lt;br /&gt;
 tome-coolstuff/overload/data/general/objects/leather-boots.lua&lt;br /&gt;
&lt;br /&gt;
===Superloading===&lt;br /&gt;
&lt;br /&gt;
Just like overloading, superloading requires that you know the file structure of the game so you can make your files get read and executed at the right time. When the game reads in your superload file, you can get access to the previous file's contents using the &amp;lt;nowiki&amp;gt;loadPrevious(...)&amp;lt;/nowiki&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
For example, if we wanted to add a new boot ego, we could do something like this. First, we'd find the boot ego code:&lt;br /&gt;
 data/general/objects/egos/light-boots.lua&lt;br /&gt;
&lt;br /&gt;
Next, we'd make a file in our &amp;lt;nowiki&amp;gt;superload&amp;lt;/nowiki&amp;gt; directory:&lt;br /&gt;
 tome-coolstuff/superload/data/general/objects/egos/light-boots.lua&lt;br /&gt;
&lt;br /&gt;
... and we'd make sure that our &amp;lt;nowiki&amp;gt;init.lua&amp;lt;/nowiki&amp;gt; file had the line:&lt;br /&gt;
 superload = true&lt;br /&gt;
&lt;br /&gt;
We're ready to add the boot ego!&lt;br /&gt;
&lt;br /&gt;
 local _M = loadPrevious(...)&lt;br /&gt;
 newEntity{&lt;br /&gt;
 	power_source = {arcane=true},&lt;br /&gt;
 	name = &amp;quot; of sensing&amp;quot;, suffix=true, instant_resolve=true,&lt;br /&gt;
 	keywords = {sensing=true},&lt;br /&gt;
 	level_range = {1, 50},&lt;br /&gt;
 	rarity = 4,&lt;br /&gt;
 	cost = 2,&lt;br /&gt;
 	wielder = {&lt;br /&gt;
 		see_invisible = resolvers.mbonus_material(20, 5),&lt;br /&gt;
 		see_stealth = resolvers.mbonus_material(20, 5),&lt;br /&gt;
 		blind_immune = resolvers.mbonus_material(30, 20, function(e, v) v=v/100 return 0, v end),&lt;br /&gt;
 	},&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 return _M&lt;br /&gt;
====Modifying mod Stuff====&lt;br /&gt;
&lt;br /&gt;
Hold on, that example still didn't use _M at all! So what is _M for? Since most things in the &amp;lt;nowiki&amp;gt;data&amp;lt;/nowiki&amp;gt; directory are stored in easily accessible structures, you don't need _M to get them. _M is generally used for stuff in the &amp;lt;nowiki&amp;gt;mod&amp;lt;/nowiki&amp;gt; directory: the most dangerous stuff to modify. Here's an example which modifies the &amp;quot;levelup&amp;quot; function in &amp;lt;nowiki&amp;gt;mod/Actor.lua&amp;lt;/nowiki&amp;gt;. Your file for this code should be in &amp;lt;nowiki&amp;gt;/superload/mod/Actor.lua&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
 local _M = loadPrevious(...)&lt;br /&gt;
 local base_levelup = _M.levelup&lt;br /&gt;
 &lt;br /&gt;
 function _M:levelup()&lt;br /&gt;
   -- Do stuff &amp;quot;before&amp;quot; loading the original file&lt;br /&gt;
 &lt;br /&gt;
   -- execute the original function&lt;br /&gt;
   local retval = base_levelup(self)&lt;br /&gt;
 &lt;br /&gt;
   -- Do stuff &amp;quot;after&amp;quot; loading the original file&lt;br /&gt;
 &lt;br /&gt;
   -- return whatever the original function would have returned&lt;br /&gt;
   return retval&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 return _M&lt;br /&gt;
&lt;br /&gt;
Whenever possible, superloaded functions should call the original function rather than replacing it entirely.  This maintains compatibility with other addons.&lt;br /&gt;
&lt;br /&gt;
==Uploading your Addon==&lt;br /&gt;
&lt;br /&gt;
{{:Addon Uploading}}&lt;/div&gt;</summary>
		<author><name>Ratbuddy</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Meteor_rain_(talent)&amp;diff=12941</id>
		<title>Meteor rain (talent)</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Meteor_rain_(talent)&amp;diff=12941"/>
				<updated>2016-12-24T16:40:17Z</updated>
		
		<summary type="html">&lt;p&gt;Ratbuddy: Ratbuddy moved page Meteor rain (talent) to Meteor Rain (talent): In-game it says Meteor Rain, not Meteor rain.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Meteor Rain (talent)]]&lt;/div&gt;</summary>
		<author><name>Ratbuddy</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=Meteor_Rain_(talent)&amp;diff=12940</id>
		<title>Meteor Rain (talent)</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=Meteor_Rain_(talent)&amp;diff=12940"/>
				<updated>2016-12-24T16:40:16Z</updated>
		
		<summary type="html">&lt;p&gt;Ratbuddy: Ratbuddy moved page Meteor rain (talent) to Meteor Rain (talent): In-game it says Meteor Rain, not Meteor rain.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Ability_box&lt;br /&gt;
|game_version=1.4.6&lt;br /&gt;
|name=Meteor Rain&lt;br /&gt;
|category_type=[[NPC Only (category type)|NPC Only]]&lt;br /&gt;
|category=Spell&lt;br /&gt;
|image=Meteor rain.png&lt;br /&gt;
|cooldown=30&lt;br /&gt;
|cost=70 Mana&lt;br /&gt;
|desc=&lt;br /&gt;
Uses arcane forces to summon {{cts|3.3|4.8|log}} meteors that fall on the ground, smashing all around in a radius 2 for {{ctspd|15|250}} fire and {{ctspd|15|250}} physical damage.&lt;br /&gt;
The hit zone will also turn into lava for 8 turns.&lt;br /&gt;
The effects will increase with your Spellpower.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ratbuddy</name></author>	</entry>

	</feed>