DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    Require/Force Download a Module from within a Ruleset

    I have been working for a few months now on a customized rule set that extends the 3.5E rule set, and in the process I have also been expanding and reformatting the various reference modules so that they contain data I can access from within mt rule set code. For instance, I have written the code that whenever a character types the name for their race on the character sheet that the modules will get searched to pull in info such as the level adjustment or size category for that race. I have included many such features that search through the various modules to automate the character creation process. So my question is whether there is some way to require that my players have my customized modules and/or to somehow force push the latest versions from my machine to my players similarly to how it is done for images. Like all FG rule sets, mine will work without the modules present, but they are utilized so heavily in my rule set that I want to force the latest versions down to my players each game. Thanks in advance.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    At the campaign level you can "force" the players to download certain modules - see "Module Availability" here: https://www.fantasygrounds.com/wiki/...e_Availability

    There is a Module API available: https://www.fantasygrounds.com/refdoc/Module.xcp

    You could use Module.setModulePermissions(<name>, true, true) to setup specific named modules to force load: https://www.fantasygrounds.com/refdo...ulePermissions

    You could use Module.getModules and then Module.getModuleInfo to step through the modules available and make sure they've been activated by the GM and that they are available: https://www.fantasygrounds.com/refdo...#getModuleInfo You could write info to the chat log in case there were any issues with the module activation (perhaps the GM doesn't have all of the modules installed).
    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!

  3. #3
    Kick ***! Thanks a ton.

  4. #4
    In a related question, how do I assure that my players have the most recent version of any changes that I have made to my module files? Do I need to manually add some kind of version number, or does FG simply push the latest versions down to the players every time they connect? Again, thanks in advance.

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    If you set the modules to force load then FG will push the modules to the players.
    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!

  6. #6
    Thanks again... This software is awesome and every thing I learn about it just makes me love it even more! This will really help speed up character creation for my players.

  7. #7

    One more related question...

    Quote Originally Posted by Trenloe View Post
    At the campaign level you can "force" the players to download certain modules - see "Module Availability" here: https://www.fantasygrounds.com/wiki/...e_Availability

    There is a Module API available: https://www.fantasygrounds.com/refdoc/Module.xcp

    You could use Module.setModulePermissions(<name>, true, true) to setup specific named modules to force load: https://www.fantasygrounds.com/refdo...ulePermissions

    You could use Module.getModules and then Module.getModuleInfo to step through the modules available and make sure they've been activated by the GM and that they are available: https://www.fantasygrounds.com/refdo...#getModuleInfo You could write info to the chat log in case there were any issues with the module activation (perhaps the GM doesn't have all of the modules installed).
    Thanks Again Trenloe for this great advice, I really like this approach to ensure that the modules that I have worked so hard on get properly distributed and loaded. One last question I have where in the code should I place this (or any other) initialization code that I want to take place as soon as my Ruleset is loaded. Currently my approach has been to place initialization code in a function called during the Desktop's initialization, but I am sure there is likely a more appropriate place for such functionality to be called.

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Quote Originally Posted by DMFirmy View Post
    Thanks Again Trenloe for this great advice, I really like this approach to ensure that the modules that I have worked so hard on get properly distributed and loaded. One last question I have where in the code should I place this (or any other) initialization code that I want to take place as soon as my Ruleset is loaded. Currently my approach has been to place initialization code in a function called during the Desktop's initialization, but I am sure there is likely a more appropriate place for such functionality to be called.
    Putting it in a function as part of the desktop onInit() function is the earliest point to do this in your ruleset code (so there is a desktop available to report issues). However, I'd recommend to split this out into it's own global script, perhaps call it manager_mymodules.lua with the code you need in that file's onInit() function. Then, in your ruleset initialize this file using a <script> tag at the end of the base.xml file; so that it is the last code to run during ruleset initialization.
    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!

  9. #9
    Thanks for the advice. I appreciate it a lot.

  10. #10

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
  •  
5E Product Walkthrough Playlist

Log in

Log in