Page 1 of 1

[0.18.24] artillery-flare does not have shot_category set

Posted: Mon May 18, 2020 3:28 pm
by xlomkn
When having a mod with distincts artillery ammo category, you can use the vanilla artillery remote to fire any of them.

To reproduce:
  • Install MIRV mod
  • Do the research and launch a MIRV from a rocket silo
  • You may use the MIRV remote to launch a nuclear projectile, but...
  • You may also use the regular artillery remote and point it outside of the reach of your artillery turrets: point and click here and an MIRV nuclear projectile is sent (because MIRV has a huge range)
  • In fact, each times you use the artillery remote, you don't know which projectile will be sent
It may seems to be a MIRV bug, and in fact it could be fixed in MIRV by adding this:

Code: Select all

local artillery_flare = data.raw["artillery-flare"]["artillery-flare"]
if artillery_flare then
  artillery_flare.shot_category = "artillery-shell"
end
but it seems to me that the vanilla game should have it set so that not all mods have to do it. It is also quite error prone for modders.

Anyway, I will report this to MIRV also.

Oh, and thanks: you're top 1 in my beloved games list ;)

Re: [0.18.24] artillery-flare does not have shot_category set

Posted: Mon May 18, 2020 5:46 pm
by Rseding91
Thanks for the report. That's intentional: the remote is setup so it can fire every artillery that exists.

If a mod doesn't want that, then it needs to do as you've said: set the category of the remote to a specific one. Or just remove it.

Re: [0.18.24] artillery-flare does not have shot_category set

Posted: Fri Sep 04, 2020 3:42 pm
by IngoKnieto
I disagree with the universal remote solution.

That means if I want to implement a custom artillery with its own remote, and I don't want it to be used by the vanilla remote, then I have to change the vanilla remote. And changing base game objects always has the potential of breaking other mods...
Or am I seeing something wrong here?

I think having artillery_flare.shot_category as a table so one remote could serve multiple artillery types would maybe be the best solution.

Code: Select all

artillery_flare.shot_category = {"artillery-shell", "my-custom-shell"}
Maybe that's something to consider for 1.1 :)