Dragon_of_old
August 7th, 2016, 02:33
Hello everyone
I’m trying to build a custom ruleset for a game system I want to run. I have it how I want it to look, but I know nothing about “Lua”, so I’m keeping it very, very simple, so for right now I just want to write script that takes five values and adds them together to make a sixth value at is the total of the other five. I’ve done a little with Javascript but that is it.
So like stat A is “1”, stat B is “2”, stat C is “4”, armor stat is “1”, race stat is “2” and finally comes out in the Total stat as “10” it keeps an eye on it so if a play change a stat it updates.
This is what I have tried
function onInit()
STATa = statA.getValue();
STATb = statB.getValue();
STATc = statC.getValue();
ARMmod = armMod.getValue();
RACEmod = raceMod.getValue();
totA = (STATa + STATb);
totB = (STATc + ARMmod);
totC = (totB + RACEmod);
total.setValue(totC);
end
If there is a better way to do this, I am all ears.
I’m trying to build a custom ruleset for a game system I want to run. I have it how I want it to look, but I know nothing about “Lua”, so I’m keeping it very, very simple, so for right now I just want to write script that takes five values and adds them together to make a sixth value at is the total of the other five. I’ve done a little with Javascript but that is it.
So like stat A is “1”, stat B is “2”, stat C is “4”, armor stat is “1”, race stat is “2” and finally comes out in the Total stat as “10” it keeps an eye on it so if a play change a stat it updates.
This is what I have tried
function onInit()
STATa = statA.getValue();
STATb = statB.getValue();
STATc = statC.getValue();
ARMmod = armMod.getValue();
RACEmod = raceMod.getValue();
totA = (STATa + STATb);
totB = (STATc + ARMmod);
totC = (totB + RACEmod);
total.setValue(totC);
end
If there is a better way to do this, I am all ears.