Mod to disable Roboport construction via Hotkey

This is the place to request new mods or give ideas about what could be done.
Post Reply
terrormortis
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Dec 06, 2017 7:16 pm
Contact:

Mod to disable Roboport construction via Hotkey

Post by terrormortis »

Hello Everyone,

I saw a punch of mods which allow you to deactivate personal roboports via hotkey to prevent personal robots filling up your inventory when something is deconstructed nearby.
Would it be possible to create a Mod to disable stationary roboports construction, for example by setting the construction area to 2x2?

In this way a blueprint next to me would be completed with my personal robots, it is sometimes very annoying to wait for other construction bots to carry over parts when the parts are actually in my inventory.

Maybe someone could make this mod or give some directions if it is possible.
Best wishes

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by darkfrei »

terrormortis wrote:Hello Everyone,

I saw a punch of mods which allow you to deactivate personal roboports via hotkey to prevent personal robots filling up your inventory when something is deconstructed nearby.
Would it be possible to create a Mod to disable stationary roboports construction, for example by setting the construction area to 2x2?

In this way a blueprint next to me would be completed with my personal robots, it is sometimes very annoying to wait for other construction bots to carry over parts when the parts are actually in my inventory.

Maybe someone could make this mod or give some directions if it is possible.
Best wishes
Something like this?

Code: Select all

function active_roboports (active) -- active is bool
for i, roboport in pairs (global.roboports) do
  if roboport.valid then
    roboport.active = active
  end
end

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by darkfrei »

Try this one. Proof of concept.

It works now for old roboports only.
DisableEntities_0.0.1.zip
For 0.15.40
(30.79 KiB) Downloaded 74 times
Attachments
2017-12-11 22_59_30.png
2017-12-11 22_59_30.png (162.67 KiB) Viewed 2533 times

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by darkfrei »

New version: you can enable/disable roboports and robots.
Attachments
GUI
GUI
2017-12-13 20_00_12.png (6.6 KiB) Viewed 2506 times
DisableEntities_0.0.2.zip
For 0.15
(41.36 KiB) Downloaded 74 times

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by darkfrei »

Jon8RFC wrote:This looks great and I hope to try it out when I get some free time.

Is it too difficult to add an additional function to disable on two levels? The first level would be disable only for other players' construction, so that in multi-player environments, if they're blueprinting or deconstructing, mine only work for myself. The second level would be a complete disabling.
Yes, it's possible, but not for robots: they haven't last_user parameter.

User avatar
Jon8RFC
Filter Inserter
Filter Inserter
Posts: 553
Joined: Tue May 10, 2016 3:39 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by Jon8RFC »

I realized after I posted that this wasn't for personal robo ports and deleted the post, but you're too quick for me and managed to answer. Thanks for the information!

A follow-up, since I don't understand Lua functionality--does this mean that even though entities are blueprinted by someone else, the robots/ports can't read that parameter? I understand that a robot itself doesn't have a "last user" parameter for itself, but I'm asking for clarification regarding robots or the robo port's ability to read "last user" of entities which do support "last user".
Image

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Mod to disable Roboport construction via Hotkey

Post by darkfrei »

Jon8RFC wrote:I'm asking for clarification regarding robots or the robo port's ability to read "last user" of entities which do support "last user".
Robots have no API, they are too optimized and can be paused and unpaused.

Post Reply

Return to “Ideas and Requests For Mods”