-
November 10th, 2014, 01:51 #1
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
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.
-
November 10th, 2014, 02:04 #2
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!
-
November 10th, 2014, 03:10 #3
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
Kick ***! Thanks a ton.
-
November 10th, 2014, 13:14 #4
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
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.
-
November 10th, 2014, 13:23 #5
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!
-
November 10th, 2014, 13:33 #6
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
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.
-
November 11th, 2014, 02:27 #7
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
One more related question...
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.
-
November 11th, 2014, 03:31 #8
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!
-
November 11th, 2014, 04:13 #9
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
Thanks for the advice. I appreciate it a lot.
-
November 11th, 2014, 11:31 #10
Hey DMFirmy - what are you working on? Can you tell us some more about your project?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks