It would be useful to be able to read and modify the speed of asteroids at runtime. This could be used i.e. for making tractor beam turrets or deflector shields.
An alternative to having it be writable would be something similar to PushBackTriggerEffectItem that modifies speed instead of position. (And works on asteroids, which PushBackTriggerEffectItem does not seem to do?)
LuaEntity.speed for asteroids
Re: LuaEntity.speed for asteroids
A small bump on this in case it was missed during summer
Re: LuaEntity.speed for asteroids
Asteroids don’t have an internal speed value. They have an internal movement per tick value which is a 2D vector that gets added to the asteroid position each tick.
So if this was exposed it would need to be as a new value: “movement” or such.
So if this was exposed it would need to be as a new value: “movement” or such.
If you want to get ahold of me I'm almost always on Discord.
Re: LuaEntity.speed for asteroids
Right, I must have misread the documentation for speed. I assumed that was a 2d vector as well. Having "movement" exposed as read/write to script would indeed solve this for me
Re: LuaEntity.speed for asteroids
Okay, I added LuaEntity::get_movement() and set_movement() for 2.0.67.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.