A lot of the events are missing an explanation for when the `player_index` will be empty. As for some it relates to how a script raised the event and what options it passed in (which may not always be apparent).
i.e. https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction
on the ...
Search found 285 matches
- Tue Jul 12, 2022 2:07 am
- Forum: Documentation Improvement Requests
- Topic: Events don't document when player_index is nil
- Replies: 1
- Views: 711
- Mon Jul 11, 2022 2:55 pm
- Forum: Not a bug
- Topic: [1.1.61] Replay wrong version message has bad old version text
- Replies: 1
- Views: 962
[1.1.61] Replay wrong version message has bad old version text
When you try to run a replay of a save made in an older version the below message is shown. The message lists the current version twice and not the version the replay was made in.
In this example as seen by the saves map version and Mods > base version.
In this example as seen by the saves map version and Mods > base version.
- Sun Jul 10, 2022 8:39 pm
- Forum: Modding discussion
- Topic: New API Docs website
- Replies: 68
- Views: 33762
Re: New API Docs website
Edit: Moved to right thread
- Sat Jul 09, 2022 11:34 pm
- Forum: Resolved Problems and Bugs
- Topic: [1.1.61] API Docs for LuaPlayer.remove_alert wrong parameter type for "prototype" filter field
- Replies: 1
- Views: 2721
[1.1.61] API Docs for LuaPlayer.remove_alert wrong parameter type for "prototype" filter field
The function LuaPlayer.remove_alert takes a table of fields, including one named "prototype". In the API docs its listed as type "LuaEntityPrototype?", however, if you provide an entity prototype object (LuaEntity.prototype) you get back the error message: 'prototype': string expected, got table
If ...
If ...
- Sat Jul 09, 2022 10:49 pm
- Forum: Resolved Problems and Bugs
- Topic: [Therenas][1.1.61] LuaInventory.set_filter() API Doc param error
- Replies: 1
- Views: 1141
[Therenas][1.1.61] LuaInventory.set_filter() API Doc param error
In the API Docs the function LuaInventory.set_filter has the param filter of type string . However I believe it should be string? based on its description for setting a nil value to clear the filter.
Page: https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_filter
Param ...
Page: https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_filter
Param ...
- Fri Jul 08, 2022 9:54 pm
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype
- Replies: 2
- Views: 2214
[boskid][1.1.61] Selection box doesn't handle 8 way rotations correctly when set in a custom entity prototype
When a prototype has a selection_box (possibly also collision_box ?) set to be non centered, this is placed based on the entities 4 main directions (N, E, S, W) cleanly, but for the extra rotations (NE, SE, SW, NW) in an 8 way rotatable entity the offsets are always as if the rotation is north ...
- Sun Jul 03, 2022 7:26 pm
- Forum: Implemented mod requests
- Topic: Flag to force prototype placement on rail grid
- Replies: 6
- Views: 4024
Re: Flag to force prototype placement on rail grid
Yea I hit this as well.
Had to do a whole process to; catch build, review validity, if bad refund and show to player valid placement positions.
Was a bunch of code and added complexity to work around this issue.
Had to do a whole process to; catch build, review validity, if bad refund and show to player valid placement positions.
Was a bunch of code and added complexity to work around this issue.
- Thu Jun 30, 2022 10:59 pm
- Forum: Modding interface requests
- Topic: LuaSurface.find_non_colliding_position() and LuaSurface.can_place_entity() to support direction and orientation
- Replies: 1
- Views: 1246
LuaSurface.find_non_colliding_position() and LuaSurface.can_place_entity() to support direction and orientation
At present there is no way to find a placement location for either a non north direction or a non 0 orientated entity.
Also you can't check buildability of a non 0 orientated entity.
My example is trying to teleport a player's car at its current orientation. However, I can see finding a placement ...
Also you can't check buildability of a non 0 orientated entity.
My example is trying to teleport a player's car at its current orientation. However, I can see finding a placement ...
- Sun May 08, 2022 6:02 pm
- Forum: Resolved Problems and Bugs
- Topic: [1.1.58] LuaControl.cancel_crafting gives wrong error message for missing argument
- Replies: 1
- Views: 1238
[1.1.58] LuaControl.cancel_crafting gives wrong error message for missing argument
The below code snippet is invalid as it doesn't have the `count` field in the table argument.
/c
local player = game.player
if player.crafting_queue_size > 0 then
player.cancel_crafting {index =1}
end
However it gives the error message:
Error: 'index': real number expected got nil.
Tested ...
/c
local player = game.player
if player.crafting_queue_size > 0 then
player.cancel_crafting {index =1}
end
However it gives the error message:
Error: 'index': real number expected got nil.
Tested ...
- Sat Mar 12, 2022 12:19 pm
- Forum: Resolved Problems and Bugs
- Topic: [1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's
- Replies: 1
- Views: 1604
[1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's
In 1.1.55 and before you could obtain the the autoplace_specification from a tree LuaEntityPrototype, but in 1.1.56 this isn't obtainable and it isn't listed as an intentional loss in the 1.1.56 changelog. its also still in current documentation.
https://lua-api.factorio.com/latest ...
https://lua-api.factorio.com/latest ...
- Sun Feb 27, 2022 7:47 pm
- Forum: Resolved Problems and Bugs
- Topic: [1.1.55] Can't change artillery wagon's force
- Replies: 1
- Views: 2958
[1.1.55] Can't change artillery wagon's force
You can't change an artillery wagons force via Lua API script. It accepts the request, but the force doesn't change.
1: Load save: arty wagon force test.zip
2: script to change the force of the player selected entity:
/c
local carriage = game.player.selected
game.print("pre: " .. carriage.force ...
1: Load save: arty wagon force test.zip
2: script to change the force of the player selected entity:
/c
local carriage = game.player.selected
game.print("pre: " .. carriage.force ...
- Wed Feb 23, 2022 2:30 pm
- Forum: Resolved Problems and Bugs
- Topic: [1.1.53] Corpse TTL set to uint max vanishes instantly
- Replies: 1
- Views: 1336
[1.1.53] Corpse TTL set to uint max vanishes instantly
The time_to_live for a character-corpse is listed as uint32. However if you put a max uint32 value the corpse vanishes instantly.
https://wiki.factorio.com/Prototype/CharacterCorpse#time_to_live
Assume the same issue exists for regular corpse.
In my testing I found that the vanishing is somewhere ...
https://wiki.factorio.com/Prototype/CharacterCorpse#time_to_live
Assume the same issue exists for regular corpse.
In my testing I found that the vanishing is somewhere ...
- Wed Feb 09, 2022 8:26 pm
- Forum: Modding discussion
- Topic: New API Docs website
- Replies: 68
- Views: 33762
Re: New API Docs website
On the main page (https://lua-api.factorio.com/latest/index.html) the Classes header isn't clickable, but the Events header further down the page is.
There is the Classes page that I assume the header should link to: https://lua-api.factorio.com/latest/Classes.html
- Thu Jan 27, 2022 5:10 pm
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.53] Crash connecting rolling stock to neighbour while its being removed (on_train_created)
- Replies: 2
- Views: 3450
[boskid][1.1.53] Crash connecting rolling stock to neighbour while its being removed (on_train_created)
If you interact with a train carriage that is mid removal and get it to re-connect to another carriage you can crash the game. The on_train_created event gives you access to this mid removal stage.
Logic:
remove a locomotive from a 2 entity train. The game has to disconnect the loco first before ...
Logic:
remove a locomotive from a 2 entity train. The game has to disconnect the loco first before ...
- Mon Jan 03, 2022 8:12 pm
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
- Replies: 6
- Views: 5358
Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
thanks Boskid
raised to the Comfy scenario devs in case there is anything odd on their side this flags
raised to the Comfy scenario devs in case there is anything odd on their side this flags
- Mon Jan 03, 2022 2:34 pm
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
- Replies: 6
- Views: 5358
Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
reproduction steps from a clean copy of the scenario following the usage path the server hosting player did in my previous error case.
Please note I am not the owner of the scenario, Comfy is.
This looks to be related to downloading a scenario from an MP game is somehow getting in to the weird map ...
Please note I am not the owner of the scenario, Comfy is.
This looks to be related to downloading a scenario from an MP game is somehow getting in to the weird map ...
- Mon Jan 03, 2022 11:55 am
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
- Replies: 6
- Views: 5358
Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
Ignore this post - see 3rd post with new simpler reproduction steps.
edit: this occurs with just starting the scenario, no mods required it seems.
scenarios.zip
New Game > User scenarios > Chronosphere
Didn't want to edit original post as I see Boskid has claimed it in title.
factorio ...
edit: this occurs with just starting the scenario, no mods required it seems.
scenarios.zip
New Game > User scenarios > Chronosphere
Didn't want to edit original post as I see Boskid has claimed it in title.
factorio ...
- Mon Jan 03, 2022 11:40 am
- Forum: Resolved Problems and Bugs
- Topic: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
- Replies: 6
- Views: 5358
[boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods
Ignore this post - see 3rd post with new simpler reproduction steps.
When I load the below save based on a scenario and mods everything is fine, however, when I click to Restart the map Factorio hard crashes.
30.413 Error RollingStock.cpp:996: Internal error in RollingStock ...
When I load the below save based on a scenario and mods everything is fine, however, when I click to Restart the map Factorio hard crashes.
30.413 Error RollingStock.cpp:996: Internal error in RollingStock ...
- Sat Dec 18, 2021 1:33 pm
- Forum: Resolved Problems and Bugs
- Topic: [Lou][1.1.48] Ghost fast replace rotation oddness
- Replies: 2
- Views: 3427
[Lou][1.1.48] Ghost fast replace rotation oddness
Issue: a player can fast replace an entity over itself with a different rotation, but a ghost placed over an entity with fast replace and a different rotation is set back to the original rotation.
https://gfycat.com/diligentblackandwhitehoiho
1: place steam engine facing north.
2: hold steam ...
https://gfycat.com/diligentblackandwhitehoiho
1: place steam engine facing north.
2: hold steam ...
- Mon Dec 13, 2021 2:29 pm
- Forum: Modding discussion
- Topic: New API Docs website
- Replies: 68
- Views: 33762
Re: New API Docs website
The process that a mod makes a request via the API (either function or to get/set a field) would be helpful. I got the below answer via Discord from Bilka that all LuaObject instances returned to my mod from the API have 0 field data. So for UPS optimised mods we should really be caching every field ...