[0.13.1] Lua event triggering incorrectly
[0.13.1] Lua event triggering incorrectly
The event on_preplayer_mined_item is fired when mining is complete while the description says "Called when the player starts mining something."
Re: [0.13.1] Lua event triggering incorrectly
The description is wrong - the event is correct.
It's called right before the entity is fully mined after the progress bar has hit 100%.
It's called right before the entity is fully mined after the progress bar has hit 100%.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.13.1] Lua event triggering incorrectly
In that case, is there any event to check permissions for mining? Lets say *player starts mining entity* check who placed the entity, does this person have permission to mine that? if not cancel the action. I thought I could do that with this event, that's what the name/description would suggest. How can that be solved?
Re: [0.13.1] Lua event triggering incorrectly
No, Factorio doesn't have any kind of permissions system like that.
Whitelist your server and don't let people join that you don't want to join until the day we might implement such a thing (unlikely).
Whitelist your server and don't let people join that you don't want to join until the day we might implement such a thing (unlikely).
If you want to get ahold of me I'm almost always on Discord.
Re: [0.13.1] Lua event triggering incorrectly
Sorry I think you misunderstood me, the white-list was just an example. and it would not be kept by server it would be kept by the mod.
Like not deconstructing entities that you did not make?
This code snippet has two flaws, obviously. But don't you think this should be possible? This topic is probably heading more towards suggestion then bug report, sorry about that.
Like not deconstructing entities that you did not make?
Code: Select all
script.on_event(defines.events.on_preplayer_mined_item, function(event) -- obviously wrong event by the way it works
if event.entity.built_by ~= game.players[event.player_index].name then
return false; -- no idea how to tell the game to cancel the action
end
end)
Re: [0.13.1] Lua event triggering incorrectly
Factorio doesn't currently support any kind of event cancellation.
If you want to get ahold of me I'm almost always on Discord.