[MOD 0.14] Personal Roboport Switch

Topics and discussion about specific mods
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

[MOD 0.14] Personal Roboport Switch

Post by mknejp »

.icon.png
.icon.png (42.41 KiB) Viewed 11886 times
Name: Personal Roboport Switch
Version 0.1.4
Requires Factorio 0.14
Licensed under MIT.
Get it on the mod portal

Allows you to control whether the personal roboports equipped in your armor or a vehicle should automatically deactivate while within the range of other roboports. No longer pick up random junk while deconstructing your base! Default keybind is "O".
Long description
Last edited by mknejp on Sun Sep 25, 2016 4:36 pm, edited 5 times in total.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by Nexela »

Looks good! time to abuse it!
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

Updated 0.1.1 and 0.1.2 fix some bugs

Code: Select all

personal-roboport-switch 0.1.2
===============================================================================
FIXES
* Sometimes a player's roboports would not remain deactivated when embarking a vehicle for which roboprts are deactivated

personal-roboport-switch 0.1.1
===============================================================================
FIXES
* "personal-poboport-switch/src/main.lua:460:attempt to index global'entity'(a nil value)" when something dies
Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by Jupiter »

Hej,
Can you make some functionality that lets me use ONLY my own personal roboport and not that of my network? This will come in handy if I'm constructing something small or experimenting with an 8-belt balancer or something so the materials don't have to come from a mile away which takes ages. Or when I want to move something so I deconstruct it but then half the items get picked up by my network.

Also posted on mod portal.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

Jupiter wrote:Hej,
Can you make some functionality that lets me use ONLY my own personal roboport and not that of my network? This will come in handy if I'm constructing something small or experimenting with an 8-belt balancer or something so the materials don't have to come from a mile away which takes ages. Or when I want to move something so I deconstruct it but then half the items get picked up by my network.

Also posted on mod portal.
If you have all the materials in your inventory and you're not building more things than you have robots available then your own roboport takes priority. Besides that no, I don't have control over the base network. And... why post in two placed at once. That's just redundant.
zebediah49
Fast Inserter
Fast Inserter
Posts: 122
Joined: Fri Jun 17, 2016 8:17 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by zebediah49 »

It wasn't clear from the description if this is a feature request or already supported --

Is there is regular 'disable' option? Like, just turn roboports off, regardless of the surrounding coverage? My biggest problem is with suicidal construction bots, so being able to manually completely turn the system off would be very useful.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

zebediah49 wrote:It wasn't clear from the description if this is a feature request or already supported --

Is there is regular 'disable' option? Like, just turn roboports off, regardless of the surrounding coverage? My biggest problem is with suicidal construction bots, so being able to manually completely turn the system off would be very useful.
Currently not. I still haven't figured out the ruleset on how the manual toggle should or shouldn't interact with the automtic disabling.
zebediah49
Fast Inserter
Fast Inserter
Posts: 122
Joined: Fri Jun 17, 2016 8:17 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by zebediah49 »

mknejp wrote:
zebediah49 wrote:It wasn't clear from the description if this is a feature request or already supported --

Is there is regular 'disable' option? Like, just turn roboports off, regardless of the surrounding coverage? My biggest problem is with suicidal construction bots, so being able to manually completely turn the system off would be very useful.
Currently not. I still haven't figured out the ruleset on how the manual toggle should or shouldn't interact with the automtic disabling.
Always-on / area-controlled / Always-off?

While I'm at it, how possible would it be to have an option for the player to inherit the "roboport-while-moving" property of the vehicle he is in?
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

zebediah49 wrote:Always-on / area-controlled / Always-off?

While I'm at it, how possible would it be to have an option for the player to inherit the "roboport-while-moving" property of the vehicle he is in?
That no longer makes it a simple toggle but multiple options you have to cycle through, and that means you have to cycle through options you don't want, but which nevertheless are active for long enough to launch robots and even if the roboports are immediately disabled they finish their task before returning.

Plus I don't want to add more options just because otherwise it just becomes a mess of hotkeys and the way they interact with each other is never going to be intuitive to everyone.
Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by Jupiter »

I've got this error upon loading my save:

