How to control construction robots

Place to get help with not working mods / modding interface.
Post Reply
TexTheAfk
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Dec 11, 2022 1:54 am
Contact:

How to control construction robots

Post by TexTheAfk »

I'm working on a mod to make construction bots smarter. The plan is to allow them to retreat when they take too much damage while repairing walls. I currently implement this by taking away the repair packs and placing them back into the roboport. This makes the robot fly back and get new repair packs. Ideally I'd like to also remove the repair job from the damaged robot and have the logistic network assign the job to a new robot. Currently the robot stays assigned to the repair job even though it doesn't have a repair pack anymore - it simply picks up a new repair pack and resumes the job.

Is there a way to directly command a robot to release its repair job? Even better would be a way to command the robot to return to and enter the roboport.

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: How to control construction robots

Post by DaleStan »

Random thought, more than anything I know can be done, but: If you have access to the robot's charge state (and it's not one of Bob's tier 5 fusion-powered robots), you can set the charge state to 10%, and force the robot to return to recharge. It probably still won't release the job, but it'll stay away from the attack for longer.

TexTheAfk
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Dec 11, 2022 1:54 am
Contact:

Re: How to control construction robots

Post by TexTheAfk »

Yes that's a good thought! I'm able to access the charge state and reduce the energy. This was actually my first approach and makes the robots return to charge. The big downside of this is that the robot will be slow to get out of harms way and in my tests more robots died unnecessarily. Also, as you guessed this does not release the repair job.

I also started tinkering with reducing the energy after a short moment. That seems viable. Though I didn't put in the work yet to calculate when to give the energy back - that would need to happen before the robot arrives at the roboport and enters the charging queue. In case the robots can't be controlled directly this is what I'm probably going to do.

Post Reply

Return to “Modding help”