Page 1 of 1

altering fuel

Posted: Mon May 01, 2017 2:05 am
by aober93
I need help. How do i find out where fuel values are stored, so i can mod them?

Afaik every value is stored in data.raw . Some sort of global table you can directly access.
I tried like /c game.player.print(data.raw.fuel.coal) but i get errors :?

anyone know whats wrong? (And sometimes it sais "attempt to index data ,a nil value" wtf i thought data has everything how can it be nil)

And whats a prototype exactly?

Re: altering fuel

Posted: Mon May 01, 2017 9:29 am
by prg
Access to the data table is only available during the data loading stage, see Data Lifecycle.

You can see how the base game defines fuel values in data/base/prototypes/item/demo-item.lua and item.lua.

During runtime, you can access fuel values via LuaItemPrototype.fuel_value.

Re: altering fuel

Posted: Mon May 01, 2017 4:12 pm
by aober93
k that helps alot! Im trying to modify recipes, but i dont know how the recipes are stored. I mean i checked "demo_recipes" for exampel wood. Do i like data.raw.{type = "recipe", name = "wood", ingredients = {{"raw-wood", 1}}, result = "wood", result_count = 2}

or data.raw.recipe.wood.result_count = 10 ?

Is it correct if i assume that the prototypes are in the form of "structure of (type,name,other attributes)", while data.raw is structured like data.raw.type.name.structure of (type,name,other attributes)? Because i checke one tutorial and it didnt tell exactly. It just pointed me at a lua file lol, and i dont know lua.

i tried to print it out, so i understand the structure ,no other way right?