Search found 236 matches

by PFQNiet
Wed Jul 14, 2021 11:12 am
Forum: Modding interface requests
Topic: "order" parameter for LuaGuiElement#add
Replies: 0
Views: 138

"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: 124

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: Modding interface requests
Topic: Small documentation improvement requests
Replies: 116
Views: 8803

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: 187

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: 335

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: 335

[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: Modding interface requests
Topic: Small documentation improvement requests
Replies: 116
Views: 8803

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...
by PFQNiet
Fri Jul 02, 2021 8:25 am
Forum: Modding discussion
Topic: Question on Cannon Projectile collision
Replies: 4
Views: 279

Re: Question on Cannon Projectile collision

Avoid hard-coding collision masks. You don't know what other mods might be using it.

Instead, use this:

Code: Select all

air_unit_layer = require("collision-mask-util").get_first_unused_layer()
Then you can assign collision_mask = {air_unit_layer} and add it to the projectile.
by PFQNiet
Tue Jun 29, 2021 9:04 am
Forum: Modding interface requests
Topic: LuaPlayer.unlock_tips_and_tricks_item(name)
Replies: 3
Views: 187

ScriptTipTrigger

I could suggest a whole range of new TipTrigger types, like MineEntityTipTrigger, DamageTakenTipTrigger, and many more, as it seems like the existing set of triggers were specifically made for whatever the default tips and tricks need and don't yet offer much flexibility. But even with a wider range...
by PFQNiet
Mon Jun 28, 2021 2:53 pm
Forum: Modding interface requests
Topic: Small documentation improvement requests
Replies: 116
Views: 8803

Re: Small documentation improvement requests

Would it be at all possible to do something like runtime-api.json but for the data stage? Defining what prototype classes exist, what properties they can/must have, what types, etc.? I feel like this could be a massive help for data-stage modding, just as runtime-api.json has been a massive help for...
by PFQNiet
Sun Jun 27, 2021 2:21 pm
Forum: Modding help
Topic: How to change force for entity in editor or script?
Replies: 4
Views: 231

Re: How to change force for entity in editor or script?

/c for _,turret in pairs(game.player.surface.find_entities_filtered{type="turret"}) do if turret.name:find("worm") then turret.force = "enemy" end end Should search the current surface for all turrets, then narrow the search to turrets with "worm" in their na...
by PFQNiet
Thu Jun 24, 2021 10:18 pm
Forum: Modding interface requests
Topic: "count" parameter for LuaSurface.get_closest
Replies: 1
Views: 135

"count" parameter for LuaSurface.get_closest

LuaSurface.get_closest() is very useful. I'm pretty sure it's orders of magnitude faster than sorting the list of entities on the Lua side, given it would need to constantly query the engine for entity positions and such. I would very much like to extend this function with an optional "count&q...
by PFQNiet
Wed Jun 23, 2021 12:04 pm
Forum: Modding interface requests
Topic: on_player_used_wire
Replies: 5
Views: 245

Re: on_player_used_wire

detecting the player messing with modded entities that require certain wires to function Note that you can also mess with wires using blueprints, so on_player_used_wire would not solve everything. Fair point. Just putting a power pole too close can also "mess with" stuff, but those two ca...
by PFQNiet
Wed Jun 23, 2021 12:03 pm
Forum: Ideas and Requests For Mods
Topic: Empty Barrel Disassembling
Replies: 3
Views: 188

Re: Empty Barrel Disassembling

data:extend{ { type = "recipe", name = "recycle-empty-barrel", category = "crafting", energy_required = 1, ingredients = {{"empty-barrel",1}}, result = "steel-plate", -- or results = {{type="item", name="steel-plate", amount=1, p...
by PFQNiet
Wed Jun 23, 2021 9:36 am
Forum: Modding interface requests
Topic: on_player_used_wire
Replies: 5
Views: 245

on_player_used_wire

Okay that might not be the best name, but I would like to have an event for when the player connects (or disconnects) two entities with wire. Event properties: - wire: "copper", "red", "green" - from, to: the entity/connection points that were joined or disconnected - d...
by PFQNiet
Tue Jun 22, 2021 11:23 pm
Forum: Modding help
Topic: Wires
Replies: 1
Views: 104

Wires

How can I add another item that is able to connect power poles? (Connecting them with copper is fine, but how does the base game determine this?)
by PFQNiet
Tue Jun 22, 2021 1:32 pm
Forum: Modding interface requests
Topic: New LuaGuiElement: window
Replies: 3
Views: 219

Re: New LuaGuiElement: window

Point 1 is resolved by using a decent framework, or making your own - it's a fairly trivial matter to define a function, say "create_window", and let that handle creating the close button etc. Points 2 and 3 are resolved by setting "player.opened = window". The player can only ha...
by PFQNiet
Mon Jun 21, 2021 5:30 am
Forum: Implemented mod requests
Topic: LuaGuiElement.bring_to_front()
Replies: 7
Views: 1346

Re: LuaGuiElement.bring_to_front()

thanks i didnt notice the subforum this was in. rseding was like "i dont give a fuck" when he broke the functionality so i didnt expect this to ever get fixed Many, many things have gone from "won't ever happen" to "Oh wait..." to "Okay done," sometimes even ...
by PFQNiet
Sun Jun 20, 2021 6:46 am
Forum: Implemented mod requests
Topic: LuaGuiElement.bring_to_front()
Replies: 7
Views: 1346

Re: LuaGuiElement.bring_to_front()

its too late, the stubbornness of rseding made me quit modding and afaik they even still havent fixed this. sorry You claim to have quit but yet here you are coming back nine months later to bitch about something in the "implemented requests" forum saying they "still haven't fixed it...

Go to advanced search