Search found 13 matches

by i142857
Mon Feb 03, 2025 9:09 pm
Forum: Documentation Improvement Requests
Topic: consumed_items: how does it work?
Replies: 3
Views: 275

Re: consumed_items: how does it work?

But the description says this modifiable. If it says "I consumed a Foo" and I modify it to "no, actually you consumed nothing", then it should have some effect, no? Perhaps I was overly optimistic about it returning the item, but there is no documentation on what this modifiable inventory does when ...
by i142857
Mon Feb 03, 2025 2:23 pm
Forum: Documentation Improvement Requests
Topic: consumed_items: how does it work?
Replies: 3
Views: 275

consumed_items: how does it work?

The 2.0 changelog says:


Changed on_built_entity event. Instead of stack/item, it passes consumed_items - modifiable stack of items used for the building.


Sounds great but I can't figure out how I'm supposed to use that. I am trying to "refund" the item used when placing the entity. Ideally the ...
by i142857
Fri Jan 17, 2025 9:58 pm
Forum: Documentation Improvement Requests
Topic: Document event order
Replies: 4
Views: 425

Re: Document event order

Ah, I have a simpler idea that perhaps is easier to commit to.

Could you document/commit that when there is an event "X changed", then you cannot see the new value of X from Lua before the event has fired ? Put differently, which events are instant, no matter what causes them (Lua or the engine ...
by i142857
Fri Jan 17, 2025 7:58 pm
Forum: Documentation Improvement Requests
Topic: Document event order
Replies: 4
Views: 425

Re: Document event order

Thanks, Bilka!


For events where there are ordering expectations they are documented on the lua actions that raise those events. E.g. https://lua-api.factorio.com/latest/classes/LuaControl.html#begin_crafting instantly raises on_pre_player_crafted_item and at some point in the current tick on ...
by i142857
Fri Jan 17, 2025 11:48 am
Forum: Documentation Improvement Requests
Topic: Document event order
Replies: 4
Views: 425

Document event order

A single player action can create multiple events, for example on_player_cursor_stack_changed and on_player_main_inventory_changed. Could you document what to expect in mods about this order?

a. "No guarantees whatsoever": the events can be raised in a different order every time, even for the same ...
by i142857
Wed Jan 08, 2025 11:53 pm
Forum: Modding interface requests
Topic: Permissive license for util.lua
Replies: 2
Views: 358

Re: Permissive license for util.lua


So I guess if it counts as "personal use" or "distributed as part of your mod" and not "commercial use", it's ok.

I'm not sure about github, but uploading your modified version of util.lua to the mod portal is ok according to that.


Personal "use" definitely doesn't cover distribution, but yes ...
by i142857
Wed Jan 08, 2025 11:38 am
Forum: Modding interface requests
Topic: Permissive license for util.lua
Replies: 2
Views: 358

Permissive license for util.lua

Sorry, this isn't exactly a modding interface request.

I would like to propose that you license util.lua under a permissive license like MIT. This will enable mods to copy and modify (parts of it) freely, regardless of their license.

My use case:
I am working on a mod where most of the tests can ...
by i142857
Sat Jan 04, 2025 4:32 pm
Forum: Modding interface requests
Topic: AutoplaceControl.hidden = true to hide the control from the map generation screen
Replies: 2
Views: 293

Re: AutoplaceControl.hidden = true to hide the control from the map generation screen

But if you don't want it to be auto placed, why do you need an AutoplaceControl? You can define the prototype and just place it with create_entity.
by i142857
Mon Dec 30, 2024 5:43 pm
Forum: Modding interface requests
Topic: [2.0] AutoplaceControl.size
Replies: 2
Views: 210

[2.0] AutoplaceControl.size

Proposal: add an optional size parameter to AutoplaceControl defaulting to true. When set to false, the "Size" slider in the map settings UI is removed (similar to how richness is optional).

Rationale: resources that are supposed to always spawn as a single node -- in that case would reduce user ...
by i142857
Sat Dec 28, 2024 7:36 pm
Forum: Modding interface requests
Topic: Relative GUI for static GUI elements
Replies: 7
Views: 1598

Re: Relative GUI for static GUI elements

+1 maybe now that raiguard is on the other side of the "fence"? :)

The relative gui system is so cool and it's so annoying to fall back to easily broken coordinate hacks :(
by i142857
Mon Dec 23, 2024 4:06 pm
Forum: Documentation Improvement Requests
Topic: [2.0.27] Light in StatelessVisualisation (example or docs)
Replies: 0
Views: 196

[2.0.27] Light in StatelessVisualisation (example or docs)

According to the StatelessVisualisation docs you can use it to make a light on an entity. There are no examples of this in base or space-age (that I can find) and no explanation in the docs on how that works. I'm trying to guess but it doesn't seem to be working. For instance adding this to a ...
by i142857
Thu Dec 19, 2024 2:26 pm
Forum: Documentation Improvement Requests
Topic: Document that player.get_main_inventory() will be nil while in remote view
Replies: 4
Views: 411

Document that player.get_main_inventory() will be nil while in remote view

The current documentation seems to suggest that the only case where it can be nil is if the entity is not a player. But in my testing, it's also nil if you're looking at the map/remote view. This is unexpected (intuitively, why would player.get_main_inventory() not work just because the player is ...
by i142857
Mon Nov 04, 2024 10:54 am
Forum: Modding interface requests
Topic: Event for machine crafting complete
Replies: 3
Views: 356

Event for machine crafting complete

In my mod, I would like to react to a (custom) assembling-machine finishing a craft. As far as I can tell, there is no way to do this short of reading LuaEntity.crafting_progress or LuaEntity.products_finished on every tick. I was hoping for something better or more efficient.

This was requested a ...

Go to advanced search