I want to use the lab and its function as a user of science packs to generate "research power".
Unfortunately I can't figure out how the "remaining" of the science pack is handled and stored.'
From the API documentation, there is no corresponding value.
I tried:
- health
- durability (since a science pack is a tool)
Has someone more insight about that, and can help me with it?
[Solved]Science Pack | api call to change "remaining" value?
[Solved]Science Pack | api call to change "remaining" value?
Last edited by paraqles on Thu Apr 14, 2016 10:30 pm, edited 1 time in total.
Re: Lua: Science Pack | api call to change "remaining" value?
When you insert a single portion of items in any consumer, those items disappear at the moment the work begins. If you mine the building, you don't get those back, so the remainder is likely to be stored nowhere.
I believe the lab progress bar shows how far in the consumption of currently inserted items it has gone.
I believe the lab progress bar shows how far in the consumption of currently inserted items it has gone.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Lua: Science Pack | api call to change "remaining" value?
Sure that can be the thing.
But the "remaining" value is in the description tool tip that you get, when you hover over one of the science-pack stacks in the inventory of the lab.
But the "remaining" value is in the description tool tip that you get, when you hover over one of the science-pack stacks in the inventory of the lab.
- Attachments
-
- 20160414174102_1.png (133.03 KiB) Viewed 4032 times
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: Lua: Science Pack | api call to change "remaining" value?
I thought it was "durability", measured between 0 and 1, did that really not work?
Re: Lua: Science Pack | api call to change "remaining" value?
No, it does not work. Besides, that from the LuaAPI Documentation, "durability" is an unsigned integer, capped at max durability of the prototype (for science packs = 1)
Re: Lua: Science Pack | api call to change "remaining" value?
Hold a partially used science pack in the cursor stack and run
Code: Select all
/c game.local_player.print(game.local_player.cursor_stack.durability)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Lua: Science Pack | api call to change "remaining" value?
What the heck?prg wrote:Hold a partially used science pack in the cursor stack and runCode: Select all
/c game.local_player.print(game.local_player.cursor_stack.durability)
The same code i did this morning, now does what i expected it would do.
And especially it does not comply to the API Documentation.
I have to thank you, the first thought was "Ah, man I tried that already", but at least i should give a try if there is a difference between a stack in lab and stack in hand (curosr).
Re: Lua: Science Pack | api call to change "remaining" value?
What? It compiles perfectly with the API documentation and there's no difference between stacks in a lab vs. in the cursor.paraqles wrote:What the heck?prg wrote:Hold a partially used science pack in the cursor stack and runCode: Select all
/c game.local_player.print(game.local_player.cursor_stack.durability)
The same code i did this morning, now does what i expected it would do.
And especially it does not comply to the API Documentation.
I have to thank you, the first thought was "Ah, man I tried that already", but at least i should give a try if there is a difference between a stack in lab and stack in hand (curosr).
If you want to get ahold of me I'm almost always on Discord.
Re: [Solved]Science Pack | api call to change "remaining" value?
Sorry I may be a little unclear:
http://lua-api.factorio.com/0.12.30/Lua ... durability
Says it is "uint" => http://lua-api.factorio.com/0.12.30/Bui ... .html#uint
So it does not behave like the documentation said.
And at my first try to use the durability it just kept the durability at "1".
http://lua-api.factorio.com/0.12.30/Lua ... durability
Says it is "uint" => http://lua-api.factorio.com/0.12.30/Bui ... .html#uint
So it does not behave like the documentation said.
And at my first try to use the durability it just kept the durability at "1".