PDA

View Full Version : Monster Mash



Stormonu
July 14th, 2006, 19:55
I've just started fooling with Fantasy Grounds, but I've got a lot I want to be able to do it. I've already figured out how to add my own monsters to my personal ruleset, but I've got a lot I want to add (MM2, FF, MM3, CC, CC2, CC3, MoF, and my own (400+ creatures alone)).

I'd like to have it when you click on the monster book that it comes up with a subscreen where you can select the book and/or letter of the alphabet, and then it goes only to that particular section (which would then look like the current monster selection screen). If I can sneak it in, I'd also love to be able to list creatures by CR (terrain would be nice too, but that may be too much).

Can anyone assist me with the code to do this? Is it doable?

tdwyer11b
July 15th, 2006, 05:30
Sure you can do it. I'm not saying it's easy, but it's not hard either. Just time consuming. Instead of the monster book referencing the monster nodes directly, you can set up the nodes to be the names of the books you want to use (ie MM3) using a linklist. Then you'd create a node with then name of the book with the list of monsters from that book which then references the monsters.xml. Dunno if that makes sense, but if you look at how the spells are arranged you should get the idea.

Stormonu
July 15th, 2006, 08:11
Well, I've gotten started on this, and I've gotten this far. Right now, the list is hard-coded, but I would prefer to get it to be an expandable list (like the classes on the referenceroot screen). I'm still working out the monster file organization, so I haven't gotten into it too heavy.

https://img157.imageshack.us/img157/9417/monstermashtx5.png

Now, the problem I've run into is getting it to show just the monsters from one source. I'm trying to break the monsters into files with one book's worth of monsters per file.

I've tried adding a super-node above the level of the monsters, but when the monsterlist screen shows up, it's blank. I've tried to follow the flow of the spells as suggested, but I can't just seem to quite make it work.

Example:



<root>
<node name="sourcebook">
<node name="BM">
<stringvalue name="booksource" value="Bestiary Malfearous" />
<node name="monster">
<node name="acidfrog">
<stringvalue name="name" value="Acid Frog" />
<stringvalue name="type" value="Medium Magical Beast" />
<stringvalue name="hd" value="2d10+2" />
<stringvalue name="speed" value="40 ft. (8 squares), swim 20 ft. (4 squares)" />
<stringvalue name="ac" value="15 (+3 Dex, +2 natural), touch 13, flat 12" />
<stringvalue name="babgrp" value="+2/+3" />
<stringvalue name="atk" value="Claw +3 melee or Spit +5 ranged" />
<stringvalue name="fullatk" value="3 Claws +3 melee or Spit +5 ranged touch" />
<stringvalue name="spacereach" value="5 ft./5 ft." />
<stringvalue name="specialattacks" value="Entangle, Leap Attack, Spit acid" />
<stringvalue name="specialqualities" value="Acid immunity, acid skin, darvision 60 ft." />
<stringvalue name="skills" value="Jump +12, Listen +3, Spot +2" />
<stringvalue name="feats" value="Multiattack(B), Point-Blank Shot" />
<stringvalue name="environment" value="Temperate or Warm Swamp" />
<stringvalue name="organization" value="Solitary or Pride (5-20)" />
<stringvalue name="treasure" value="None" />
<stringvalue name="alignment" value="Always neutral" />
<stringvalue name="advancement" value="4 HD (Large), 5-8 HD (Huge)" />
<stringvalue name="leveladjustment" value="+3 (cohort) " />
<intvalue name="strength" value="12" />
<intvalue name="dexterity" value="16" />
<intvalue name="constitution" value="12" />
<intvalue name="intelligence" value="2" />
<intvalue name="wisdom" value="12" />
<intvalue name="charisma" value="5" />
<intvalue name="fortitudesave" value="+2" />
<intvalue name="reflexsave" value="+2" />
<intvalue name="willsave" value="+0" />
<intvalue name="hp" value="13" />
<intvalue name="init" value="3" />
<intvalue name="cr" value="1" />
<formattedtext name="text">
<p><i>The water erupts to reveal a man-sized mottled green tree frog. It has three forward legs that it holds close to its body, as if ready to spring. Its large eyes glow with an inner yellow light and it licks its mouth with its sticky tongue. A small bit of the creatures spittle falls to the ground, where it hisses and spits as it chews away at the ground underneath.</i></p>
<p>Acid Frogs are aggressive denizens of the swamp and marshlands with a powerful natural defense - their bodies secrete acid that can eat through almost all materials. Acid frogs normally dine on smaller animals native to their habitat,and in scarce times have been known to become cannibalistic. All tadpoles and newt-frog stages are solid black.</p>

