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
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