[MOD 0.13] Drones - remote control your factory

Topics and discussion about specific mods
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by Nexela »

binbinhfr wrote:
Dubstep_Ninja_ wrote:Is it really possible to monitor your whole factory with your iphone? And if so how?
Of course !!!

Well.... At least, your character ingame can. My mod provides him with a smartphone.

But it is not possible on your smarphone in real life, if it is what you thought ;)
Unless factorio devs implement this on Android.

Well in theory monitoring is possible...... you could write a mod that outputs a lot of info to a file and have a program/script which parses the output file and sends it to a webserver/app so the next time you are bored at a company meeting you will be able to check how many iron plates are in your logistic network!

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by binbinhfr »

> I just find it a little "theme breaking" to have what appears to be a mini-quad-copter carting around tons of factory equipment.

Oh, it's a huge powerful copter, not a toy !!! ;-)
Anyway, do you think that it's more realistic that you have 50 assembling machines or oil refineries in your human bag ???...

> One is that the flying drone should not be moved by a conveyor belt (which is probably hard to do...)

That one is a problem in other mods too, like airplanes, and there is no solution, apart stopping the belts.

> and that the maintenance drone should probably be targetable by the spitters.

I can't make it targetable to only spitters. Either it is invincible or not. Infact there is no flying object in factorio. It is just a crawling object that has no coliision box with other objects. For the moment, I made them invincible because before 0.13, when the drone died, it meant that the player dies ! Now I can change this because there is a on_pre_player_died event where I can avoid death. Do you want the maintenance drone to be mortal, even to bitters ? It sounds ok to me.

> Finally, I had it happen once that I was not where I thought I was, and flew outside a drone antenna range, so after that was unable to find the drone's location.

For this, there is the "?" button that draws a big flashing arrow on the top on the selected drone.

But I now changed the way "drone lost" works : now if you lose control, you remain in the drone, you just cannot move it anymore. So you can even go into a lost drone to see where it is.

For the zone of antennas, remember that the average safe radius is <150m so you roughly need an antenna every 250m ! (there is a big yellow zone when you hold an antenna)

Please update mod and tell me if it's ok. Have a nice game.
My mods on the Factorio Mod Portal :geek:

Eogen
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Jul 08, 2016 5:45 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by Eogen »

> I just find it a little "theme breaking" to have what appears to be a mini-quad-copter carting around tons of factory equipment.
Oh, it's a huge powerful copter, not a toy !!! ;-)
Anyway, do you think that it's more realistic that you have 50 assembling machines or oil refineries in your human bag ???...
I have been a big fan of TerraFirmaCraft, one of whose themes is roughly "Its not about realism, its about believability." Yes, inventory capability is all technically BS, its just where we choose to draw the line. Giving me the ability to limit the inventory size should let me tweak this into believable for me.
If the drone is "huge" perhaps it might be bigger? If the drone were, say, the 2x2 size of a turret, this might better portray it as more than a "toy". Again, probably limited by the "player" artifact that the drone is based on(?)
> flying drone should not be moved by a conveyor belt
That one is a problem in other mods too, like airplanes, and there is no solution, apart stopping the belts.
You'd think that they'll eventually add a 'beforeConveyorMove" event.
> and that the maintenance drone should probably be targetable by the spitters.
I can't make it targetable to only spitters. [...] Do you want the maintenance drone to be mortal, even to bitters ? It sounds ok to me.
Yeah, I had seen that in this thread, and apparently missed where it changed. I like idea of the trade-off between surveillance being immortal, but impotent, and the maintenance being mortal, but able to move things around. I think that's a good trade-off, certainly will bring balance to the drone in combat. A config option might be appropriate.
> Finally, I had it happen once that I was not where I thought I was, and flew outside a drone antenna range, so after that was unable to find the drone's location.
For this, there is the "?" button that draws a big flashing arrow on the top on the selected drone.
But I now changed the way "drone lost" works : now if you lose control, you remain in the drone, you just cannot move it anymore. So you can even go into a lost drone to see where it is.
Sorry, missed that. But I do like your solution.
For the zone of antennas, remember that the average safe radius is <150m so you roughly need an antenna every 250m ! (there is a big yellow zone when you hold an antenna)
Yeah, knew that. My problem is the limit on the zoom/minimap functionality. I can't zoom out enough to see the grand picture, but the resolution on the minimap makes it less than useful once you hit a certain size. (Nothing to do with this mod, per se, but one of my pain points in the game gui.)
Again, I would like to thank you for your responsiveness and the changes you have made. I will load them up today, and let you know how it feels.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by binbinhfr »

> A config option might be appropriate.

