Allow finer-grained control over artillery shots via flares

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
devshark
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Dec 02, 2019 12:02 pm
Contact:

Allow finer-grained control over artillery shots via flares

Post by devshark » Mon Dec 02, 2019 12:15 pm

After inquiring how to wrap up a mod feature i've been working on, it turns out it was currently impossible.

My use-case is to have the vanilla artillery-turret support all of my new artillery ammo types (currently 4) but also somehow having a finer-grained control over which one gets shot with a flare. so far, i've made new flares but then ran into the problem.

The modding problem is, vanilla artillery-turrets, use artillery-wagon's gun. it accepts only the "artillery_shell" ammo_category. the flares themselves apply to a whole ammo_category. so even when i change the ammos' category to my own, the vanilla turret cannot shoot them anymore.

my initial proposal would be one of these:
1) ammo_categories having a parent. e.g. all specialized ammo types are derived from artillery-shell so that the arty turret can shoot them. but they respond to their own flares.
2) turrets taking in a list/array of ammo_category they support
3) the "shot_type" parameter on the flare, similar to "shot_category" but checking for loaded ammo's entity name

I'm leaning towards #2, but any one of these would avoid the need to have to reimplement the whole artillery "stack" when making new artillery ammo "types".

Currently, the problem is - since a flare affects the whole "shot_category" meaning the whole "ammo_category", making new artillery ammos with categories different than "artillery-shell" makes them unshootable by the vanilla artillery-turret (which uses the artillery-wagon's gun) which accepts only "artillery-shell" ammo category.

Having it (the weapon) accept a list of supported ammo_category or supporting ammo_category parenting/inheritance would solve this problem.
e.g. making the turret accept a

Code: Select all

ammo_category = { "artillery-shell", "custom-artillery-shell" }
or something like this:

Code: Select all

{
    type = "ammo-category"
    name = "custom-artillery-shell"
    parent = "artillery-shell"
}
i hope you get the idea.

EDIT/UPDATE: for what it's worth, i offered to help implement this feature but was told by Scott it'd be best to post it here. if there are no "free hands" and this change is determined to be worth implementing, the offer to help roll it out still stands.

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users