Companion Drones for 2.0


UPDATE 3.1 Tired of the lonely factory life? This drone(s) will follow, assist, and protect you, handling construction, repairs, combat, and manage its inventory all by itself. Toggle between building and combat roles on the fly with hotkeys or the shortcut bar, fine-tune its behavior with customizeable options, and toggle between Modes to enable progression over time or to make the mod more suitable for large modpacks like Angels or Bob's. Maintained by Maoman

Content
8 days ago
2.0
4.55K
Logistics Combat

b [BUG REPORTS] We just had a major mod update! Please be detailed when reporting bugs.

a month ago

A lot has changed and despite all my testing I'm sure some bugs still remain, so let me know what you find and I'll get to work on it right away.

a month ago

Just found a bug and reported it here: https://github.com/Maoman1101/companionDrone/issues/1

a month ago
(updated a month ago)

Thanks, I'll look into it.

Edit: Fixed

a month ago

Confirmed that this occurred outside of Warp Engine, and the latest update (that was done literally between me downloading the mod and the first loading, lol. big modpack ftw) fixed it. thank you!

a month ago

I tried to load a save with 248k and Krastorio after the update and I got this:

The mod Companion Drones 2.0 (3.0.29) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_configuration_changed
companion-drones-mjlfix/script/companion.lua:416: attempt to perform arithmetic on field 'base_speed' (a nil value)
stack traceback:
companion-drones-mjlfix/script/companion.lua:416: in function 'eff_base'
companion-drones-mjlfix/script/companion.lua:464: in function 'set_active'
companion-drones-mjlfix/script/companion.lua:2358: in function 'reset_companions_for_player'
companion-drones-mjlfix/script/companion.lua:2636: in function 'func'
companion-drones-mjlfix/script/companion.lua:2556: in function 'run'
companion-drones-mjlfix/script/companion.lua:2568: in function 'on_config_changed'
companion-drones-mjlfix/script/companion.lua:2702: in function <companion-drones-mjlfix/script/companion.lua:2644>

a month ago

I tried to load a save with 248k and Krastorio after the update and I got this:

Should be fixed now, give it a try.

a month ago

Load my save just fine, I lost all but one of my drone for some reason.

I placed second drone just fine, place third and the game crash out with this:

The mod Companion Drones 2.0 (3.0.30) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_built_entity (ID 6)
companion-drones-mjlfix/script/companion.lua:292: attempt to index global 'self' (a nil value)
stack traceback:
companion-drones-mjlfix/script/companion.lua:292: in function 'new'
companion-drones-mjlfix/script/companion.lua:1212: in function 'handler'
core/lualib/event_handler.lua:72: in function <core/lualib/event_handler.lua:70>

a month ago

Well shit. That error isn't very helpful. Though... I think I might know what caused it anyway. Stand by.

a month ago
(updated a month ago)

Ohhh I see what happened. The fix from the first bug broke the upgrade table. Damn. That's probably been causing all sorts of slightly strange behavior, making everyone think challenge mode is broken.

Anyway, should be fixed now. Go ahead and update again, let me know please.

a month ago
(updated a month ago)

I'm not using any big overhaul mods, but some planets and QoL stuff, on Fulgora, with my original 2 drones I spawned with.

The mod Companion Drones 2.0 (3.0.31) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_configuration_changed
companion-drones-mjlfix/script/companion.lua:201: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
companion-drones-mjlfix/script/companion.lua:201: in function 'set_companion_stats'
companion-drones-mjlfix/script/companion.lua:2648: in function <companion-drones-mjlfix/script/companion.lua:2644>

edit: confirmed challenge mode is not enabled. Used default settings when save was started a couple weeks ago.

a month ago

Ohhh I see what happened. The fix from the first bug broke the upgrade table. Damn. That's probably been causing all sorts of slightly strange behavior, making everyone think challenge mode is broken.

Anyway, should be fixed now. Go ahead and update again, let me know please.

This has fixed my issue.
Thank you for your effort.

a month ago
(updated a month ago)

I'm not using any big overhaul mods, but some planets and QoL stuff, on Fulgora, with my original 2 drones I spawned with.

That's fundamentally similar to the error the first guy had... It looks like fixing one bug breaks the other, and vice versa. I'll try to figure it out tomorrow, see if I can come up with a fix that works for both, it's almost 2am here now.

In the meantime you can always re-download the older version from the downloads tab and just drop it in your mod folder (delete the current version)
Sorry for the inconvenience, but a man's gotta sleep y'know.

a month ago

The mod Companion Drones 2.0 (3.0.31) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_configuration_changed
companion-drones-mjlfix/script/companion.lua:201: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
companion-drones-mjlfix/script/companion.lua:201: in function 'set_companion_stats'
companion-drones-mjlfix/script/companion.lua:2648: in function <companion-drones-mjlfix/script/companion.lua:2644>

