Search found 289 matches

by PFQNiet
Mon Jul 26, 2021 11:17 am
Forum: Modding interface requests
Topic: Hide 0W electric-energy-interface from power graph
Replies: 3
Views: 921

Hide 0W electric-energy-interface from power graph

If an electric-energy-interface is set up to produce power, then it will also show on the Consumption side as draining 0W. Conversely, an interface that consumes power shows as "producing" 0W in the graph. Basically, it's superfluous at best and confusing at worst. Similarly, if an interfa...
by PFQNiet
Sun Jul 25, 2021 9:46 pm
Forum: Ideas and Requests For Mods
Topic: Control Spotify from factorio
Replies: 3
Views: 2028

Re: Control Spotify from factorio

Does your keyboard not have media keys? Even if there aren't dedicated keys, there's usually a key combo to quickly skip to the next track. And if there isn't, any decent music player should provide hotkey functionality.
by PFQNiet
Sun Jul 25, 2021 9:45 pm
Forum: Modding interface requests
Topic: Trigger on_force_created for default forces
Replies: 2
Views: 968

Re: Trigger on_force_created for default forces

Ah that's a fair point. I hadn't considered that! Thanks for pointing it out.
by PFQNiet
Sun Jul 25, 2021 11:59 am
Forum: Modding interface requests
Topic: Trigger on_force_created for default forces
Replies: 2
Views: 968

Trigger on_force_created for default forces

Even though they are the default forces that always exist, I sort of imagined they'd be created at some point. However, on_force_created is not called for any of the player, enemy or neutral default forces. My workaround: event_handler.add_lib{ on_init = function() on_force_created{name=defines.even...
by PFQNiet
Sat Jul 24, 2021 8:31 pm
Forum: Ideas and Requests For Mods
Topic: Switch a switch with a simple clic
Replies: 5
Views: 1575

Re: Switch a switch with a simple clic

Welcome to the realm of modding :D Make sure you understand what the code is doing and I hope to see your creations in future!
by PFQNiet
Sat Jul 24, 2021 11:18 am
Forum: Ideas and Requests For Mods
Topic: Switch a switch with a simple clic
Replies: 5
Views: 1575

Re: Switch a switch with a simple clic

