PDA

View Full Version : Ruleset Loading Option



Samarex
April 23rd, 2017, 03:17
Good Morning all,
I am trying something but not sure if it can be done. I got two ideas on how to do it.
First off I have added a Option the the Options Manager it has 3 Settings
Standard|DnD(1e)|ADnd (2E)
This is for a Rule set that uses the 5E Base code.


OptionsManager.registerOption2("GRSV", false, "option_header_houserule", "option_label_GRSV", "option_entry_cycler",
{ labels = "option_val_gvone|option_val_gvtwo", values = "dnd1e|adnd2e", baselabel = "option_val_standard", baseval = "", default = "" });
That is working fine it shows up and I can toggle the separate options. Now for the Lua to make it work. (lua will be located in the base.xml during ruleset load)


function onInit()
loadOptions();
end

function loadOptions()
local sRuleOpt = OptionsManager.getOption("GRSV");


if sRuleOpt = "dnd1e" then

-- what to put here

elseif sRuleOpt = "adnd2e" then

-- what to put here
else

end


end

These options are going to control a lot but its based on a extension. What I want to do is either
1- Have the Option load the proper extension ext1.ext or ext2.ext Standard just loads ruleset normal without any extension.

or

2- At the end of the base xml run the script to find what the Option is set at and then include the files for that option. (Basically having the extension.xml
wording in the script.

3- Any Ideas you all may have.

Thank You
Samarex

Moon Wizard
April 24th, 2017, 10:04
Since extensions need to be chosen before a campaign loads, you can not data inside a campaign (i.e. options) to load extensions.

If you are going down the route of trying to shoehorn another rules system into an existing system, you would have to include all the files and dynamically update every sheet based on the rules system. This is very complex. I've only done it once (for Pathfinder and 3.5E), and they are very similar systems.

I would recommend against this approach. My recommendation is to build off of the CoreRPG system, and borrow 5E code when it makes sense.

Regards,
JPG