/src/main.lua:79: Attempt to index field '?' (a nil value)

And I've found the cause.
You are iterating through the deactivated networks in reversed order but you did not specify a step size in your for-loop of -1. I don't know if you forgot it or you assumed that it automatically uses -1 if the endindex is below the startindex but even if it does, it would still go wrong. If there are 0 deactivated networks than the startpoint would be 0 and the endpoint would be 1 and the stepsize would default to 1 again.
So you still need to specify it.

The same goes for the other loop (looping through deactivated_entity_networks) just a few lines down.

I made the change myself and it fixes the error.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

Good catch, thanks.
The_Mak
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jul 09, 2016 3:36 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by The_Mak »

Hey, have a bug report for you.

Factorio 0.14.9
personal-roboport-switch_0.1.3
boblibrary_0.14.2

The following error pops up:

Code: Select all

Error Util.cpp:57: Error in assignID, item with name 'personal-roboport-switch-disabled-vehicle-roboport' does not exist.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

I doubt that is caused by boblibrary as it doesn't declare any items. Are you running any other mods?
The_Mak
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jul 09, 2016 3:36 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by The_Mak »

mknejp wrote:I doubt that is caused by boblibrary as it doesn't declare any items. Are you running any other mods?
Damn, your right, I had only Bob mods in there and when I removed boblibrary the error did not show up. It seems you need boblibrary and bobvehicleequipment_0.14.0 (new mod) for the error to pop up. If you just have one of the them, the error does not show up.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by Nexela »

Bobs vehicle equipment adds a new personal roboport for vehicles.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

Right, I found out what the problem is here. Bob doesn't specify a "take_result" (which controls the inventory item created when you take the equipment out) so the game makes it the same as the equipment name. Because I have to clone existing roboports and change their properties in order for the mod to work, the disabled equipment also didn't have a "take_result" specified so the game was looking for an item with the name of the cloned roboport, which obviously doesn't exist. So now I make sure "take_result" is always present and set to the original equipment's name if not already specified.

This is now supported in 0.1.4.

Code: Select all

personal-roboport-switch 0.1.4
===============================================================================
FIXES
* Added support for mods which don't specify the "take_result" property on their equipment.
Mokmo
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 15, 2016 6:44 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by Mokmo »

So i just installed the mod
i hit the hotkey and i get the prompt but my personal construction bots still work...
Am i doing something wrong ?
14.12
Also it keeps telling me there is no construction zone when i'm in my main logistics network's orange area... or even green area for that matter.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by mknejp »

Mokmo wrote:So i just installed the mod
i hit the hotkey and i get the prompt but my personal construction bots still work...
Am i doing something wrong ?
14.12
So just to clarify your bots only disable while your player character is standing inside the bounds of the target network. If you are standing even a tiny amount outside your roboports are active and they will perform task within the range of the other network if your areas overlap. There isn't really a way around this.
Mokmo wrote:Also it keeps telling me there is no construction zone when i'm in my main logistics network's orange area... or even green area for that matter.
Ok, interesting. Is your mouse over any entity when pressing the button? If you have something selected with your mouse it tries to use that object as network wich only works with roboports and vehicles.
kaldskryke
Inserter
Inserter
Posts: 27
Joined: Mon Nov 17, 2014 3:49 am
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by kaldskryke »

I'm also having issues. While within the area of a stationary roboport, I can press "O" and I will get a message saying that my PRs should de-activate but they still participate in both construction and deconstruction. I've tried toggling multiple times, and leaving and re-entering the range of the stationary roboport. Running 0.14.13
totobest
Inserter
Inserter
Posts: 27
Joined: Mon Dec 26, 2016 12:46 am
Contact:

Re: [MOD 0.14] Personal Roboport Switch

Post by totobest »

kaldskryke wrote:I'm also having issues. While within the area of a stationary roboport, I can press "O" and I will get a message saying that my PRs should de-activate but they still participate in both construction and deconstruction. I've tried toggling multiple times, and leaving and re-entering the range of the stationary roboport. Running 0.14.13
Same issue here. Is there a Github repository so we can help? Running 0.14.21.
Post Reply

Return to “Mods”