Page 1 of 1
Artillery targeting behavior?
Posted: Wed Sep 09, 2020 12:28 am
by HURTZCO
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?
Posted: Wed Sep 09, 2020 8:27 am
by Qon
Code: Select all
entity.surface.create_entity({
name = "artillery-flare",
position = {x, y},
force = entity.force,
})
My mod
ArtilleryCombinator creates artillery-flare's at the position you decide with your combinator. An artillery flare is the targeting dot that is placed with the manual targeting tool and which artillery will aim at.
Re: Artillery targeting behavior?
Posted: Wed Sep 09, 2020 3:24 pm
by HURTZCO
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.
Re: Artillery targeting behavior?
Posted: Wed Sep 09, 2020 3:47 pm
by eradicator
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.
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.
Re: Artillery targeting behavior?
Posted: Wed Sep 09, 2020 3:54 pm
by HURTZCO
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?
Re: Artillery targeting behavior?
Posted: Wed Sep 09, 2020 4:03 pm
by eradicator
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?
Everything except possibly performance ;).
HURTZCO 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?
TriggerTargetMask + TriggerTargetType as far as i understand
https://wiki.factorio.com/Types/TriggerTargetMask
Re: Artillery targeting behavior?
Posted: Wed Sep 09, 2020 4:18 pm
by HURTZCO
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
![😂](//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f602.svg)