function f_health_add adds 10, 15, 20 health to the base health of fighters depending on armor tech known
if any issues then please let me know
https://www.dropbox.com/sh/n1pa89bqr4qd ... BqIoa?dl=0
I am trying to mod the health of fighters / bombers per armor technology
I spent last two evenings flipping through PiL book, but only thing I figured so far is that I don't like Lua that much
here is my code in WEAPONS.lua
Code: Select all
local health_add = 0
local a = (w?.object?.empire or gui_player()):known 'Duranium Construction'
local b = (w?.object?.empire or gui_player()):known 'Adamantium Construction'
local c = (w?.object?.empire or gui_player()):known 'Neutronium Construction'
if a then health_add = 10 end
if b then health_add = 15 end
if c then health_add = 20 end
also I changed fighter / bomber health to health = 20+foo(w)
now, what is happening
every time I run the game I get "trying to index nil value" for each local a, local b, local c inside foo()
if I comment those 3 lines out before game starts, and I revert back (remove comments) once game loaded my save game, everything works fine and as intended
my head hurts , any help appreciated