Loading...
  OR  Zero-K Name:    Password:   

error on tweak defs load

10 posts, 259 views
Post comment
Filter:    Player:  
sort
[Spoiler]

looking to multiply weapon ranges in batch
any help is appreciated thanks
+0 / -0

2 months ago
There isn't a "weaponDefs" table. You need to iterate over weapons inside units. Try this
for name, ud in pairs(UnitDefs) do
  if ud.weapondefs then
    for _, wd in pairs(ud.weapondefs) do
      if wd.range then
        wd.range = wd.range * 4
      end
    end
  end
end
+1 / -0
.
+0 / -0
.
+0 / -0
.
+0 / -0
.
+0 / -0
.
+0 / -0
got it all working
+0 / -0
hello im having another problem again =P
[Spoiler]

it gave me an error something like attempt to index 'cp' (a number value)

so after some research i replaced pairs with ipairs and it doesnt give any errors but sadly also wont work

the odd thing is i cant seem to get any code that affects customparams to work in batch

can someone give me a clue if its regarding
quote:
 _, 


can anyone please help me?

thanks.
+0 / -0
.
+0 / -0