Page 1 of 1

Documentation page: AttackParameters.ammo_category should be ammo_categories

Posted: Wed Feb 12, 2020 2:59 pm
by ownlyme
Since 0.18 i think, the ammo_category of all weapons is nil

Code: Select all

game.print( i.." "..tostring(gun_inventory[i].prototype.name))
game.print( i.." "..tostring(gun_inventory[i].prototype.attack_parameters.ammo_category  ))
game.print( i.." "..tostring(gun_inventory[i].prototype.attack_parameters.ammo_type   ))
outputs:
Screenshot_2.png
Screenshot_2.png (59.74 KiB) Viewed 1136 times
also affects vehicle weapons.

edit: it's now called ammo_categories but the documentation is wrong... https://lua-api.factorio.com/latest/Con ... Parameters
table format is: {[1] = ammo_category_1_name, [2] = ammo_category_2_name,...}

Re: Documentation page: AttackParameters.ammo_category should be ammo_categories

Posted: Wed Feb 12, 2020 4:09 pm
by Honktown

Re: Documentation page: AttackParameters.ammo_category should be ammo_categories

Posted: Wed Feb 12, 2020 4:45 pm
by posila
Thanks for the report, and thanks @Honktown linking the change.
Fixed doc for 0.18.7