a month ago

Alright, updated (I couldn't sleep). See if that helps.

a month ago

thank you mate.

a month ago

You made me login for this(Friendly)

The mod Companion Drones 2.0 (3.0.34) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_configuration_changed
companion-drones-mjlfix/script/companion.lua:458: attempt to perform arithmetic on field 'companion_update_interval' (a nil value)
stack traceback:
companion-drones-mjlfix/script/companion.lua:458: in function 'set_active'
companion-drones-mjlfix/script/companion.lua:1861: in function 'reschedule_companions'
companion-drones-mjlfix/script/companion.lua:2300: in function 'reseed_defaults'
companion-drones-mjlfix/script/companion.lua:2647: in function <companion-drones-mjlfix/script/companion.lua:2645>

Let me know if you need logs or something.

a month ago

Reverted back to 2.0 until this is fixed, btw. MelonTech beleives in you. We love our companion robots. 🍈🍈🍈

a month ago
(updated a month ago)

how the fuck...? Companion_update_interval is just a setting. Like, a player customizeable setting in your mod options with a default value that gets automatically loaded. How the fuck could it ever be nil? Maybe try updating again then setting the update interval in the settings to 5 manually (that's the default value).

a month ago

The mod Companion Drones 2.0 (3.0.36) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_configuration_changed
companion-drones-mjlfix/script/companion.lua:458: attempt to perform arithmetic on field 'companion_update_interval' (a nil value)
stack traceback:
companion-drones-mjlfix/script/companion.lua:458: in function 'set_active'
companion-drones-mjlfix/script/companion.lua:1857: in function 'reschedule_companions'
companion-drones-mjlfix/script/companion.lua:2296: in function 'reseed_defaults'
companion-drones-mjlfix/script/companion.lua:2643: in function <companion-drones-mjlfix/script/companion.lua:2641>

a month ago

Mentos93 and MelonActual, it should be fixed now. Let me know please.

a month ago

Failed to load mods: The given sprite rectangle (left_top=0x256, right_bottom=43x320) is outside the actual sprite size (left_top=0x0, right_bottom=1376x256).
See the log file for more information.: companion-drones-mjlfix/sprites/10-jet-flame.png

with Pyanoaadons, without companions Py works fine,

a month ago

Failed to load mods: The given sprite rectangle (left_top=0x256, right_bottom=43x320) is outside the actual sprite size (left_top=0x0, right_bottom=1376x256).
See the log file for more information.: companion-drones-mjlfix/sprites/10-jet-flame.png

with Pyanoaadons, without companions Py works fine,

Getting this same error unfortunately. Running 5DIM on top of a plethora of QoL mods and very small tweaks to a few recipes, if that.

a month ago

must change the size in the file... dont have the posibility to do it :/ i have a free night i need it xD

a month ago
(updated a month ago)

Oh fuck, I uploaded the wrong file, a broken version from my testing. OOPS
Edit: Okay version 38 should be working, I'm in-game with it right now. Sorry about that

a month ago

No problem xD fast fix not a bug xD You saved my afternoon without kids xD

[deleted message]
[deleted message]
[deleted message]
a month ago

After update i lost all my drones, and the recipe is from last tech when starting the game xD i have not enabled challenge mod so idk if it is the way you wanted

a month ago
(updated a month ago)

You're saying the crafting recipe is still the old easy one? And you shouldn't have lost your... ohhh wait I think I know why they disappeared. Hmm. I'll have to ponder that fix for a minute.

a month ago

The recipe is harder. It should be easy. I have disable the challenge mode so should be easy

a month ago
(updated a month ago)

The recipe is harder. It should be easy. I have disable the challenge mode so should be easy

This is intended. The old crafting recipes were absurdly easy compared to the complexity and capabilities of the drone. It was like green science tier. Now companions are actually believably valuable instead of being cheap cannon fodder.

Don't worry, you won't have to craft all your drones back up again, at least, so long as you haven't overwritten your save yet. I'll update the mod soon so it doesn't delete all but one companion when it resets and when you load back in again you'll still have all your companions from before.

a month ago

In py it is not funny xd i overwrote the save but too bad xd

a month ago
(updated a month ago)

After update i lost all my drones

Fixed. Now, so long as you DID NOT SAVE, you're perfectly fine to update and keep playing and you'll keep all your drones. However, if you saved with the broken version and don't have an old autosave or something to revert to, I'm sorry but those other drones are gone and I'm not reverting to the easy recipes unless I made it it's own separate option, an "easy mode" in addition to the "challenge mode." But that's a lot more than a simple bugfix.

Edit: Oh you posted while I was writing this lol. Damn, you overwrote it? Oh and I didn't consider the complexity increasing modpacks like Py and Angels and such. Alright, I'll make the easy mode, just give me some time.

a month ago

We appreciate easy mode. SOme of us just want to have little companion bots. Also, question, I wasn't able to ever find any docs on what I can actually upgrade them with. Is it just shields, lasers, and build bots?

a month ago
(updated a month ago)

Ah, yes. They'll upgrade automatically as you research certain key technologies, and if you have the chatter turned on, they'll announce when something is upgraded. If you want to see specifically what, look in /scripts/companion.lua, they're right at the top of the file (intentionally)

a month ago

Make the changes youve done in the challenge mod

a month ago

I cannot help you if you do not communicate.

a month ago

I Think that your changes on this mega update are great but we should have the possibility to have those free OP bots also a option like OldXompanions or sth cause Games started with mods are not balanced

a month ago
(updated a month ago)

I agree and I'm already working on it as we speak--Like I said earlier, I'll be adding an "easy mode" shortly which will return the crafting recipes to the old ones, to make modpacks like angels, bobs, or py more bearable.

Also, glad you like the changes! I'll be honest I was pretty nervous before release because of how much was affected.

a month ago

the game crashes every time i try to place the companions and the recipes are fried with this skyrim SE of an 'Update' next time you get the idea to 'balance' something please make sure that the pre change settings are the Default

a month ago
(updated a month ago)

We've had hundreds of downloads and very few complaints, and zero which were not quickly resolved. Now, calm yourself and be more specific if you want any hope of receiving help, or I will simply delete your posts.

First, and most importantly, does this still happen with zero other mods installed?
If not, then you're wasting both of our time here and need to do a binary search to find the conflicting mod(s) before trying anything else.
If so, then what exactly are the conditions that cause the crash? Are you placing your first ever companion or an additional? Are you on Nauvis or another planet? If it's another planet, is it Factorio's or a modded one? Did you just start a new game or is this in an existing save? If it's in an existing save then have mod settings been changed or is it loading without the little "warning" about mods being changed?
And what do you mean by "the recipes are fried"? That is completely useless to me.

a month ago

the Fried part is in reference to the violent jump in complexity in making the drones vs the 2.0 version i thought it was an error and that challenge mode was to blame, turns out that was just you and that 'easy mode' will fix that, as for the crashing it does Not happen with the Kubiixx Companion drones mod version when i swapped to it on my existing modded save where im on nauvis, no settings had been changed it was loading fine no warnings until the crash im testing it on its own on a fresh world once my game loads

a month ago

ok they work on a fresh world and even with my existing modlist but im Betting its the new restriction on how many bots we can have that is to blame as my main world is a Multiplayer one and between myself and the other player we had 3 bots and it was crashing everytime we tried to place down his replacement one that was lost in a biter attack last load before 3.0

a month ago

confirmed the issue seems to be Multiplayer specific as i cant recreate it on my own

a month ago

Thank you for being reasonable.

Unfortunately multiplayer is very problematic as the original mod author did not set things up to work that way in the first place--you have been lucky that it has worked so far... I'm guessing it was only one of you who ever used the companion and the other player didn't mess with it?

A significant amount of work is required to make the mod fully multiplayer compatible and I cannot guarantee I will be able to do that anytime soon. If I can figure out a way to reproduce the problem then I may try to solve your specific crash and see if that works "well enough" like the old version did, but no promises. Can you give me a screenshot of your exact crash error and maybe even the save file via google drive or something? That would help a lot.

Easy mode will be finished this weekend so you'll have your easier recipes back, but I'm sorry to say that the multiplayer incompatibility is not something I can resolve quickly at all. I would recommend you and your friend just revert back to the old mod for now--you can download any previous version from the "downloads" tab.

a month ago

Error while loading savefile. In save version was 2.0.13. Mod updated to latest version

The mod Companion Drones 2.0 (3.0.39) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event companion-drones-mjlfix::on_tick (ID 0)
companion-drones-mjlfix/script/companion.lua:1313: attempt to perform arithmetic on local 'radius' (a nil value)
stack traceback:
companion-drones-mjlfix/script/companion.lua:1313: in function 'update'
companion-drones-mjlfix/script/companion.lua:1606: in function 'update_active_companions'
companion-drones-mjlfix/script/companion.lua:1665: in function 'handler'
core/lualib/event_handler.lua:72: in function <core/lualib/event_handler.lua:70>

a month ago
(updated a month ago)

Thank you for being reasonable.

yeah sorry about being so inflammatory in the first place i was running hot since the crash cost me and my friend multiple hours of work

Unfortunately multiplayer is very problematic as the original mod author did not set things up to work that way in the first place--you have been lucky that it has worked so far... I'm guessing it was only one of you who ever used the companion and the other player didn't mess with it?

we both spawned in with a pair of CDs when we began the game it was only when either of us tried to put his replacement second drone down that things melted as noted the Kubiixx version of CD does Not have this issue nor does it have a limit on how many companions can be deployed so i think the fault lies in that area of code

A significant amount of work is required to make the mod fully multiplayer compatible and I cannot guarantee I will be able to do that anytime soon. If I can figure out a way to reproduce the problem then I may try to solve your specific crash and see if that works "well enough" like the old version did, but no promises. Can you give me a screenshot of your exact crash error and maybe even the save file via google drive or something? That would help a lot.

i can give you the file just tell me where to post it

Easy mode will be finished this weekend so you'll have your easier recipes back, but I'm sorry to say that the multiplayer incompatibility is not something I can resolve quickly at all. I would recommend you and your friend just revert back to the old mod for now--you can download any previous version from the "downloads" tab.

ok and can i ask you to also look into why in the hell trying to plug the perpetual engine into the CDs causes them to orphan (aka stop following or assisting the player) themselves? (relevant mod here https://mods.factorio.com/mod/SchallPerpetualMachine )

a month ago
(updated a month ago)

since the crash cost me and my friend multiple hours of work

Oof, sorry about that. You don't have autosave enabled? That's really risky for no real gain.

as noted the Kubiixx version of CD does Not have this issue

I realize that, but it was only through sheer luck, not through any intentional effort on the mod's part. It just "happened" to usually work in multiplayer, so when I was updating, there was no effort made to retain that function because it wasn't a specific function at all. It was more like... the things that could have gone wrong in multiplayer before rarely got touched, so issues rarely arose. Now the issues are touched more frequently, so the issues that were always there (just more hidden) are more apparent now.

Making the mod multiplayer compatible will require a major refactor as all the global variables--many of which were already there before I started toying with things--get transferred into player-specific tables (which is not as easy as it might sound).

so i think the fault lies in that area of code

It's easy to jump to conclusions like that but frankly they're almost never correct when dealing with code. Human intuition about what causes problems are rarely correct about what causes problems in computers because their "brains" work fundamentally different from ours and thus hitch on different types of problems. Not saying you're wrong, I haven't looked yet, but it could just as easily be in many other sections of the code.

i can give you the file just tell me where to post it

Any file sharing service. Google drive, dropbox, mega.nz, catbox.moe, whatever, just put the link in your reply.

can i ask you to also look into why in the hell trying to plug the perpetual engine into the CDs causes them to orphan (aka stop following or assisting the player) themselves?

I'll look, since it might reveal a deeper problem I'd want to fix, but no promises. The companion is really only intended to use its own companion-specific equipment. The companion reactor is already a source of free infinite energy.

a month ago
(updated a month ago)

Erubian, are you comfortable going into the code and trying out a fix yourself? It's a very simple fix to try. It's just I'm in the middle of working on the easy-mode update so I can't just casually upload a new version with a minor change.

If so, unzip companion-drones-mjlfix_3.0.39.zip, then open companion-drones-mjlfix_3.0.39/scripts/companion.lua.
Now do a ctrl+F search for local radius = storage.max_distance there will be two of them.
After BOTH of them, put or 100 at the end of the same line, so that it reads local radius = storage.max_distance or 100 instead.

That MIGHT fix it. But if it raises another error, I'm not going back and forth all day with you, I'll just debug like normal and include it in the next update

a month ago

Challenge mode has some minor issues related to typos and name changes brought by 2.0 https://github.com/Maoman1101/companionDrone/pull/3

a month ago

Erubian, are you comfortable going into the code and trying out a fix yourself? It's a very simple fix to try. It's just I'm in the middle of working on the easy-mode update so I can't just casually upload a new version with a minor change.

which thing is this intended to fix because if its the crash il need to wait to give you a report since my friend and i play once a week if its the orphaning thing i can try it whenever

[deleted message]
a month ago

Challenge mode has some minor issues related to typos and name changes brought by 2.0 https://github.com/Maoman1101/companionDrone/pull/3

Pull request accepted

which thing is this intended to fix because if its the crash il need to wait to give you a report since my friend and i play once a week if its the orphaning thing i can try it whenever

This would be to fix the crash. The orphaning I have no idea right now.

30 days ago
(updated 30 days ago)

Please take all bug reports to the thread for version 3.1.
https://mods.factorio.com/mod/companion-drones-mjlfix/discussion/68b47ad022111d4e0920e0ca
NOTE: if you still have the same issue as you had in version 3.0 from this thread, please explain it in full again so I can keep easier track.

This thread has been locked.