MadBeardMan
November 22nd, 2015, 14:02
Afternoon Folks,
Been working on the scripting required for working out the MOD values within Traveller.
However I've spent that last hour or more (time flies when you're coding) hitting a brick wall.
Seems;
if nMyValue == 0 then
nMyModValue = -3;
elseif nMyValue <=2 then
nMyModValue = -2;
elseif nMyValue <=4 then
nMyModValue = -1;
end
Throws an error upon loading the ruleset.
However I do have it working using a long winded method
function onSourceUpdate()
local nValue = calculateSources();
local nModValue = 0;
if nValue == 0 then
nModValue = -3;
elseif nValue == 1 then
nModValue = -2;
elseif nValue == 2 then
nModValue = -2;
else
nModValue = 0;
end
However I've got the values 0-15 to check so that's a lot of code for something I should be able to (hopefully) say x < y.
Cheers
Colin
Been working on the scripting required for working out the MOD values within Traveller.
However I've spent that last hour or more (time flies when you're coding) hitting a brick wall.
Seems;
if nMyValue == 0 then
nMyModValue = -3;
elseif nMyValue <=2 then
nMyModValue = -2;
elseif nMyValue <=4 then
nMyModValue = -1;
end
Throws an error upon loading the ruleset.
However I do have it working using a long winded method
function onSourceUpdate()
local nValue = calculateSources();
local nModValue = 0;
if nValue == 0 then
nModValue = -3;
elseif nValue == 1 then
nModValue = -2;
elseif nValue == 2 then
nModValue = -2;
else
nModValue = 0;
end
However I've got the values 0-15 to check so that's a lot of code for something I should be able to (hopefully) say x < y.
Cheers
Colin