Page 1 of 2

[MOD 0.14] Personal Roboport Switch

Posted: Thu Sep 15, 2016 2:31 am
by mknejp
.icon.png
.icon.png (42.41 KiB) Viewed 10749 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

Re: [MOD 0.14] Personal Roboport Switch

Posted: Thu Sep 15, 2016 7:07 am
by Nexela
Looks good! time to abuse it!

Re: [MOD 0.14] Personal Roboport Switch

Posted: Thu Sep 15, 2016 4:06 pm
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

Re: [MOD 0.14] Personal Roboport Switch

Posted: Fri Sep 16, 2016 11:51 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Sep 17, 2016 12:48 am
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Sep 17, 2016 2:56 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Sep 17, 2016 3:36 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Sep 17, 2016 5:58 pm
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?

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Sep 17, 2016 6:20 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Wed Sep 21, 2016 12:42 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Wed Sep 21, 2016 8:11 pm
by mknejp
Good catch, thanks.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Sep 25, 2016 2:28 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Sep 25, 2016 3:32 pm
by mknejp
I doubt that is caused by boblibrary as it doesn't declare any items. Are you running any other mods?

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Sep 25, 2016 3:58 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Sep 25, 2016 4:03 pm
by Nexela
Bobs vehicle equipment adds a new personal roboport for vehicles.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Sep 25, 2016 4:36 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sat Oct 01, 2016 1:36 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Oct 02, 2016 4:06 pm
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.

Re: [MOD 0.14] Personal Roboport Switch

Posted: Sun Oct 09, 2016 7:31 pm
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

Re: [MOD 0.14] Personal Roboport Switch

Posted: Wed Jan 04, 2017 4:38 am
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.