Page 1 of 1

LuaEntity.get_target() + set target options

Posted: Tue Oct 18, 2016 8:34 pm
by Earendel
Please add for turret, unit, player, vehicle.
LuaEntity.get_target() → {entity=LuaEntity, position=Position}
If no target or not a turret, unit, player, vehicle the return value would be nil.
If targeting ground (shotgun/cannon) it would just be: {entity=nil, position=Position}

Also, LuaEntity.set_target_entity(entity = LuaEntity) would be useful for turrets and units.

And LuaEntity.fire_at_location(position = Position, fire_repeatedly = Bool) would be especially useful for anything with an AOE related, like shotgun tanks, grenade turrets, artillery, etc.

And if you're feeling particularly awesome: LuaEntity.ticks_since_last_attack:: uint [R] would also be very helpful.

Re: LuaEntity.get_target() + set target options

Posted: Mon Nov 07, 2016 9:43 pm
by Danielv123
There have been a lot of requests for scripts controlling turrets, I would advice searching around for an official response.

Re: LuaEntity.get_target() + set target options

Posted: Tue Nov 08, 2016 4:54 am
by aubergine18
A recent topic asking for similar stuff: viewtopic.php?f=28&t=35361