Page 1 of 1

surface.create_entity{max_range=15}

Posted: Fri Dec 16, 2016 8:46 am
by Earendel
When you use surface.create_entity{} to create a Projectile, please add an optional parameter to specify the projectile's max_range as would normally be specified on the ammo that creates the projectile.

Currently I have a script that makes a vehicle fire at targets without player intervention. The projectiles are created with surface.create_entity and should mimic the vehicle's turret and loaded ammo, but there is no way to specify range of the projectile. Example: "cannon-shell" ammo creates a "cannon-projectile". The ammo specifies a max_range of 30. When lua creates the projectile it travels much further than 30.

Re: surface.create_entity{max_range=15}

Posted: Wed Dec 21, 2016 8:53 pm
by Rseding91
Added for 0.15.

Re: surface.create_entity{max_range=15}

Posted: Tue Dec 27, 2016 11:03 am
by Earendel
Awesome! Thanks.