surface.create_entity{max_range=15}

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

surface.create_entity{max_range=15}

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: surface.create_entity{max_range=15}

Post by Rseding91 »

Added for 0.15.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: surface.create_entity{max_range=15}

Post by Earendel »

Awesome! Thanks.
Post Reply

Return to “Implemented mod requests”