Module Code Library
by
, June 7th, 2014 at 10:51 (209387 Views)
This is a work in progress. I will be adding to it as I go.
Making this for future reference when making modules. If anyone wants to add anything to this, let me know in the comments.
Base Structure
db.xml, client.xml, and common.xml files:
definition.xml file:Code:<?xml version="1.0" encoding="ISO-8859-1"?> <root version="3.0"> <library static="true"> <!-- static is optional --> <module> <name type="string">MODULE NAME</name> <categoryname type="string">CATEGORY NAME</categoryname> <entries> </entries> </module> </library> <reference static="true"> </reference> <lists static="true"> </lists> </root>
ClassesCode:<?xml version="1.0" encoding="ISO-8859-1"?> <root version="3.0"> <name>MODULE NAME</name> <author>MODULE AUTHOR</author> <ruleset>RULESET</ruleset> <!-- must match the name of the .pak file exactly --> </root>
- item
- reference_classspelllist
- reference_weapontablelist
- referenceindex
- referencetext
- referencetextfeat
- referencetextwide
- referenceweapon
- spelldesc
Reference TextReference IndexCode:<referanceElement> <name type="string">NAME</name> <text type="formattedtext"> <p>TEXT</p> </text> </referanceElement>RecordnameCode:<indexElement> <name type="string">NAME</name> <index> <listElement> <listlink type="windowreference"> <class>CLASS</class> <recordname>PATH TO RECORD</recordname> </listlink> <name type="string">NAME</name> </listElement> </index> </indexElement>
Referencing from inside current module:
reference.element1.element2
Referencing from a different module:
reference.element1.element2@moduleName
Links
Library Link:
List LinkCode:<librarylink type="windowreference"> <class>CLASS</class> <recordname>PATH TO RECORD</recordname> <!-- Can be .. if the record follows the librarylink --> </librarylink> <name type="string">LISTING NAME</name> <text type="formattedtext"> <!-- Only need when using .. for librarylink --> TEXT </text>
LinkCode:<listlink type="windowreference"> <class>CLASS</class> <recordname>PATH TO RECORD</recordname> </listlink> <name type="string">LISTING NAME</name>
FeatsCode:<link class="CLASS" recordname="PATH TO RECORD">DESCRIPTION</link>
Standard Use:
Code:<featElement> <name type="string">FEAT NAME</name> <type type="string">FEAT TYPE</type> <mult type="number">0</mult> <!-- Can the feat be taken multiple times? 1 = yes 0 = no --> <stack type="number">0</stack> <!-- Does the feat stack? 1 = yes 0 = no --> <prerequisites type="string">PREREQUISITE</prerequisites> <benefit type="formattedtext"> <p>BENEFIT DESCRIPTION</p> <!-- <p></p> required --> </benefit> <normal type="formattedtext"> <!-- Only needed if the feat requires it. Will not show up if omitted. --> <p>NORMAL DESCRIPTION</p> </normal> <special type="formattedtext"> <!-- Same as above. --> <p>SPECIAL DESCRIPTION</p> </special> </featElement>I'm unsure on the stack tag, but think that's how it works.
Racial Trait Use:
Class Ability Use:Code:<racialTraitElement> <name type="string">TRAIT NAME</name> <type type="string">Racial Trait</type> <mult type="number">0</mult> <stack type="number">0</stack> <benefit type="formattedtext"> <p>TRAIT DESCRIPTION</p> <!-- <p></p> required --> </benefit> </racialTraitElement>
SpellsCode:<classAbilityElement> <name type="string">ABILITY NAME</name> <type type="string">Class Ability</type> <mult type="number">0</mult> <stack type="number">0</stack> <benefit type="formattedtext"> <p>ABILITY DESCRIPTION</p> <!-- <p></p> required --> </benefit> </classAbiltyElement>ItemsCode:<spellElement> <name type="string">NAME</name> <school type="string">SCHOOL</school> <level type="string">LEVEL</level> <components type="string">COMPONENTS</components> <castingtime type="string">CASTING TIME</castingtime> <range type="string">RANGE</range> <effect type="string">EFFECT OR TARGET</effect> <duration type="string">DURATION</duration> <save type="string">SAVE;</save> <sr type="string">SPELL RESISTANCE</sr> <description type="formattedtext"> <p>DESCRIPTION</p> </description> <shortdescription type="string">SHORT DESCRIPTION</shortdescription> </spellElement>
Standard Weapons:
Magic Weapon:Code:<weaponElement> <name type="string">WEAPON NAME</name> <cost type="string">N gp</cost> <weight type="number">N</weight> <!-- without lb(kg) --> <damage type="string">NdN</damage> <!-- Ex. 1d3 --> <critical type="string">N-N/xN</critical> <!-- Ex. 19-20/x2, or x3 --> <range type="number">N</range> <!-- without ft(m) --> <damagetype type="string">DAMAGE TYPE</damagetype> <!-- Ex. Slashing --> <properties type="string">PROPERTIES</properties> <!-- Ex. Reach --> <type type="string">Weapon</type> <subtype type="string">SUBTYPE</subtype> <!-- Ex. Simple Unarmed Melee --> <description type="formattedtext"> <p>WEAPON DESCRIPTION</p> </description> </weaponElement>
Magic Item:Code:<magicWeaponElement> <name type="string">NAME</name> <nonid_name type="string">NONID NAME</nonid_name> <isidentified type="number">1</isidentified> <locked type="number">1</locked> <bonus type="number">N</bonus> <damage type="string">NdN</damage> <critical type="string">N-N/xN</critical> <range type="number">N</range> <aura type="string">AURA HERE</aura> <cl type="number">N</cl> <prerequisites type="string">CRAFTING REQUIREMENTS</prerequisites> <cost type="string">N gp</cost> <type type="string">Weapon</type> <subtype type="string">SUBTYPE</subtype> <description type="formattedtext"> <p>DESCRIPTION</p> </description> </magicWeaponElement>
ListsCode:<magicElement> <name type="string">NAME</name> <nonid_name type="string">NONID NAME</nonid_name> <isidentified type="number">1</isidentified> <locked type="number">1</locked> <aura type="string">AURA HERE</aura> <cl type="number">N</cl> <prerequisites type="string">CRAFTING REQUIREMENTS</prerequisites> <cost type="string">N gp</cost> <type type="string">MAGIC ITEM TYPE</type> <description type="formattedtext"> <p>DESCRIPTION</p> </description> </magicElement>
Weapon Table List
Class Spell List:Code:<listElement> <description type="string">LIST NAME</description> <groups> <section001> <description type="string">SECTION DESCRIPTION</description> <subdescription type="string">SECTION SUBDESCRIPTION</subdescription> <weapons> <weaponElement> <link type="windowreference"> <class>referenceweapon</class> <recordname>PATH TO RECORD</recordname> </link> <name type="string">WEAPON NAME</name> <cost type="string">N gp</cost> <weight type="string">N lb.</weight> <damage type="string">NdN</damage> <critical type="string">N-N/xN</critical> <range type="string">N or -</range> <damagetype type="string">DAMAGE TYPE</damagetype> <properties type="string">PROPERTIES</properties> </weaponElement> </weapons> </section001> </groups> </listElement>
Code:<listElement> <description type="string">LIST NAME</description> <groups> <level0> <description type="string">Bard Level 1</description> <spells> <spellElement> <link type="windowreference"> <class>spelldesc</class> <recordname>PATH TO RECORD</recordname> </link> <level type="number">N</level> </spellElement> </spells> </level0> </groups> </listElement>