Capsule launcher


Introduce a turret that fires capsules (slowdown, poison, and combat robots) for strategic base defense.

Content
2 days ago
2.0
408
Combat

i Compatibility

a month ago

there are other mods on the portal that add capsules (such as lily's incendiaries), and I'd love to be able to use those as well. I'm pretty sure there's some way to make recipes adjust to whatever you put in a given slot, too. not required, but it would be neat

21 days ago

Sorry for the delayed response, I was away from my computer for a while.
I'll start working on it right away, it will probably take me a few days to get it working nicely.
Thank you for the suggestion !

20 days ago

Happy to be of service.

18 days ago

The update is out now. I hope this works the way you had in mind. Let me know if you run into any issues or if there’s anything else you’d like improved.

17 days ago

awesome. thanks a lot

17 days ago

it seems to have included things like grenades and cluster grenades. You tell me if that's a bug

17 days ago

it seems to have included things like grenades and cluster grenades. You tell me if that's a bug

17 days ago

I decided to include grenades and cluster grenades on purpose. Since they’re technically capsules, it felt inconsistent to exclude the vanilla ones while allowing modded ones to be used.

17 days ago

fair enough

17 days ago

okay here's a weird one: I'm playing with the "promethium is quality" mod, and since the update all capsule ammo recipes have been moved to the refinery tech (which is post-promethium). I have no Idea why this is happening, but when I turned off promethium is quality to see what would happen I got a load error.

Failed to load mods: nil
stack traceback:
[C]: in function 'error'
capsule-launcher/prototypes/ammo/ammo_factory.lua:76: in function 'update_technology'
capsule-launcher/prototypes/ammo/ammo_factory.lua:90: in function <capsule-launcher/prototypes/ammo/ammo_factory.lua:86>
(...tail calls...)
capsule-launcher/data-final-fixes.lua:26: in main chunk

Ps. I know that renai transportation has a unit that can directly fire capsules at enemies, so that's a potential resource if you're interested

16 days ago

Good news is, I managed to reproduce the issue and will start to debug.
Bad news is, I have no idea why this happens.
Sorry about the disruption, I'll try to fix it as quickly as possible.

16 days ago

Well, that was easier to debug than anticipated. The patch should be out any minute now.

15 days ago

nice

15 days ago

out of curiosity, what was wrong?

15 days ago

In my mod, each new capsule ammo recipe needs to be unlocked by the same technology that unlocks the corresponding base capsule. To do this, I look up the recipe that produces the base capsule, then check which technology unlocks that recipe, and attach the ammo recipe to it.

This worked fine in vanilla Factorio, because each capsule has exactly one recipe. However, this mod introduced an alternate recipe for the same capsule (refining recipe). Since my code wasn’t prepared for multiple recipes producing the same item, it mistakenly chose the alternate recipe instead of the real base recipe. That caused the new ammo to unlock with the wrong technology (the refining tech), instead of the intended one.

The fix was to make sure I only select the vanilla/base recipe for each capsule, and ignore any alternates.

14 days ago

Inch resting. I feel like the simplest solution (and maybe the most foolproof one but check my math on that) would be to copy the barreling recipes and just tie everything to the capsule launcher tech bc you can't make capsule ammo if you can't make capsules. That said, your solution is more intuitive form a user standpoint.

14 days ago

also it broke again:
Failed to load mods: nil
stack traceback:
[C]: in function 'error'
capsule-launcher/prototypes/ammo/ammo_factory.lua:63: in function 'update_technology'
capsule-launcher/prototypes/ammo/ammo_factory.lua:91: in function <capsule-launcher/prototypes/ammo/ammo_factory.lua:87>
(...tail calls...)
capsule-launcher/data-final-fixes.lua:26: in main chunk

13 days ago

Welp, back to the drawing board. I might have underestimated the difficulty of making my mod compatible with any other mod, especially since I am still very new at both factorio modding and lua. I'll upload the new version as soon as I have a working fix. Thanks for the report.

13 days ago

I just uploaded the latest hotfix. I tested the compatibility of my mod with 40 other mods this time, so I really hope that everything will work fine.

13 days ago

Okay it doesn't outright crash but it does freeze and stop responding when it tries to load the mod. Entirely possible this is on my end tho I have like 400 mods on this bad boy

13 days ago

I wasn’t able to reproduce the issue on my end. Could you share your save file with me? It would help me identify and fix this problem, and possibly catch any others that might come up once it’s resolved. Sorry again for the trouble.

13 days ago

not sure how to do that tbh :/

13 days ago
(updated 12 days ago)

https://wiki.factorio.com/Application_directory
If you are using windows, the map will be saved in the folder C:\Users[user name]\AppData\Roaming\Factorio\saves
If you are using Linux, then it should be at ~/.factorio/saves
Once you found the file, you can try sending it via WeTransfer, or something like that.

8 days ago

Sorry for the late response. I don't know what wetransfer is. Is there anything in the mod hub that will let me share a file with you?

7 days ago

I don’t think the mod portal can be used to share saves directly. I have an update coming out in a few hours, so no worries if you can’t share your save. I can’t guarantee this fixes your exact issue since I wasn’t able to reproduce it without your save, but I did greatly reduce the number of operations during load (by a factor of about 10,000 in vanilla Factorio). Hopefully that will resolve the freeze.

7 days ago

Failed to load mods: capsule-launcher/prototypes/ammo/ammo_factory.lua:1: module toolbelt-22.tools.Stream not found; no such file toolbelt-22/tools/Stream.lua
stack traceback:
[C]: in function 'require'
capsule-launcher/prototypes/ammo/ammo_factory.lua:1: in main chunk
[C]: in function 'require'
...sule-launcher__/prototypes/ammo/capsule_ammo_factory.lua:1: in main chunk
[C]: in function 'require'
capsule-launcher/data-final-fixes.lua:3: in main chunk

bruh

7 days ago

I’ve been testing this mod in every way I can think of, and it always seems fine on my end, but it keeps breaking once I release it.

My guess is that you’re playing on macOS or Linux. Honestly, I didn’t expect that to make a difference, but it looks like it does. Thanks for reporting this, it'll be fixed in the next update.

7 days ago

I'm on windows...

7 days ago

Then I have no idea why it would work fine on my end and not yours. But anyway, I at least hope that the latest version works fine for you.

New response