LuaControl.mining_state resets every tick, or even earlier.

Place to get help with not working mods / modding interface.
Post Reply
movax20h
Fast Inserter
Fast Inserter
Posts: 138
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

LuaControl.mining_state resets every tick, or even earlier.

Post by movax20h »

I am using Linux headless server, 0.18.32.

I am using RCON, but same probably applies using other means:

Lets say the player's character:

Code: Select all

local p = game.get_player("b")
rcon.print(serpent.line(p.position))
{x = 74.90234375, y = 20.9296875}
At (76.9, 19.0), I do have a burner-mining-drill, and it in range, so lets try mining it:

Code: Select all

game.ticks_to_run=1

local p = game.get_player("b")
p.update_selected_entity({ x=76.9, y=19.0 });
p.mining_state = {mining=true, position={ x=76.9, y=19.0 } }

rcon.print(serpent.line(p.mining_state))
{mining = false, position = {x = 0, y = 0}}

I need to keep setting it to true multiple times, and then the entity appears to be mined. It usually requires the above command to be executed 4 times. Which is weird, because when manually mining the burner-mining-drill (without steelaxe), it takes about 30 ticks, not few.

Same happens with other entities, like rocks for example.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users