Search found 9 matches

by GlassBricks
Sun May 15, 2022 5:17 pm
Forum: Bug Reports
Topic: [1.1.59] Events on_player_changed_position and on_player_promoted run before on_player_created
Replies: 0
Views: 28

[1.1.59] Events on_player_changed_position and on_player_promoted run before on_player_created

In a mod, I initialize some data in on_player_created (and during on_init), and use it during on_player_changed_position. However, when creating a new save (freeplay scenario), on_player_changed_position was raised before on_player_created, which led to a crash (attempt to index nil, the player data...
by GlassBricks
Tue Nov 16, 2021 1:18 am
Forum: Resolved Problems and Bugs
Topic: [Rseding] [1.1.46] on_game_created_from_scenario event not fired after "Save and Play" from map editor
Replies: 1
Views: 776

[Rseding] [1.1.46] on_game_created_from_scenario event not fired after "Save and Play" from map editor

Title says it all. This would allow testing (soft) mod setup behaviour without having to leave the map editor, create a new save, test, quit, reopen the map editor...


Edit: grammar
by GlassBricks
Sun Nov 14, 2021 1:15 am
Forum: Modding interface requests
Topic: inconsistent `require` behavior when files imported by other mods
Replies: 1
Views: 302

inconsistent `require` behavior when files imported by other mods

When a file is imported using "__modname__.path.to.file", the behaviour of "require" within that file changes (vs a "normal" require). Based on my observations: If the file is in the root of the mod directory, relative imports do not work at all. If the file is in a fol...
by GlassBricks
Tue Nov 09, 2021 10:25 pm
Forum: Modding interface requests
Topic: Small documentation improvement requests
Replies: 221
Views: 24109

Re: Small documentation improvement requests

It seems LocalisedString also allows boolean values (and even nil in many cases); this could be documented.

-> Thanks, this is clarified for the next release.
by GlassBricks
Sun Oct 17, 2021 6:14 pm
Forum: Modding interface requests
Topic: Small documentation improvement requests
Replies: 221
Views: 24109

Re: Small documentation improvement requests

For defines.events.on_game_created_from_scenario we could add the additional note that "This event is not fired when the scenario is loaded via the map editor", a fact I discovered only after digging around a bit. This would be useful to note that this event could be used to detect whethe...
by GlassBricks
Mon Jul 12, 2021 3:07 pm
Forum: Modding interface requests
Topic: Set "Grid position" of blueprints
Replies: 7
Views: 1010

Re: Set "Grid position" of blueprints

Oh, so to change the "grid position" I would edit the positions of all the blueprint entities.

A get/set_grid_position still could be useful, though.
But even if not implemented, at least the grid position behavior should be documented somewhere.
by GlassBricks
Sun Jul 11, 2021 5:57 pm
Forum: Modding interface requests
Topic: Set "Grid position" of blueprints
Replies: 7
Views: 1010

Set "Grid position" of blueprints

Currently (v1.1.35) there is no way to read/write the "Grid position" setting of blueprints from lua (on LuaItemStack). Could we get this feature? There is an older forum post on this topic https://forums.factorio.com/viewtopic.php?f=28&t=96815 marked "solved", but it only de...
by GlassBricks
Sat Jun 26, 2021 3:41 am
Forum: Pending
Topic: [1.1.34] Crash when attempting to paste lua-script created blueprint with invalid snap-to-grid configuration
Replies: 2
Views: 403

Re: [1.1.34] Crash when attempting to paste lua-script created blueprint with invalid snap-to-grid configuration

Here's a portion of the code that produced the crash: -- (in a function) local blueprint = getBpForLayer() -- creates and returns a LuaItemStack in a script inventory, that is a blueprint local blueprintedEntities = blueprint.create_blueprint({surface = self.surface, force = "player", area...
by GlassBricks
Fri Jun 11, 2021 5:32 pm
Forum: Pending
Topic: [1.1.34] Crash when attempting to paste lua-script created blueprint with invalid snap-to-grid configuration
Replies: 2
Views: 403

[1.1.34] Crash when attempting to paste lua-script created blueprint with invalid snap-to-grid configuration

I'm creating a (yet to be released) mod that involves programmatically creating/pasting blueprints. In the mod, using lua, I created a blueprint (inside a container inside a custom surface to hold the LuaItemStack), set blueprint_position_relative_to_grid, but did not set blueprint_snap_to_grid. Whe...

Go to advanced search