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
Ammo and Turret Ranges
Ammo and Turret Ranges
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark Twain
"True friends stab you in the front." - Oscar Wilde
"True friends stab you in the front." - Oscar Wilde
Re: Ammo and Turret Ranges
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
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
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.
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.
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark Twain
"True friends stab you in the front." - Oscar Wilde
"True friends stab you in the front." - Oscar Wilde
Re: Ammo and Turret Ranges
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...
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
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.
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
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.
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.
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark Twain
"True friends stab you in the front." - Oscar Wilde
"True friends stab you in the front." - Oscar Wilde