In the context of the problem you are trying to solve, it's a suboptimal solution. You have to set up caches that you need to keep updated, handle events and so on. As opposed to simply having the game do what it already has to do to call the function in the first place. Some remote calls are gener...
Restricting usage during on_init and similar would also work, but that is not a system that the engine currently does. Creating that system and explaining it to the modders would be a big undertaking for such a rarely used feature. LuaRemote::try_call would work similar to pcall(remote.call, "i...
While I agree with your sentiment, the fact is that interfaces can be added and removed on the fly. So do we just call it and hope another mod hasn't removed their interface then take the bug reports if it has?
Currently, if I want to call a remote interface, I have to do something similar to if remote.interfaces["iface"] and remote.interfaces["iface"]["ifunc"] then local ret = remote.call("iface", "ifunc", myargs) dostuff(ret) end Every call to `remote.int...
Laser turrets will shoot at targets that are slightly out of range and do no damage to them, resulting in the turret repeatedly toggling its fire. It should either not fire, or apply the damage.
It seems every Lua object has a .help function which, when called, returns a string displaying the names of its methods and attributes. The Lua objects LuaMapSettings and LuaDifficultySettings have .help defined not as a function but as the string itself containing that information. Those should lik...
When I go into the F4 settings menu and enable 'show-train-repathing' debug option, I see the "Repathed" debug message pop up due to trains repathing on Nauvis even when I'm viewing another surface.
I did notice many items are not marked for deconstruction and, watching closely, I can see items being unmarked. Is this a bug?
(watch the center-ish row closely)
Thanks for the quick response. The issue appeared when using Space Exploration with the Jetpack mod. I used the jetpack to fly over water, landed in the water to save fuel while figuring out exactly where to place the landfill, then had some landfill magically appear at my feet when I started placin...
Likely related to https://www.factorio.com/blog/post/fff-346 If the player is standing on water and uses landfill, extra landfill is placed at the player's feet. Reproduce: Teleport player onto water, place landfill on water, see landfill appear at player's position. See attached video: Factorio 1.1...
[1.1.81] https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_to_generate_chunks Lists `radius` as a required 2nd parameter, but the function is happy to run with a single `position` parameter and nothing for `radius`. Not sure if that actually does anything or not but the functio...
I was in the middle of modifying a mod when I ran a `/c game.reload_mods()`. The game froze for a second while reloading mods, then ran normally for another half second or so, then crashed. Since I was in the middle of modifying mods, I can't tell you the state of the mods or the game when the crash...
[1.1.77] https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_all_ids https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.clear Both need clarification that passing "" as a parameter to mean "level" as per https://forums.factorio.com/viewtopic.ph...
/c for _ = 1,100 do game.player.surface.spill_item_stack(game.player.position, {name="empty-barrel", count = 1}, false, nil, false) end Running this command results in a different outcome based on the surface map_gen_settings. If map_gen_settings.width or map_gen_settings.height >= 2^31 t...
Boilers which have their prototype `.output_fluid_box.pipe_connections = {}`, when flipped either horizontally or vertically, end up facing north. Simplest way to see this is to add this to the data stage: data.raw["boiler"]["boiler"].output_fluid_box.pipe_connections = {}` Then ...
I am kind of surprised you are able to determine width of text from LUA, as it sound like potential source of desyncs. Width of text depends on font used and font used depends on language settings. I'm able to get width by putting text into a `.gui.screen` label, call `.force_auto_center()`, wait a...
Could you elaborate? Isn't the code in the first post "on the fly" (minus the fancy loop)? rendering.draw_text doesn't give the width of the resulting element. But its possible to get what the width should be by putting that text into a gui label. The problem with a label is that it takes...