<p>COMBAT</p>
<p>Acid Frogs are unnaturally aggressive, and will often attack opponents much larger than themselves. Only female acid frogs will shy from attacking other females. The acid frog generally strikes by thrusting itself upwards, making it appear to stand for a few seconds, in which it strikes with its three clawed arms. Acid frogs are well-known for using bull rushes.</p>
<p><b>Acid Immunity (Ex):</b> An acid frog takes no damage from acid attacks.</p>
<p><b>Acid Skin (Ex):</b> Any item that touches the skin of an acid frog is exposing itself to the slimy acid secretions that cover the frog's skin. The acid causes 1d6 damage on contact, Reflex DC 12 save for half damage.</p>
<p>An acid frog that remains at least half-submerged in an single area of stagnant water for a minute or more causes an area 15 feet in diameter around itself to deal 1d6 acid damage per round. For each additional acid frog in the area of effect, the damage is increased by 1d6, up to 20d6 per round. The acid can be dispersed by vigorous motion and the application of more non-acid liquid (minimum 20 gallons per 5 ft. cube), dropping the damage by one die per 5 rounds of dilution. In large bodies of water, the acid naturally degrades one die of damage in one minute.</p>
<p><b>Entangle (Ex):</b> Instead of clawing, the acid frog can lash out with its acid coated tongue as a +5 touch ranged attack with a range of 10 feet. The tongue can withstand 8 hit points of damage before it is severed. If the tongue lands a blow, the victim must make a DC 17 Reflex save or be considered grappled.</p>
<p><b>Leap Attack (Ex):</b> As a special charge attack, if a acid frog leaps at least 10 feet to engage a foe (ending the leap in contact with the opponent), it may make a full attack.</p>
<p><b>Spit Acid (Ex):</b> If backed into a corner, the acid frog can strike out with a vicious acid spittle. The spittle is a ranged touch attack with a +5 bonus to hit and can be shot out to a distance of 30 feet and affects one target, causing 4d4 damage on the first round, and an additional 2d4 damage for two additional rounds. A DC 15 Reflex save negates the additional damage. The acid frog can use it's spittle only once per minute.</p>
<p><b>Skills:</b> An acid frog has a +8 racial bonus to Jump checks.</p>

</formattedtext>
</node>
</node>
</node>
</node>
</root>


(This is a monster of my own creation, BTW)

I don't know if this helps, but here is the code from my reference file to do this...(this portion appears like its supposed to and opens the monsterlist like it's supposed to, but the monsterlist is blank).



<windowclass name="monsterroot">
<frame name="monsterroot" />
<defaultsize width="480" height="398" />
<sheetdata>
<windowopencontrol name="SRDmonsters">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="33,25,200,25" />
<class name="SRDmonsterlist" />
<description text="SRD Monsters" />
</windowopencontrol>
<stringcontrol>
<bounds rect="63,25,170,20" />
<static value="SRD" />
<link handler="SRDmonsters" underlineoffset="-2" />
</stringcontrol>

<windowopencontrol name="BMmonsters">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="33,50,200,25" />
<class name="BMmonsterlist" />
<description text="Bestiary Malfearous Monsters" />
</windowopencontrol>
<stringcontrol>
<bounds rect="63,50,170,20" />
<static value="Beastiary Malfearous" />
<link handler="BMmonsters" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>


