Cosmere RPG Beta Launch
View RSS Feed

RTFallen

Module Code Library

Rating: 3 votes, 3.67 average.
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:
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>
definition.xml file:
Code:
<?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>
Classes

  • item
  • reference_classspelllist
  • reference_weapontablelist
  • referenceindex
  • referencetext
  • referencetextfeat
  • referencetextwide
  • referenceweapon
  • spelldesc


Reference Text

Code:
<referanceElement>
    <name type="string">NAME</name>
    <text type="formattedtext">
        <p>TEXT</p>
    </text>
</referanceElement>
Reference Index

Code:
<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>
Recordname

Referencing from inside current module:
reference.element1.element2

Referencing from a different module:
reference.element1.element2@moduleName

Links

Library Link:
Code:
<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>
List Link
Code:
<listlink type="windowreference">
	<class>CLASS</class>
	<recordname>PATH TO RECORD</recordname>
</listlink>
<name type="string">LISTING NAME</name>
Link
Code:
<link class="CLASS" recordname="PATH TO RECORD">DESCRIPTION</link>
Feats

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:
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>
Class Ability Use:
Code:
<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>
Spells

Code:
<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>
Items

Standard Weapons:
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 Weapon:
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>
Magic Item:
Code:
<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>
Lists

Weapon Table 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>
Class Spell List:
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>

Submit "Module Code Library" to Digg Submit "Module Code Library" to del.icio.us Submit "Module Code Library" to Google Submit "Module Code Library" to Facebook Submit "Module Code Library" to Twitter

Updated July 13th, 2014 at 23:24 by RTFallen

Categories
Code Library

Comments

  1. RTFallen's Avatar
    Combinations

    Linklist and Feats
    Code:
    <library static="true"> <!-- static is optional -->
        <module>
            <name type="string">MODULE NAME</name>
            <categoryname type="string">CATEGORY</categoryname>
            <entries>
                <librarylink type="windowreference"> 
    	        <class>referenceindex</class>
    	        <recordname>reference.feats</recordname>
                </librarylink>
                <name type="string">Feats</name>
            </entries>
        </module>
    </library>
    <reference>
        <feats>
            <name type="string">Feats</name>
            <index>
                <featElement>
                    <listlink type="windowreference">
    	            <class>referencefeat</class>
    	            <recordname>..</recordname>
                    </listlink>
                    <name type="string">FEAT NAME</name>
                    <type type="string">FEAT TYPE</type>
    	        <mult type="number">0</mult> 
    	        <stack type="number">0</stack> 
                    <prerequisites type="string">PREREQUISITE</prerequisites>
    	        <benefit type="formattedtext">
    	            <p>BENEFIT DESCRIPTION</p>
    	        </benefit>
    	        <normal type="formattedtext">
    		    <p>NORMAL DESCRIPTION</p>
    	        </normal>
    	        <special type="formattedtext">
    		    <p>SPECIAL DESCRIPTION</p>
    	        </special>
                </featElement>
            </index>
        </feats>
    </reference>
    Updated July 13th, 2014 at 23:31 by RTFallen
  2. RTFallen's Avatar
    Reserved
TALES of the VALIANT

Log in

Log in