Artillery targeting behavior?
Artillery targeting behavior?
Anyone has any data, or knows where I can find in the game code how the artillery (or any turret, really) aims, specifically regarding the manual targeting? I have an idea for a mod but I'd need to understand that behavior to get it working properly.
Re: Artillery targeting behavior?
Code: Select all
entity.surface.create_entity({
name = "artillery-flare",
position = {x, y},
force = entity.force,
})
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Re: Artillery targeting behavior?
So if I want any turret-specific behavior that doesn't apply to all artillery, I'll have to write the script to get the behavior going?
Because really that was part of my plan - cloning/instancing parts or the totality of the Artillery class to create a separate artillery call that wouldn't interfere with normal artillery turrets/wagons.
Because really that was part of my plan - cloning/instancing parts or the totality of the Artillery class to create a separate artillery call that wouldn't interfere with normal artillery turrets/wagons.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Artillery targeting behavior?
The factorio API does not offer that kind of low-level access to classes. Want different behavior from a base entity -> Have to use a fake entity and script it all yourself. Possibly including the spawning of projectiles.HURTZCO wrote: Wed Sep 09, 2020 3:24 pm Because really that was part of my plan - cloning/instancing parts or the totality of the Artillery class to create a separate artillery call that wouldn't interfere with normal artillery turrets/wagons.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Artillery targeting behavior?
But for a completely new entity that would simulate base-like behavior, I'll have to write the whole thing from scratch and everything should be good, correct?
In this case, is there a way to get a turret to only attack a specific type of entity?
In this case, is there a way to get a turret to only attack a specific type of entity?
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Artillery targeting behavior?
Everything except possibly performance ;).HURTZCO wrote: Wed Sep 09, 2020 3:54 pm But for a completely new entity that would simulate base-like behavior, I'll have to write the whole thing from scratch and everything should be good, correct?
TriggerTargetMask + TriggerTargetType as far as i understandHURTZCO wrote: Wed Sep 09, 2020 3:54 pm In this case, is there a way to get a turret to only attack a specific type of entity?
https://wiki.factorio.com/Types/TriggerTargetMask
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Artillery targeting behavior?
Sounds like it would be more beneficial to change the game up a bit around my content instead of trying to implement the behavior that would make my mod unique