Page 1 of 1
Ammo and Turret Ranges
Posted: Sat Nov 15, 2014 11:26 pm
by MaxAstro
Is it possible to alter the range of a turret based on the ammo it is equipped with?
I know it's not directly supported, but could it be done via Lua magic? For example, will the range field of the turret entity accept a variable or equation, and is it possible to find out the type of ammo a turret is loaded with?
If so, could you do something like (pseudocode):
extrarange = 0
if (ammo = longrangeammo)
then extrarange = 5
range = 17 + extrarange
Re: Ammo and Turret Ranges
Posted: Sun Nov 16, 2014 12:42 am
by L0771
You can't modify prototypes after the game has loaded.
Can modify damage of towers or ammo damage with
technologies
You can make some entities with modifications and destroy/create with
findenemyunits
Re: Ammo and Turret Ranges
Posted: Sun Nov 16, 2014 12:46 am
by MaxAstro
I figured the answer would be something like that.
Is it possible to make a turret accept only one kind of bullet - i.e. only piercing ammo, or only regular ammo?
I assume I could do this by making a new ammo type and separating piercing into it, but that would make the player's weapons unable to use that ammo, correct?
P.S. Thanks for the quick answer.
Re: Ammo and Turret Ranges
Posted: Sun Nov 16, 2014 2:34 am
by L0771
Piercing ammo and regular ammo are bullets, i think you can't select only one bullet, but your turret can accept a kind of ammo (bullets, rockets, etc)
You can create a new ammo type (like arrows, rocks, darts, etc), you can modify the weapons to accept your ammo(accept only 1 ammo kind), or create new weapons for this new ammo.
I'm new here too, with mods and english...
Re: Ammo and Turret Ranges
Posted: Sun Nov 16, 2014 3:32 am
by n9103
From what I've seen and done, you've got a single feasible option:
Make a custom turret that uses custom ammunition with longer range.
-Make a player-usable version of this new weapon if you want the player to be able to use the same ammo.
Perhaps you could make use of the already present but unused railgun and railgun dart?
I previously had a rather over-the-top suggestion that went along the lines of making a new attacking function, but some of the handles for that are still absent.
Though, I think a less-than-rigorous version of this idea is still possible, though it would be a bit more primitive than I'm thinking, and would probably be very costly in terms of cycles used for scripts.
Re: Ammo and Turret Ranges
Posted: Sun Nov 16, 2014 6:17 am
by MaxAstro
Actually, I think I've found a solution - it's a bit hackneyed and involved creating what is basically a duplicate turret (and also making the machinegun unable to fire regular bullets), but it does what I need it to do.
Thank you everyone for your advice!
EDIT: Okay, one more question. Is it possible for an entity's inventory to have a smaller maximum stack size for an item than the player's inventory does? Say I want an item to stack up to 100 in the player's inventory, but only up to 20 in the turret's inventory.