PDA

View Full Version : Similar Extension to 'Smoothed Bonuses'



PhilFischer
October 20th, 2010, 06:18
I play in a weird campaign that uses a different Stat Bonus system. It is (Stat - 50) / 2.

Is there a way I could make my own extension to do this? Could I get the source code to the 'Smoothed Bonuses' extension?

Of course the campaign has other weird rules; but that is the big one.

StuartW
October 20th, 2010, 06:42
Stat bonus is deliberately exposed, so can be modified using an extension. Take a copy of the smoothed bonus extension (I think it is just a folder in the extensions directory, so you can copy the whole folder and rename it), and edit the extension.xml file. That file should contain some Lua script which looks like this:


function onInit()
OptionManager.register("abilitybonus",SmoothedBonus);
end

function SmoothedBonus(optname,win)
local val = 0;
if not win or not win.temp then
return 0;
end
val = win.temp.getValue();
if val > 95 then
return (val-95)*2+15;
elseif val > 89 then
return (val-89)+9;
elseif val > 71 then
return math.floor((val-72)/3)+4;
elseif val > 59 then
return math.floor((val-60)/4)+1;
elseif val > 40 then
return 0;
elseif val > 28 then
return math.floor((val-29)/4)-3;
elseif val == 28 then
return -4;
elseif val > 12 then
return math.floor((val-13)/3)-9;
elseif val > 10 then
return -10;
elseif val > 5 then
return val - 21;
else
return val*2 - 27;
end
end

You need to change it to look like this:


function onInit()
OptionManager.register("abilitybonus",MyBonus);
end

function MyBonus(optname,win)
local val = 0;
if not win or not win.temp then
return 0;
end
val = win.temp.getValue();
return math.floor((val-50)/2);
end


You will also need to change the top part of the extension.xml file so the extension doesn't clash with the smoothed bonus one. You should change this:


<name>Smoothed Bonuses</name>
<description>Smoothes ability bonuses, consistent with RM Companion I.</description>

To this:


<name>House Bonuses</name>
<description>Converts bonuses to house rules.</description>

Hope that helps

Stuart

PhilFischer
October 20th, 2010, 16:46
Thanks Stuart, this is awesome.
Here is the untested compressed directory. Will test it tonight.

Is there a place I can see what else is 'exposed'?

StuartW
October 20th, 2010, 18:50
I'm afraid that only the skill bonus was exposed like this, although there are one or two other areas that can be tweaked with some more effort, such as the development points associated with a given stat value and the skill percentage associated with a given number of skill ranks.

Stuart

PhilFischer
August 6th, 2013, 04:15
Hello Mr. StuartW or anyone else that may know.
Will this Linear Bonus Ext above still work in current RM Classic as of Aug/5/2013?

Dakadin
August 6th, 2013, 04:25
If you are using the latest version of the RMC ruleset (1.5.5) then you can use the extension here: https://www.fantasygrounds.com/forums/showthread.php?18058-Smooth-and-Linear-Stat-Extensions

You can find a list of extension here: https://www.fantasygrounds.com/forums/showthread.php?17227-List-of-Extensions-and-Modules

PhilFischer
August 7th, 2013, 04:06
Thanks this worked great.