Search found 7 matches

by darkrail
Tue Apr 19, 2016 4:13 pm
Forum: Modding help
Topic: Read crafting speed of entities/prototypes with ingame code
Replies: 1
Views: 724

Read crafting speed of entities/prototypes with ingame code

Is it possible to read a fx. assembly machines 1 crafting speed from code that runs ingame, I cant find it anywhere in the API
by darkrail
Tue Apr 19, 2016 9:25 am
Forum: Modding help
Topic: Read the currently active recipe in furnace types
Replies: 3
Views: 1326

Re: Read the currently active recipe in furnace types

Alright Guess I'll make some tests and see what I can do. I should probably add my own versions of the furnaces, as an alternative that can track if the player wants them to
by darkrail
Mon Apr 18, 2016 10:50 pm
Forum: Modding help
Topic: Read the currently active recipe in furnace types
Replies: 3
Views: 1326

Re: Read the currently active recipe in furnace types

So I guess there is no easy way to tell what a furnace is currently crafting?
by darkrail
Sat Apr 16, 2016 12:03 am
Forum: Modding help
Topic: Read the currently active recipe in furnace types
Replies: 3
Views: 1326

Read the currently active recipe in furnace types

Is there any way to read the recipe that the furnace is currently using, fx 5 iron plate into steel plates, without having to go and manually check whats in it's inventory and compare it to all smelting recipes to find a match? (it seems the entity.recipe is empty)
by darkrail
Wed Apr 13, 2016 9:51 pm
Forum: Modding help
Topic: return an array of ALL entities of specific type(assemblers)
Replies: 4
Views: 1529

Re: return an array of ALL entities of specific type(assemblers)

prg wrote:

Code: Select all

for chunk in surface.get_chunks() do
    local entities = surface.find_entities_filtered{name="my-entity", area={{chunk.x*32, chunk.y*32}, {(chunk.x+1)*32, (chunk.y+1)*32}}}
    for _, entity in pairs(entities) do
        --stuff
    end
end
Ah, thank you very much I will try that
by darkrail
Wed Apr 13, 2016 9:25 pm
Forum: Modding help
Topic: return an array of ALL entities of specific type(assemblers)
Replies: 4
Views: 1529

Re: return an array of ALL entities of specific type(assemblers)

alright thanks, if I understand correctly I can go through each of the luasurfaces with a loop right? Also where can I find the max size of the areas used for the find entities
by darkrail
Wed Apr 13, 2016 9:15 pm
Forum: Modding help
Topic: return an array of ALL entities of specific type(assemblers)
Replies: 4
Views: 1529

return an array of ALL entities of specific type(assemblers)

I was looking around the modding api, and I can't seem to find a function that allows me to return an array with all entities of a type, assemblers, furnaces and so forth, have I missed something? Or is the LuaSurface "find_entities_filtered" the way I have to do it?

Go to advanced search