My problem is that the function for calculating your general alignment returns a 0 every time.
A somewhat related question, wouldn't it be easier for functions if the variable inside the parantheses was an arguments table like tARGS was? If it's possible, is there a way to do that?
Sorry for the cringey coding, I have ADHD and kind of suck at everything. I just noticed I probably could've put a tonumber() around the { .. } or something to avoid typing it three times.
tARGS = { ... }
-- print("tARGS 1 is"..tARGS[1]..".")
-- print("tARGS 2 is"..tARGS[2]..".")
b = tonumber(tARGS[1]) -- Base
o = tonumber(tARGS[2]) -- Looter number
x = tonumber(tARGS[3]) -- Looted number
m = 0 -- Multipler
ad = 0 -- Difference between alignment
oal = 0 -- Looter alignment
xal = 0 -- Looted alignment
if x > o then
ad = x - o
else
ad = o - x
end
function align(num, align)
if num > 0 then
align = 1
else
if num < 0 then
align = -1
else
align = 0
end
end
end
align(o, oal)
align(x, xal)
print("Alignment difference = "..ad)
print("Looter alignment = "..oal)
print("Looted alignment = "..xal)
math.abs(x)
math.abs(o)
if xal == -1 then
m = (0.1 * x) + m
end
if xal == 1 then
m = (-0.05 * x) + m
end
Edited by meeko011, 29 January 2016 - 03:36 AM.












