Page 1 of 1

[0.10.1] Game.itemprototypes naming

Posted: Fri Jun 27, 2014 3:19 pm
by Rahjital
The prototype values of LuaItemPrototype in game.itemprototypes have different names from the values in prototype definition files.

Image
(Please be sure to view the entire image)

Stacksize and fuelvalue lack underscores (should be stack_size and fuel_value) while buildresult is named entirely differently (should be place_result).

Re: [0.10.1] Game.itemprototypes naming

Posted: Thu Jul 10, 2014 10:56 am
by slpwnd
The naming (without underscores) is intentional. The standard lua naming across the api is without underscores. The lua prototype definition files use naming with underscores for historical reasons. I understand it can be annoying though.

The buildresult is renamed to placeresult for 0.10.3 to keep consistency.

Re: [0.10.1] Game.itemprototypes naming

Posted: Thu Jul 10, 2014 11:28 am
by Rahjital
Ah, that makes sense. The wiki is very misleading as it says the values are the same as in the prototype definiton files, but adding a little warning about the different naming system should resolve this issue.