Example:
Code: Select all
BOT = game.surfaces[1].create_entity{name = "player", position = {0, 0}, force=game.forces.enemy }
function bot_mine(x,y)
BOTt.teleport(x, y-1)
script.on_event(defines.events.on_tick, function(event) BOT.mining_state = {mining = true, position = {x, y}} end)
end
However, LuaControl.walking_state *does* work. With walking set to true, and with a direction defined, the 'zombie' character does walk in the specified direction.
So my request is:
- It would be nice if LuaControl.mining_state, and all the other xxx_states worked for the player prototype where the character entity is not associated with a connected client.
- Implement a firing_state: LuaControl.firing_state = {firing = true, position = {x,y}} where position would be where the conceptual cursor is. A direction wouldn't work, because the radius is important when using capsules and grenades.
- Implement functions in LuaControl which lets the entity pick up and drop items.
Similar workarounds would work for firing weapons (spawn projectiles or use invisible turrets) and pick up / drop items, but with the same shortcomings.