(the "monsterroot" frame is a copy of the referenceroot.png, modified with crinkled paper background)

and the BMmonsterlist class that the monsterroot calls...(This is where I'm getting an empty screen)



<windowclass name="BMmonsterlist">
<datasource name="Bestiary Malfearous Monsters" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="670" height="450" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157" />
<icon name="title_monsters" />
</staticgraphic>
<windowlist class="monstersmall" name="list">
<s-ort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>


Any ideas on what I'm doing wrong, or a better way to do this?

Stormonu
July 15th, 2006, 11:16
Okay, figured out a way to shorten some of the code by turning the "source list" into an XML file. The initial screen looks the same, but rather than hard-coding the list of books, it draws from a xml list.

Ex.



<root>
<node name="sources">
<node name="SRD">
<stringvalue name="name" value="SRD"/>
</node>
<node name="BM">
<stringvalue name="name" value="Bestiary Malfearous"/>
</node>
<node name="BN">
<stringvalue name="name" value="Bestiary Nefareous"/>
</node>
<node name="BO">
<stringvalue name="name" value="Bestiary Onerous" />
</node>
<node name="MM2">
<stringvalue name="name" value="Monster Manual 2" />
</node>
<node name="FF">
<stringvalue name="name" value="Fiend Folio" />
</node>
<node name="MoF">
<stringvalue name="name" value="Monster of Faerun" />
</node>
<node name="MM3">
<stringvalue name="name" value="Monster Manual 3" />
</node>
<node name="CC">
<stringvalue name="name" value="Creature Collection" />
</node>
<node name="CC2">
<stringvalue name="name" value="Creature Collection 2" />
</node>
<node name="CC3">
<stringvalue name="name" value="Creature Collection 3" />
</node>
<node name="ToH">
<stringvalue name="name" value="Tome of Horrors" />
</node>
<node name="ToH2">
<stringvalue name="name" value="Tome of Horrors 2" />
</node>
<node name="ToH3">
<stringvalue name="name" value="Tome of Horrors 3" />
</node>
</node>
</root>


The code for the monster screen in my "d20_reference.xml" now looks like this:



<!-----MONSTERS-------------------------------------------------------------------------------------->
<windowclass name="monsterroot">
<frame name="monsterroot" />
<defaultsize width="480" height="398" />
<sheetdata>
<windowlist class="monsterrootsmall">
<bounds rect="33,25,200,325" />
</windowlist>

</sheetdata>
</windowclass>

<windowclass name="monsterrootsmall">
<datasource name="sources" />
<defaultsize width="350" height="27" />
<sheetdata>
<windowopencontrol name="openmonstersource">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="0,0,24,24" />
<class name="monsterlist" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="30,2,220,20" />
<link handler="openmonstersource" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>

<windowclass name="monsterlist">
<datasource name="source,monster" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="670" height="450" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157" />
<icon name="title_monsters" />
</staticgraphic>
<windowlist class="monstersmall" name="list">
<s-ort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="monstersmall">
<datasource name="monster" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="monster" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<empty value="&laquo; Empty Monster Data &raquo;" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>


(I've rearranged the sections in my file to follow the flow easier as well)

The "monsterroot" seems to work fine, but when you click on a sourcebook, it brings up the screen that should list the monsters ("monsterlist"), but it's blank. I'm thinking I need some sort linklist or such to somehow tie the sourcebook name to the monster list. I'm still frantically working at it, but if anyone has any ideas, please let me know!

I've fiddled around with the actual monster file a bit, but so far, no luck, so I've changed things back to the way I had them previously. For right now, it pretty much looks that same as the last entry.

<edit> And suddenly, after hours of working at this, it dawns on me what tdwyer11b is talking about...Gah, I feel like an idiot...let's see if I can figure out how to make the linklist work....

Kalan
July 15th, 2006, 13:05
Okay, figured out a way to shorten some of the code by turning the "source list" into an XML file. The initial screen looks the same, but rather than hard-coding the list of books, it draws from a xml list.

Ex.



<root>
<node name="sources">
<node name="SRD">
<stringvalue name="name" value="SRD"/>
</node>
<node name="BM">
<stringvalue name="name" value="Bestiary Malfearous"/>
</node>
<node name="BN">
<stringvalue name="name" value="Bestiary Nefareous"/>
</node>
<node name="BO">
<stringvalue name="name" value="Bestiary Onerous" />
</node>
<node name="MM2">
<stringvalue name="name" value="Monster Manual 2" />
</node>
<node name="FF">
<stringvalue name="name" value="Fiend Folio" />
</node>
<node name="MoF">
<stringvalue name="name" value="Monster of Faerun" />
</node>
<node name="MM3">
<stringvalue name="name" value="Monster Manual 3" />
</node>
<node name="CC">
<stringvalue name="name" value="Creature Collection" />
</node>
<node name="CC2">
<stringvalue name="name" value="Creature Collection 2" />
</node>
<node name="CC3">
<stringvalue name="name" value="Creature Collection 3" />
</node>
<node name="ToH">
<stringvalue name="name" value="Tome of Horrors" />
</node>
<node name="ToH2">
<stringvalue name="name" value="Tome of Horrors 2" />
</node>
<node name="ToH3">
<stringvalue name="name" value="Tome of Horrors 3" />
</node>
</node>
</root>

The code for the monster screen in my "d20_reference.xml" now looks like this:



<!-----MONSTERS-------------------------------------------------------------------------------------->
<windowclass name="monsterroot">
<frame name="monsterroot" />
<defaultsize width="480" height="398" />
<sheetdata>
<windowlist class="monsterrootsmall">
<bounds rect="33,25,200,325" />
</windowlist>

</sheetdata>
</windowclass>

<windowclass name="monsterrootsmall">
<datasource name="sources" />
<defaultsize width="350" height="27" />
<sheetdata>
<windowopencontrol name="openmonstersource">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="0,0,24,24" />
<class name="monsterlist" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="30,2,220,20" />
<link handler="openmonstersource" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>

<windowclass name="monsterlist">
<datasource name="source,monster" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="670" height="450" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157" />
<icon name="title_monsters" />
</staticgraphic>
<windowlist class="monstersmall" name="list">
<s-ort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="monstersmall">
<datasource name="monster" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="monster" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<empty value="&laquo; Empty Monster Data &raquo;" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>

(I've rearranged the sections in my file to follow the flow easier as well)

The "monsterroot" seems to work fine, but when you click on a sourcebook, it brings up the screen that should list the monsters ("monsterlist"), but it's blank. I'm thinking I need some sort linklist or such to somehow tie the sourcebook name to the monster list. I'm still frantically working at it, but if anyone has any ideas, please let me know!

I've fiddled around with the actual monster file a bit, but so far, no luck, so I've changed things back to the way I had them previously. For right now, it pretty much looks that same as the last entry.

<edit> And suddenly, after hours of working at this, it dawns on me what tdwyer11b is talking about...Gah, I feel like an idiot...let's see if I can figure out how to make the linklist work....

The other way to do it is to use diff files for each source, then have a new windowclass reference each file. Just setup each windowclass the same, just have it reference the new file.

Linklist too would work...either way, not difficult code, just a LOT of work right now :S

zambol
July 16th, 2006, 00:25
You can have all monsters in same file if you insert new stringvalue for each node and use it to select correct monsters to list

Example:

Add to each monster node:

<stringvalue name="book" value="SRD" />

Select monsters from one book to list:

<windowlist class="monsterrootsmall">
<filter field="book" value="SRD" />
<bounds rect="33,25,200,325" />
</windowlist>

Stormonu
July 16th, 2006, 06:38
I'd considered adding a book field to each monster entry, but I gave up on it because I didn't know about the filter command. I'll keep that in mind for some of the other things I'm doing.

What I'd really like to be able to do is to get this to work without having to modify the SRD files, so I can distribute the structure out to others, and maybe make a foundation for adding custom files/content without having to muck up the SRD/base files.

I've half-way figured out the linklist - I now am using a formattext block to open the monster screen, but it still shows up blank (sort of the way you open up the Classes {say Wizard} and can click a link that opens all wizard spells, evocation spells, etc. Somehow I'm missing that critical link between the source and the monster and I can't quite figure out what I'm doing wrong.

...And now FantasyGrounds "blows up" every time I exit with my modified files. :(

Just as an aside, this is my first exposure to XML coding; I normally only do a little bit of VB studio as a hobby, and I haven't found a good XML guide that helps with any of the coding I'm seeing in the Fantasyground files.

Here is the latest code snippets:

Reference File


<windowclass name="monsterroot">
<frame name="monsterroot"></frame>
<defaultsize width="480" height="398"></defaultsize>
<sheetdata>
<windowlist class="monsterrootsmall">
<bounds rect="33,25,200,325"></bounds>
</windowlist>
</sheetdata>
</windowclass>

<windowclass name="monsterrootsmall">
<datasource name="sources"></datasource>
<defaultsize width="350" height="27"></defaultsize>
<sheetdata>
<formattedtextcontrol name="text">
<bounds rect="0,0,200,25"></bounds>
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont"></font>
<linkicon link="button_openwindow2" emptylink="button_emptytarget"></linkicon>
</formattedtextcontrol>
</sheetdata>
</windowclass>

<windowclass name="monsterlist">
<datasource name="monstersource"></datasource>
<frame name="referencebox"></frame>
<dynamic></dynamic>
<defaultsize width="670" height="450"></defaultsize>
<minimumsize width="200" height="220"></minimumsize>
<softclose></softclose>
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157"></bounds>
<icon name="title_monsters"></icon>
</staticgraphic>
<stringcontrol name="description">
<bounds rect="50,20,300,20"></bounds>
</stringcontrol>
<windowlist class="monstersmall" name="list">
<s-ort fields="name"></s-ort>
<bounds rect="50,45,-20,-18"></bounds>
<footer image="footer_narrow"></footer>
<columns width="300"></columns>
</windowlist>
<scroller>
<bounds rect="-65,-42,45,27"></bounds>
<target name="list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
</sheetdata>
</windowclass>

<windowclass name="monstersmall">
<datasource name="monstersource"></datasource>
<defaultsize width="200" height="20"></defaultsize>
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow"></icon>
<bounds rect="3,0,20,20"></bounds>
<class name="monster"></class>
<description field="name"></description>
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20"></bounds>
<empty value="&laquo; Empty Monster Data &raquo;"></empty>
<link handler="open" underlineoffset="-2"></link>
</stringcontrol>
</sheetdata>
</windowclass>

<windowclass name="monster">
<datasource name="monster"></datasource>
<dynamic></dynamic>
<defaultsize width="270" h-eight="400"></defaultsize>
<minimumsize width="270" height="400"></minimumsize>
<minimize icon="minimized_npc"></minimize>
<sheetdata>
<subwindow name="1description">
<class name="monster_description"></class>
</subwindow>
<subwindow name="2combat">
<class name="monster_combat"></class>
<activate></activate>
</subwindow>
<subwindow name="3other">
<class name="monster_other"></class>
</subwindow>

<windowchangecontrol>
<bounds rect="-20,10,15,80"></bounds>
<target name="1description"></target>
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,94,15,80"></bounds>
<target name="2combat"></target>
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,178,15,80"></bounds>
<target name="3other"></target>
</windowchangecontrol>
</sheetdata>
</windowclass>


monsterlist.xml


<root>
<node name="sources">
<node name="SRD">
<stringvalue name="name" value="SRD"></stringvalue>
<formattedtext name="text">
<linklist>
<link class="monsterlist" recordname="SRD">SRD</link>
</linklist>
</formattedtext>
</node>
<node name="BM">
<stringvalue name="name" value="Bestiary Malfearous"></stringvalue>
<formattedtext name="text">
<linklist>
<link class="monsterlist" recordname="BM">Bestiary Malfearous</link>
</linklist>
</formattedtext>
</node>
...snip


and monstersource.xml


<root>
<node name="monstersource">
<node name="SRD">
<stringvalue name="description" value="SRD"></stringvalue>
<node name="monstershort">
<node name="aboleth">
<stringvalue name="name" value="Aboleth"></stringvalue>
</node>
</node>
</node>
<node name="BM">
<stringvalue name="description" value="Bestiary Malfearous"></stringvalue>
<node name="monstershort">
<node name="acidfrog">
<stringvalue name="name" value="Acid Frog"></stringvalue>
</node>
</node>
</node>
</node>
</root>

Stormonu
July 16th, 2006, 10:19
Yeah, I'm still working at it. Got it to stop blowing up on closing the program - apparently I was letting the list of sourcebooks roll off the bottom of the screen and the program doesn't like that. :o

I'm still confused why I can't get the link from the sourcebook to actual monster list to work. I've tried to set it up almost exactly like the link from the classes sheet to spells, but the program doesn't seem to be recoginize the "monstershort" node, even though I can get it to print the name of the sourcebook on the monster sheet (just not the monsters!), which tells me it is getting into at least the node below "source" (like SRD, or BM).

What am I doing wrong?

zambol
July 16th, 2006, 17:23
I got it working.

Fixes:
1) change "windowclass:Monstersmall":s datasource to "monstershort"
2) add "<nestdata />" to "windowclass:monsterlist:windowlist"


<windowclass name="monsterlist">
<datasource name="monstersource"></datasource>
<frame name="referencebox"></frame>
<dynamic></dynamic>
<defaultsize width="670" height="450"></defaultsize>
<minimumsize width="200" height="220"></minimumsize>
<softclose></softclose>
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157"></bounds>
<icon name="title_monsters"></icon>
</staticgraphic>
<stringcontrol name="description">
<bounds rect="50,20,300,20"></bounds>
</stringcontrol>
<windowlist class="monstersmall" name="list">
<nestdata />
<s-ort fields="name"></s-ort>
<bounds rect="50,45,-20,-18"></bounds>
<footer image="footer_narrow"></footer>
<columns width="300"></columns>
</windowlist>
<scroller>
<bounds rect="-65,-42,45,27"></bounds>
<target name="list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
</sheetdata>
</windowclass>

Stormonu
July 16th, 2006, 18:02
Thanks, that got it to work!

Now to start adding monsters...:eek:

Stormonu
July 17th, 2006, 01:08
Okay, I got sick of cut & paste the name of the monsters in the SRD to a file and decided to simplify things a bit. I moved the "monstersource" to the actual monster file, changed the "monstersmall" to look at the monster node and presto, instant list.

Now, your probably wondering why I went through all the bother of that.

It's simple, next, my goal is to create a way to export monsters from e-tools in Fantasy Grounds XML monster format, putting each book of monsters into its own file. Once I've created a sheet in e-tools that does the job, I'm going to check with the CMP gods (and the Smiteworks folks) to see if it is legal to post here for those who use e-tools.

I love anything that saves me a bunch of typing. :)

Final code:

d20Modified_desktop.XML
Replace windowopencontrol:button_monsterbook with the following



<windowopencontrol>
<icon normal="button_monsterbook" pressed="button_monsterbook_down"></icon>
<bounds rect="10,540,91,86"></bounds>
<class name="monsterroot"></class>
<shortcut key="o" modifier="control"></shortcut>
<nodrag></nodrag>
<closetoggle></closetoggle>
</windowopencontrol>


d20Modified_reference.XML
Replace windowclass:monstersmall and windowclass:monsterlist with the following.

Note: I use a custom frame called "monsterroot.png" that is "cleared" version of "referenceroot.png". I modified the code below to use "referencebox.png" below instead.



<windowclass name="monsterroot">
<frame name="referencebox"></frame>
<defaultsize width="480" height="398"></defaultsize>
<sheetdata>
<windowlist class="monsterrootsmall">
<bounds rect="33,25,445,325"></bounds>
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont"></font>
<linkicon link="button_openwindow2" emptylink="button_emptytarget"></linkicon>
</windowlist>
</sheetdata>
</windowclass>

<windowclass name="monsterrootsmall">
<datasource name="sources"></datasource>
<defaultsize width="450" height="27"></defaultsize>
<sheetdata>
<formattedtextcontrol name="text">
<bounds rect="0,0,200,25"></bounds>
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont"></font>
<linkicon link="button_openwindow2" emptylink="button_emptytarget"></linkicon>
</formattedtextcontrol>
<columns width="220"></columns>
</sheetdata>
</windowclass>

<windowclass name="monsterlist">
<datasource name="monstersource"></datasource>
<frame name="referencebox"></frame>
<defaultsize width="670" height="450"></defaultsize>
<minimumsize width="200" height="220"></minimumsize>
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157"></bounds>
<icon name="title_monsters"></icon>
</staticgraphic>
<stringcontrol name="description">
<bounds rect="50,20,300,20"></bounds>
</stringcontrol>
<stringcontrol name="name">
<bounds rect="50,40,300,20"></bounds>
</stringcontrol>
<windowlist class="monstersmall" name="list">
<s-ort fields="name"></s-ort>
<bounds rect="50,45,-20,-18"></bounds>
<nestdata />
<footer image="footer_narrow"></footer>
<columns width="300"></columns>
</windowlist>
<scroller>
<bounds rect="-65,-42,45,27"></bounds>
<target name="list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
<scroller>
<bounds rect="-65,-42,45,27"></bounds>
<target name="list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
</sheetdata>
</windowclass>

<windowclass name="monstersmall">
<datasource name="monster"></datasource>
<defaultsize width="200" height="20"></defaultsize>
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow"></icon>
<bounds rect="3,0,20,20"></bounds>
<class name="monster"></class>
<description field="name"></description>
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20"></bounds>
<empty value="&laquo; Empty Monster Data &raquo;"></empty>
<link handler="open" underlineoffset="-2"></link>
</stringcontrol>
</sheetdata>
</windowclass>



monstersource.XML
This is a new file, and should be placed in the database folder. Be insure to include a static refererence to it in your base.XML. You will want to create a node for each book source (using the SRD as a base)


<root>
<node name="sources">
<node name="SRD">
<stringvalue name="name" value="SRD"></stringvalue>
<formattedtext name="text">
<linklist>
<link class="monsterlist" recordname="SRD">SRD</link>
</linklist>
</formattedtext>
</node>
</node>
</root>


monster.XML
Add the following 3 lines to the beginning of the monster file. You will need to change the node name underneath monstersource to the name of the book/source from above. Be sure to add two closing node statements (</node>) just before the </root> at the end of the file.

I personally suggest making your own monster file (and including it as a static file in base.XML) rather than tacking your monsters into the SRD file. For example, I've put all my custom monsters in monsterBM.XML ("BM" is the monstersource name for the creatures within, BTW).


<node name="monstersource">
<node name="SRD">
<stringvalue name="description" value="SRD"></stringvalue>


And that should do it. If I've left anything out, I'll edit it in later.

Stormonu
July 17th, 2006, 06:36
Whoops! Well, It now opens a list of monsters, but if you double-click a monster to open it, it shows a blank monster entry! Let me see if I can fix that....