5E Product Walkthrough Playlist
  1. #1

    Simple question about XML processing in rulesets

    Greetings,

    I hope this is, indeed, a simple question to answer.

    base.xml, for CoreRPG, looks like:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    
    <!-- 
      Please see the license.html file included with this distribution for 
      attribution and copyright information.
    -->
    
    <root version="3.0" release="4.1" logo="logo.png">
    	<announcement text="Core RPG ruleset (v2021-07-06) for Fantasy Grounds\rCopyright 2021 Smiteworks USA, LLC" font="emotefont" icon="rulesetlogo_CoreRPG" />
    
    	<!-- Attributes -->
    	<description>
    		<displayname>Core RPG</displayname>
    		<author>SmiteWorks USA, LLC</author>
    		<website>https://www.fantasygrounds.com</website>
    	</description>
    	
    	<!-- Tabletop settings -->
    	<includefile source="gameelements.xml" />
    
    	<!-- Graphics -->
    	<includefile source="graphics/graphics_fonts.xml" />
    	<includefile source="graphics/graphics_frames.xml" />
    	<includefile source="graphics/graphics_icons.xml" />
    	<includefile source="graphics/graphics_portraits.xml" />
            .
            .
    up in the 'announcement' stanza, line 9, the specification of 'icon' uses a name, rulesetlogo_CoreRPG, that will not be defined until graphics_icons.xml is read in down at line 24.

    How does that work?

    Thanks!

    - s.west

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,663
    I’m guessing here but the xml just defines things and the lua runs it. So that file is just defining the various things that the lua then uses to do whatever it needs to done. Thus it probably doesn’t matter what order stuff appears in the xml file.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here http://fgapp.idea.informer.com/

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    As Zacchaeus says, <announcement> is just a definition of the announcement. It doesn't "run" the announcement at that line in base.xml - it defines it. Then, when FG fully loads and displays the chat window, the various <announcement> entries defined previously are executed.

    https://fantasygroundsunity.atlassia...8/announcement
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    Or to put it another way, XML is not a procedural language i.e. it does not follow a set of steps in order. It is a declarative language i.e. it declares the ways things are with no implied ordering.

  5. #5
    Got it.

    All three of your responses added something to my repertoire. Thanks!

    - s.west

  6. #6
    Also, while I have your attention here, someone posted (Trenloe, or damned, or Moon Wizard, or?) an answer to the following ruleset development question (and I can't find it again):

    Is it better to: 1) Start with a simple base.xml that contains <importruleset source="CoreRPG" /> and then gradually build on top of that?
    Or is it better to 2) Copy and rename the CoreRPG ruleset, and gradually change it into what you're developing?

    (I hope that question is clear.)

    Thanks, gents!

  7. #7
    It is best to import the CoreRPG as you then start with all of it's resources. You can then declare xml templates and lua scripts that are located there. All of the commercial rulesets use this model and gain the biggest benefit of receiving new core features that are introduced into CoreRPG.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Idea Informer

  8. #8
    Thanks!!

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