[MOD 0.12.x] Cannon Turret

Topics and discussion about specific mods
Post Reply
AmbulatoryCortex
Inserter
Inserter
Posts: 33
Joined: Sun Jul 26, 2015 1:13 am
Contact:

[MOD 0.12.x] Cannon Turret

Post by AmbulatoryCortex »

Image

Type: Mod
Name: Cannon Turret
Description: Adds a cannon turret and upgrades.
License: Do whatever you want, just don't claim it's yours.
Version: 0.0.1
Release: 8/16/2015
Tested-With-Factorio-Version: 0.12.4
Category: Turret
Tags: cannon, turret, defense

Warning! Cannon turrets will attempt to fire through you and your buildings. They're quite tough, so stick them out front where that won't be an issue.

Thanks to YuokiTani for the beautiful spritesheet!
Long description
Version history
Attachments
Cannon-Turret_0.0.1.zip
(1.16 MiB) Downloaded 1480 times
Last edited by ssilk on Sat Aug 22, 2015 9:43 am, edited 2 times in total.
Reason: Changed title to match board rules http://www.factorioforums.com/forum/viewtopic.php?f=89&t=947

waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [0.12.X] Cannon Turret

Post by waduk »

Nice, and i really like the sprite (great work by Yuoki Tani).
I'd like the idea of friendly fire, first time i test it, it obliterate the train track. It was awesome !

Then i move the turret encampment further, then this happen.

Image

Can you make it that it won't fire under certain minimum range (15?).
Otherwise, this turret practically destroy itself and his company.

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [0.12.X] Cannon Turret

Post by Peter34 »

That is the general problem with any Turrets firing area-of-effect damage projectiles.

I guess that's why popular mods such as TreeFarm add turrets that fire non-damaging projectiles, instead using ones that somehow slows down the target, that is they do no damage to structures, and instead of doing damage to mobile entities, the mobile entities get their mobility nerfed.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [0.12.X] Cannon Turret

Post by Ranakastrasz »

Assuming it uses tank turret shells, its not the fact that it deals AOE damage, so much as the fact that factorio doesn't support filters on impact projectiles. Same thing as trying to shoot a shotgun through a wall. The walls gotta go first....
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

AmbulatoryCortex
Inserter
Inserter
Posts: 33
Joined: Sun Jul 26, 2015 1:13 am
Contact:

Re: [0.12.X] Cannon Turret

Post by AmbulatoryCortex »

Ranakastrasz wrote:Assuming it uses tank turret shells, its not the fact that it deals AOE damage, so much as the fact that factorio doesn't support filters on impact projectiles. Same thing as trying to shoot a shotgun through a wall. The walls gotta go first....
Pretty much. That's why I put the warning in the op. They'll one-shot anything short of a behemoth, but I don't have a way to keep them from shooting through stuff. That I know of anyway.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [0.12.X] Cannon Turret

Post by Ranakastrasz »

AmbulatoryCortex wrote: Pretty much. That's why I put the warning in the op. They'll one-shot anything short of a behemoth, but I don't have a way to keep them from shooting through stuff. That I know of anyway.
Same here. Tried to make a custom flame thrower and ran into issues.

That said, a rocket turret would work fine.

Also, you might be able to spawn the projectile further out, though it would look bad.

Lastly, at least make the turret 1k hp or so durable, so it is it's own wall.

That and note that it is collision with stuff and not the aoe which is the issue
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

AmbulatoryCortex
Inserter
Inserter
Posts: 33
Joined: Sun Jul 26, 2015 1:13 am
Contact:

Re: [0.12.X] Cannon Turret

Post by AmbulatoryCortex »

Ranakastrasz wrote: Same here. Tried to make a custom flame thrower and ran into issues.

That said, a rocket turret would work fine.

Also, you might be able to spawn the projectile further out, though it would look bad.

Lastly, at least make the turret 1k hp or so durable, so it is it's own wall.

That and note that it is collision with stuff and not the aoe which is the issue
Others have already made rocket turrets, so I wasn't interested in that. Now that this is done, I might.

The turret has 1400hp already, and 50% physical damage reduction. Starting there, we'll see whether the thing needs nerfed or buffed.

I'll also fix the warning so it's more clear.

User avatar
Krayt
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Fri Aug 14, 2015 8:47 am
Contact:

Re: [0.12.X] Cannon Turret

Post by Krayt »

The quote is from the topic for texture request: https://forums.factorio.com/forum/vie ... 15&t=14825
AmbulatoryCortex wrote:
DOSorDIE wrote:That turret is great, but it cant fire over walls ... so as base defend its useless.
Can you fix that?
You should bring discussion over to the mod thread. But to answer your question, no I cannot make it both use the existing cannon behavior and also not hurt friendly entities.
What about building a one block thick wall around the turret and then somehow changing the starting point of the fired cannon shell to a point outside this radius?
I don't know how to do this, but this would be the theoretical approach.

DOSorDIE
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: [0.12.X] Cannon Turret

Post by DOSorDIE »

Sorry for the entry in the wrong thread ... too many windows where open.

Nice idea, but when i build a bigger wall 2 or 3 thick?
A normal turret can shoot over walls so why you change it like that.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [0.12.X] Cannon Turret