a problem has been spotted with that in another thread : now that mod install and uodate are almost automatical, config files are quite hard to manage : they are overwritten at every update. So I would not use them too much anymore to avoid users being lost.

> I can't zoom out enough to see the grand picture

Well, I wrote a simple zoom mod for myself, and you gave me the idea to publish it. Here it is : viewtopic.php?f=92&t=28639
My mods on the Factorio Mod Portal :geek:

Eogen
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Jul 08, 2016 5:45 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by Eogen »

Sorry for slow reply. Ran into issue with folks I was playing with using 12.X and the new version requiring 13.X. We ended up using the 1.08 drones, and ran into the issue where the drones stop caring about towers but once you disconnect from them, you cannot reconnect... and then crash the game with a lua error. I had not seen this before. Will be a few days before I can test.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by binbinhfr »

1.0.8 was quite stable, i never had crash problem with it at that time. There should be an incompatibility with anoterh mod dealing with character change / teleport or something like that.
Anyway I cannot test under 0.12 anymore. So please update to 0.13.
My mods on the Factorio Mod Portal :geek:

Requia
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Thu Mar 24, 2016 12:24 am
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by Requia »

Did the bug where it stopped letting you change between drones ever get fixed? I can't find the changelog but see updates in the mod portal.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by binbinhfr »

I do not remember this bug. Do you speak about the corrupted data problem someone had once ? It remains a mystery. Probably a bad interaction with another mod that modifies character. I did my best to integrate several tests in my mod to avoid bad changes, but I cannot garanty that other mods do the same.

Anyway, I use this mod without problem on my base, and had no return since, so I supposed it can be considered as stable.

Make a backup of your base, and try it for a few days, and you'll see. :-)

EDIT : just in case, to give you confidence ; on very last version, I added a command to recover your human body in case of problem. Please update.
And if any lost character, just type /c remote.call( "drones", "lost", game.player ) in the console.
My mods on the Factorio Mod Portal :geek:

eudaimondaimon
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Aug 04, 2016 7:10 pm
Contact:

BUG FOUND!! Surface transitions. Re: [MOD 0.12+] Dron....

Post by eudaimondaimon »

Hey there, binbinhfr,

I think I've located the source of a bug/incompatibility I'd seen others report before. I know you've responded to reports but I dont know if you already have this information - they didn't seem to give much in the way of description. I can sorta read your files and understand what's going on (your functions and variables are descriptive, well-named, and very consistent! It makes your code really easy to read even for someone not-at-all familiar with lua syntax. That's an awesome trait I need to try and better-practice... XD ), and while I started to attempt a fix, I realized I was really just writing pseudocode that /sort of/ resembled lua, maybe. So I figured that I would try and describe what I'd traced and your implementation of a fix will probably be MUCH better implemented by you than any hack assembled by myself:

Anyway - the report.
Description: Drones appear in list as valid but can not be switched-to or destroyed. Drones do not show antenna-lost messages. Drones still appear as graphical entities in game but clicking the drone-button does nothing. Moving to drone with body and clicking recover results in the drone silently being taken off the list but does not recover drone in player inventory, the inventory of the drone, and also does not remove the sprite from rendering on the screen.

Linked cause: Drones transitioning surfaces causes the mod to not be able to find the drone object. Drone object still exists - but the trigger to delete table references does not occur when drones move between surfaces. The table references are only removed when the recover drone button is pressed, but do not seem to remove the object. This even occurs if a drone transitions surfaces and then returns to game.player.surface, even if all points of the drone's transition are within antenna range.

Reproduction: Using the Factorissimo mod, create a Factory and then place an antenna on either side. Place a drone on one side. Fly into factory (even through the top, since drones don't have collision but the try_factory_enter event in factorissimo seems to be triggered by a bounding box). Either return to body or fly back out to the player's surface - either way the error occurs.


Possible fix (that I am not sure how to code): When searching for a drone or reporting it lost, do as you do with finding lost players and filter the game.surface.find_entities results by whatever the unique identifier for the drone is, and attempt to return the object that way.

Hope this helps!

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.12+] Drones - remote control your factory

Post by binbinhfr »

Hi, thx for your explanation.
I now remember that the problem was with changing surface. When it was reported I tried to fix it, but at that time, there was a bug in factorio API preventing me from doing what I should do. Now I supposed it has been corrected, but I forgot to work on it again. I will try to debug with factorissimo and to find a fix to thsi changing surface problem. I never use these surface changing mods, that's why I never had this problem myself ;-)
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by binbinhfr »

Hi again eudaimondaimon,

