Units on Fire - Modding Question
Posted: 14 Aug 2008, 07:59
I took the lateset units_on_fire luarule from CA, and now I'm trying to mod it so that instead of looking at the 'weapontype', it'll try and find the keyword "Flame" in the weapon category 'name' instead.
My (non-working) code:
vs.
CA Original Code:
My (non-working) code:
Code: Select all
local flamerWeaponDefs = {}
for i=1,#WeaponDefs do
if (WeaponDefs[i].name:find("Flame")) then --// == flamethrower
--// 0.5 cus we want to differ trees an metal/tanks
--// (fireStarter-tag: 1.0->always flame trees, 2.0->always flame units/buildings too)
flamerWeaponDefs[i]=WeaponDefs[i].fireStarter
end
end
CA Original Code:
Code: Select all
local flamerWeaponDefs = {}
for i=1,#WeaponDefs do
if (WeaponDefs[i].type=="Flame") then --// == flamethrower
--// 0.5 cus we want to differ trees an metal/tanks
--// (fireStarter-tag: 1.0->always flame trees, 2.0->always flame units/buildings too)
flamerWeaponDefs[i]=WeaponDefs[i].fireStarter
end
end