Bob's Warfare


Make things for warfare.

Content
8 months ago
0.13 - 1.1
263K
Combat

i Compatibility (Plutonium Energy vs Atomic Artillery)

4 years ago

When playing with Plutonium Energy and Atomic Artillery, if bob's warfare is included in the mod folder, it will crash it. Removing the Atomic Artillery works but isn't really the problem, they work together.
I did some teste with only Plutonium, bob's and Atomic Artillery, and seems that is the warfare mod that causes the issue.
I tested with my full mod list and removing only bob's warfare make it work.

Easy to reproduce with only those mods:
PlutoniumEnergy_1.1.18
bobwarfare_1.0.0
boblibrary_1.0.0
AtomicArtillery_0.1.12

Failed to load mods: PlutoniumEnergy/data.lua:3: PlutoniumEnergy/prototypes/entity/projectiles.lua:61: attempt to index field 'action' (a nil value)
stack traceback:
PlutoniumEnergy/prototypes/entity/projectiles.lua:61: in main chunk
[C]: in function 'require'
PlutoniumEnergy/data.lua:3: in main chunk
stack traceback:
[C]: in function 'require'
PlutoniumEnergy/data.lua:3: in main chunk

Mods to be disabled:
• PlutoniumEnergy (1.1.18)
11.113 Quitting: user-quit.
11.186 Steam API shutdown.
11.192 Goodbye

It looks like both Bob Warfare and Atomic Artillery add artillery shell projectile named internally atomic-artillery-projectile. And because bobwarfare alphabetically stands afterAtomic ARtillery, projectile gets overriden.
I will implement a bob-compatible projectile in PE, but same prototype names in different mods aren't good.

4 years ago
(updated 4 years ago)

Part of the problem when modding is knowing when to use a standard name (EG, atomic-artillery-projectile) and when to use a unique name (bob-atomic-artillery-projectile) isn't clear-cut. For example, when it comes to intermediate items, you almost certainly want a standard name, EG: lead-plate, so that any mod that makes and uses lead plates, will use the same plates used by another mod. It also means that this is most likely what modders are going to do everywhere, because it's easier to just stick to the same system everywhere. (Otherwise when you're working on your other mods, you constantly have to look up EVERYTHING to see what you named it)

Now, in theory, it shouldn't matter if multiple mods define a atomic-artillery-projectile, even if they're very different, it just means the two weapons that create the projectile will create the same thing, as one overwrites the other... until you consider errors like this.

From what I can tell, this error is being caused because PlutoniumEnergy is assuming the projectile exists as defined in AtomicArtillery, when in fact as defined in bobwarfare. PlutoniumEnergy is then just trying to edit the projectile, and tripping over the fact that... the structure isn't how it expects it to be.

Now, Making assumptions is probably the biggest reason why errors happen, so, to make mods work better together, never assume anything... but making assumptions makes the coding A LOT easier. I'm guilty of the same problem, many of my mods will assume that something is a specific way, because that's what my other mod sets it to, or that's how it is in the base mod... which is fine when only my mods are being used, but causes some issues sometimes when they're not. It just so happens that in this case, PlutoniumEnergy is the mod that's tripping up.

4 years ago

Thank you guys so much for solving it, it is nice when we can put all the good things together!

New response