I made my little inquiry. I tested a lot of things and finally found the problem.
It is a factorio limitation. In factorio, you can transfer one player from a surface to another, but you cannot transfer any other sort of entities when they are deconnected from the player. And so are my drones when they are unused and left on the map. So if you enter a factory with my drone and then switch to another drone/body, the left drone is lost, invalid in factorio.
Finding this problem, I made a report here viewtopic.php?f=23&t=30563
But the dev just confirms that it's like this...
It's confirmed here too viewtopic.php?f=28&t=27033
So I'm afraid there is no solution for the moment, so I give up on this one until API changes... Sorry.
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: BUG FOUND!! Surface transitions. Re: [MOD 0.12+] Dron....

Post by binbinhfr »

eudaimondaimon wrote:Hey there, binbinhfr,
(....)
Hope this helps!
Hi again,

good news for Factorissimo users. Following a request I made, the wise devs introduced on_player_changed_surface event in Factorio 0.13.16 . That allows me to manage surface changes without losing drones or main body !

Please update. I made a few tests with Factorissimo and it seems to work.
Do not forget to put some powered antennas in the other surfaces !!!

Plz tell me if everything is ok.

--------------

1.0.18 - introduce surface change (with new on_player_changed_surface event in Factorio 0.13.16)
- use on_player_respawned to recover new character.
- suppress all dup feature, source of problems with surfaces.
- add tooltips
- compact gui size
My mods on the Factorio Mod Portal :geek:

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by iceman_1212 »

Hi there!

Got the following error on 13.19 just now. It happened shortly after I mined an antenna (which was in a spot where i wanted to put some furnaces) and I placed a new antenna just a couple grid spaces to the north. Lmk if helpful to have any additional info! (And thanks again for the great mods!)

Error while running event on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
__Drones__/control.lua:445: in function 'calc_antenna_range'
__Drones__/control.lua:475: in function 'calc_antennas_ranges'
__Drones__/control.lua:341: in function <__Drones__/control.lua:297>

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by binbinhfr »

Hi iceman,

I did not understand why this happened, but I added some checks to avoid it.

But now my mod is under facto 0.14.
But you can still manually download the mod and just replace the control.lua file of your version,
or edit the JSON file and change 0.14 into 0.13 .
https://mods.factorio.com/mods/binbinhfr/Drones

please tell me if you still encounter this problem.
My mods on the Factorio Mod Portal :geek:

iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by iceman_1212 »

binbinhfr wrote:Hi iceman,

I did not understand why this happened, but I added some checks to avoid it.

But now my mod is under facto 0.14.
But you can still manually download the mod and just replace the control.lua file of your version,
or edit the JSON file and change 0.14 into 0.13 .
https://mods.factorio.com/mods/binbinhfr/Drones

please tell me if you still encounter this problem.
have been playing on that save for a few hours now and it looks like it is indeed resolved!

also, i tried casually adding an mk2 power armor to a maintenance drone's armor slot and had a good laugh when i saw the "you must be dreaming" message C:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by binbinhfr »

iceman_1212 wrote:also, i tried casually adding an mk2 power armor to a maintenance drone's armor slot and had a good laugh when i saw the "you must be dreaming" message C:
I'm happy that someone saw this little "egg" ;-)
My mods on the Factorio Mod Portal :geek:

Madd_Mugsy
Inserter
Inserter
Posts: 26
Joined: Fri May 09, 2014 8:39 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by Madd_Mugsy »

FYI -- The latest version (1.0.21) causes bob's assembly mod to crash with the following error:

Code: Select all

Failed to load mod "bobassembly 0.14.0"
__boblibrary__/category-functions.lua:7 bad argument #1 to 'pairs'
(table expected, got nil)
Removing the Drones mod allows it to load normally, as does reverting to 1.0.20.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by binbinhfr »

Hi,

it's not a problem with my mod but with Bob library.
There was a recent change in factorio API and bob did not reflect it.
I make a report on his page for that and correct my mod for the moment. viewtopic.php?f=51&t=27413&p=201947#p201947
you can update to 1.0.22 of my mod for a temporary correction.
My mods on the Factorio Mod Portal :geek:

Dogman_27
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 09, 2016 8:54 am
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by Dogman_27 »

When I fly out of antenna range I lose control of the drone and can't switch back, it says: stop moving like a dumbass before switching... Plz help!

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [MOD 0.13] Drones - remote control your factory

Post by binbinhfr »

Dogman_27 wrote:When I fly out of antenna range I lose control of the drone and can't switch back, it says: stop moving like a dumbass before switching... Plz help!
I am not at home right now, but will have a look at it tomorrow.
Are you sure you have the very last version of the mod and factorio, because I never experienced this before.

EDIT: should be corrected, please update to new version and tell me.
My mods on the Factorio Mod Portal :geek:

Post Reply

Return to “Mods”