Post by Ranakastrasz »

DOSorDIE wrote:Sorry for the entry in the wrong thread ... too many windows where open.

Nice idea, but when i build a bigger wall 2 or 3 thick?
A normal turret can shoot over walls so why you change it like that.
That was answered earlier.
Same reason tank cannon, shotgun and flameer can't
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: [0.12.X] Cannon Turret

Post by Adil »

attack_parameters.projectile_creation_distance = 5 allows turret to shoot over single wall. However this also shifts the position of fire explosion there. Maybe someone will squeeze the shooting explosion creation into turret parameters as well, so that there's still an explosion at the end of the barrel even though another one happens later.

Balancing wise I object that de facto the highest tier turret is made of shit'n'sticks that would be more fit to an early-game gun-tower. Being the stationary automatic analogue of a tank it should require appropriate ingredients: a comparable amount of engines, a load of steel, a bunch of red circuits, well, you get the idea.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Imp0815
Inserter
Inserter
Posts: 21
Joined: Thu Sep 26, 2013 4:10 pm
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by Imp0815 »

As i understand it the base problem is the collision code pared with bullets. Why not just use the base code of the other turrets and just use the cannon turret animation, graphics, sounds and stats? (with the lack of seeing the bullet actually fly)

EDIT:
Oke i just fixed it myself. You just take the projectiles.lua out of the data\base\prototypes\entity folder and put it in the prototypes\entity of the cannon mod folder.
Now go in there (best use Notepad++) and delete the following out of the "cannon-projectile" part:
collision_box = {{-0.05, -1.1}, {0.05, 1.1}},
and set
direction_only = false,

do it in both the explosion and the normal round.
Then open the data.lua file in the mod and add the following line at the end:
require("prototypes.entity.projectiles")

Now your cannons should be able to shot over walls.

EDIT #2:
When you change your projectiles file like this you your tank wont be able to hit that often anymore.

Darloth
Fast Inserter
Fast Inserter
Posts: 117
Joined: Sun Jun 08, 2014 3:57 pm
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by Darloth »

Can we make projectiles that spawn other projectiles now?

The comments (edit: and code) in the plasma shotgun thread suggests that we can, so...

How about the cannon turret fires a projectile that's very much like the cannon shell, except it has no collision, like the one Imp0815 suggests.

Then, after about 5 units of distance, THAT projectile splits into exactly one other projectile with the same target, heading and speed, that's a normal cannon shell.

In fact, tanks could do this too? - no more terrible friendly fire, for anyone?

Ooh, and we could make shotgun turrets, by making canister shells which split into normal shotgun blasts. Fun candy-tech upgrade to these turrets, and no reason tanks couldn't use those as well...

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by thereaverofdarkness »

You do have to be careful how you place this turret, but I don't see that as a problem. Don't bother boxing them inside walls; the turret IS the wall.

I would suggest actually decreasing their hit points a bit and instead increasing their explosive resist. If they would stop killing themselves, they would stop dying. [s]20/50% explosion resist is a bit higher than the tank, and would make the explosive cannon shell deal 2.5 damage to the turret (assuming no damage upgrades).
As long as the turret has a bit of physical resist on top of that, it can remain on the outside of your perimeter.[/s]

edit: I must have been looking at the numbers for the explosive rocket. The explosive cannon shell deals 80 explosive damage and 30 physical damage, so the turret needs a lot of explosive and physical resist to keep from taking large amounts of damage.
Last edited by thereaverofdarkness on Thu Jun 09, 2016 12:37 am, edited 2 times in total.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by Ranakastrasz »

Darloth wrote:Can we make projectiles that spawn other projectiles now?

The comments (edit: and code) in the plasma shotgun thread suggests that we can, so...

How about the cannon turret fires a projectile that's very much like the cannon shell, except it has no collision, like the one Imp0815 suggests.

Then, after about 5 units of distance, THAT projectile splits into exactly one other projectile with the same target, heading and speed, that's a normal cannon shell.

In fact, tanks could do this too? - no more terrible friendly fire, for anyone?

Ooh, and we could make shotgun turrets, by making canister shells which split into normal shotgun blasts. Fun candy-tech upgrade to these turrets, and no reason tanks couldn't use those as well...
Well, I know you can chain poison to shotgun shells and other impact weapons, and you can have them explode after a defined distance, applying that effect. I am not sure how to chain another projectile to that, but If you could, yea, that is feasible.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

lordvizer
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Jul 04, 2016 8:13 pm
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by lordvizer »

so if i update the game to 0.13.x i will loss all modes so far , but what will do with that when they asked me for username and password to update modes ?
or i have to keep my game out dated in order to play with some cool modes ?

sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by sore68 »

Hi there~

I change?path? this mod in factorio 13 version.

and some pic
recipe and tech
damage tech
picture
Attachments
Cannon-Turret_0.0.2.zip
(1.16 MiB) Downloaded 159 times

sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

Re: [MOD 0.12.x] Cannon Turret

Post by sore68 »

Oops..
change some entity.. enable this mod
Attachments
Cannon-Turret_0.0.2.zip
(1.16 MiB) Downloaded 181 times

Post Reply

Return to “Mods”