<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://te4.org/w/index.php?action=history&amp;feed=atom&amp;title=T4modules-4emodule_3</id>
		<title>T4modules-4emodule 3 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://te4.org/w/index.php?action=history&amp;feed=atom&amp;title=T4modules-4emodule_3"/>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4modules-4emodule_3&amp;action=history"/>
		<updated>2026-09-28T08:52:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://te4.org/w/index.php?title=T4modules-4emodule_3&amp;diff=2701&amp;oldid=prev</id>
		<title>Canderel: Created page with &quot;== 4Emodule Part 3: Race and Class features == t4modules t4modules | t4modules module howto guides  Part 2's lua file got pretty long, making it hard to find things an...&quot;</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4modules-4emodule_3&amp;diff=2701&amp;oldid=prev"/>
				<updated>2013-05-21T13:22:44Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== 4Emodule Part 3: Race and Class features == &lt;a href=&quot;/w/index.php?title=T4modules_t4modules&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;T4modules t4modules (page does not exist)&quot;&gt;t4modules t4modules&lt;/a&gt; | &lt;a href=&quot;/w/index.php?title=T4modules_module_howto_guides&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;T4modules module howto guides (page does not exist)&quot;&gt;t4modules module howto guides&lt;/a&gt;  Part 2&amp;#039;s lua file got pretty long, making it hard to find things an...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 4Emodule Part 3: Race and Class features ==&lt;br /&gt;
[[t4modules t4modules]] | [[t4modules module howto guides]]&lt;br /&gt;
&lt;br /&gt;
Part 2's lua file got pretty long, making it hard to find things and to maintain.  In this part, we will be defining talents by using multiple files.&lt;br /&gt;
&lt;br /&gt;
Track down your /data/talents.lua file and clear it out.  Replace it with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
load(&amp;quot;/data/talents/features/features.lua&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the directory and file /data/talents/features/features.lua with the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
newTalentType{ type=&amp;quot;base/class&amp;quot;, name = &amp;quot;class&amp;quot;, hide = true, description = &amp;quot;The basic talents defining a class.&amp;quot; }&lt;br /&gt;
newTalentType{ type=&amp;quot;base/race&amp;quot;, name = &amp;quot;race&amp;quot;, hide = true, description = &amp;quot;The various racial bonuses a character can have.&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
-- common&lt;br /&gt;
load(&amp;quot;/data/talents/features/proficiency.lua&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- racial&lt;br /&gt;
load(&amp;quot;/data/talents/features/dwarf.lua&amp;quot;)&lt;br /&gt;
load(&amp;quot;/data/talents/features/eladrin.lua&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- class&lt;br /&gt;
load(&amp;quot;/data/talents/features/fighter.lua&amp;quot;)&lt;br /&gt;
load(&amp;quot;/data/talents/features/ranger.lua&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This structure allows us to keep all race and class feature talents together in the features directory, and each individual race or class gets assigned its own file for its feature definitions.&lt;br /&gt;
&lt;br /&gt;
Beware however, you need to actually create these files, even if they are empty, or your module will be unable to start.&lt;br /&gt;
&lt;br /&gt;
/data/talents/features/fighter.lua:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
newTalent{&lt;br /&gt;
	name = &amp;quot;Fighter One-Handed Weapon Talent&amp;quot;,&lt;br /&gt;
	short_name = &amp;quot;Fighter One Handed&amp;quot;,&lt;br /&gt;
	type = { &amp;quot;base/class&amp;quot;, 1 },&lt;br /&gt;
	info = &amp;quot;Attack bonus when using one-handed weapons&amp;quot;,&lt;br /&gt;
	mode = &amp;quot;passive&amp;quot;,&lt;br /&gt;
	hide = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
newTalent{&lt;br /&gt;
	name = &amp;quot;Fighter Two-Handed Weapon Talent&amp;quot;,&lt;br /&gt;
	short_name = &amp;quot;Fighter Two Handed&amp;quot;,&lt;br /&gt;
	type = { &amp;quot;base/class&amp;quot;, 1 },&lt;br /&gt;
	info = &amp;quot;Attack bonus when using two-handed weapons&amp;quot;,&lt;br /&gt;
	mode = &amp;quot;passive&amp;quot;,&lt;br /&gt;
	hide = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
newTalent{&lt;br /&gt;
	name = &amp;quot;Combat Superiority&amp;quot;,&lt;br /&gt;
	type = { &amp;quot;base/class&amp;quot;, 1 },&lt;br /&gt;
	info = &amp;quot;Gain a bonus to opportinity attacks equal to wisdom modifier.&amp;quot;,&lt;br /&gt;
	mode = &amp;quot;passive&amp;quot;,&lt;br /&gt;
	hide = true,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not too impressive, since they are all passive abilities.  Alone, they do not do anything, but the code can test for then (such as before swinging a one-handed weapon) and decide what their effects are.&lt;br /&gt;
&lt;br /&gt;
T-Engine will interpret these files and create talent variables in the ActorTalents object for you.  To refer to them again, such as when assigning during birth, you should take the short_name (or name if no short_name is defined), uppercase it, replace its spaces with _'s and append a T_ to the front.  In this way the talent &amp;quot;Fighter One Handed&amp;quot; becomes ActorTalents.T_FIGHTER_ONE_HANDED.&lt;/div&gt;</summary>
		<author><name>Canderel</name></author>	</entry>

	</feed>