The power switch's GUI does have other uses, notably when using it with the circuit network, so I wouldn't advise bypassing it entirely. However, you can add a custom-input to work with it. data.lua: data:extend{ { type = "custom-input", name = "toggle-power-switch", key_sequence...
by PFQNiet
Fri Jul 23, 2021 6:41 pm
Forum: Technical Help
Topic: Failure loading mod
Replies: 7
Views: 2069

Re: Failure loading mod

The error message says that you have K2SETweaks enabled and it's trying to load space-exploration but space-exploration isn't enabled. Normally this shouldn't happen because space-exploration should be listed as a dependency, but the mod author neglected to include it. This may be because it's inten...
by PFQNiet
Wed Jul 21, 2021 9:16 am
Forum: Modding interface requests
Topic: on_chunk_generated_by_pollution event
Replies: 9
Views: 2187

Re: on_chunk_generated_by_pollution event

Aside from the fact that it would fire constantly, events cannot prevent things from happening. When you get the event, the chunk has already been generated and the best you can do is immediately destroy it again, but as Dave pointed out it'll just regenerate over and over.
by PFQNiet
Mon Jul 19, 2021 9:41 pm
Forum: Modding help
Topic: Cacheability of inventories
Replies: 6
Views: 1475

Re: Cacheability of inventories

Right. I'm not explaining this very well XD I am storing a reference to the entity, so entity.valid will be available to me. I want to know if it is "safe" to store the entity's inventory's first slot as well, so that I don't have to query the game for it each time I want to access that sl...
by PFQNiet
Mon Jul 19, 2021 12:33 pm
Forum: Modding help
Topic: Cacheability of inventories
Replies: 6
Views: 1475

Re: Cacheability of inventories

If I know that the entity I'm working with is a "container" with a 1-slot inventory, is it safe to assume: if entity.valid then local slot = entity.get_inventory(defines.inventory.chest)[1] -- slot IS valid here, right? end The slot will be valid, and will continue to be valid until the en...
by PFQNiet
Mon Jul 19, 2021 8:51 am
Forum: Modding help
Topic: Cacheability of inventories
Replies: 6
Views: 1475

Cacheability of inventories

I've noticed my code is actually doing "entity.get_inventory(...)" in a less-than-optimal manner. Can I just save a reference to the LuaInventory in global and use that in future calls, instead of having to query the game engine for it? Similarly, what about stacks within that inventory? I...
by PFQNiet
Sun Jul 18, 2021 9:55 am
Forum: Documentation Improvement Requests
Topic: Documentation Improvement Requests
Replies: 316
Views: 84049

Re: Small documentation improvement requests

The name last_user implies it updates when someone uses the entity. But it is described as "the player who built the entity". But it is read-write. And it changes on assemblers when the recipe is changed. Also it can be nil. Basically, it's woefully inadequate in its documentation right n...
by PFQNiet
Wed Jul 14, 2021 11:12 am
Forum: Modding interface requests
Topic: "order" parameter for LuaGuiElement#add
Replies: 0
Views: 694

"order" parameter for LuaGuiElement#add

Having just implemented this myself in Lua, I figured I'd ask if this could be made part of the engine-side code: local function findIndexForNewElement(parent, order) local index = 1 for i=1,#parent.children do if (parent.children[i].tags['order'] or "") < order then index = index + 1 else...
by PFQNiet
Sat Jul 10, 2021 10:45 am
Forum: Modding interface requests
Topic: LuaRendering#draw_polyline
Replies: 0
Views: 556

LuaRendering#draw_polyline

I'd like to request the ability to draw a polyline. It would use all of the parameters of draw_line, but instead of "from" and "to", it would use draw_polygon's "vertices" (named "points") and "target". Optionally have a "closed" parameter ...
by PFQNiet
Fri Jul 09, 2021 5:26 pm
Forum: Documentation Improvement Requests
Topic: Documentation Improvement Requests
Replies: 316
Views: 84049

Re: Small documentation improvement requests

What is LuaEntity#is_crafting() supposed to check? I expected it to return true if the machine is currently gaining progress, ie. is "working" or at the very least "low-power". However, it seems to return true even on fuel-powered machines that stop working due to a lack of fuel...
by PFQNiet
Fri Jul 09, 2021 5:12 pm
Forum: Modding interface requests
Topic: LuaPlayer.unlock_tips_and_tricks_item(name)
Replies: 3
Views: 889

Re: LuaPlayer.unlock_tips_and_tricks_item(name)

I have found a workaround :D Create a fake technology. data:extend{{ type = "technology", name = "tips-and-tricks-trigger", icon = "__core__/graphics.empty.png", icon_size = 1, hidden = true, unit = { count = 1, time = 1, ingredients = {} }, prerequisites = {}, effects ...
by PFQNiet
Fri Jul 09, 2021 2:56 pm
Forum: Not a bug
Topic: [1.1.35] Incorrect grid-snapping of even-sized resources
Replies: 4
Views: 1341

Re: [1.1.35] Incorrect grid-snapping of even-sized resources

Ah, missed that.

It seems weird though - why would ResourceEntity have such an option, and why does it default to true?
by PFQNiet
Fri Jul 09, 2021 12:05 pm
Forum: Not a bug
Topic: [1.1.35] Incorrect grid-snapping of even-sized resources
Replies: 4
Views: 1341

[1.1.35] Incorrect grid-snapping of even-sized resources

I have a modded resource entity that has a collision box of {{-4.9,-4.9},{4.9,4.9}} and a selection box of {{-3,-3},{3,3}} - both of these indicate an even-sized entity (10x10 collision, 6x6 selection). However, if I attempt to spawn this entity, it gets snapped to the middle of a tile: local entity...
by PFQNiet
Mon Jul 05, 2021 7:32 pm
Forum: Documentation Improvement Requests
Topic: Documentation Improvement Requests
Replies: 316
Views: 84049

Re: Small documentation improvement requests

Why do I have to dig through the game files to find what fields exist on MapSettings ? (Perhaps more importantly, this prevents them from appearing in runtime-api.json, causing "undefined property" warnings when using them.) -> I finally got around to trudging through this, the concept wi...

Go to advanced search