FG Spreadshirt Swag
Page 2 of 2 First 12

Thread: Monster Mash

  1. #11
    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

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

    Code:
    	<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)
    Code:
    <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).
    Code:
    <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.

  2. #12
    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....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in