Page 1 of 4

[MOD 0.11.22] Pocket Bots. Construction bots for your pocket.

Posted: Sat Jun 21, 2014 1:08 am
by JamesOFarrell
This mod will be implemented into vanilla Factorio, see https://forums.factorio.com/forum/viewforum.php?f=68

Description
PocketBots will give you access to a new armor module, PocketBots. This module acts just like a portable roboport.
Image
Info/Notes
This version works with multiplayer.

The roboport will only activate when you are outside other roboport range and there are things for your robots to do, like repair a building or build a wall. Also make sure you have enough power in your armor to run the thing. It will use 700w when in use. (This is not true. there is a bug. they only use power when you are running around.)
Larger Gifs Videos Download
PocketBots_1.0.0.zip
v1.0.0
(41.57 KiB) Downloaded 1126 times
11.22 only

Change Log
  • v0.0.1 Initial alpha release... expect lots of bugs...
    v0.0.2 fixed bugs and improved the code for deploying the roboport
    v0.0.3 A lot better at doing the things that matter. Now runs more often but takes up less cpu time... I hope
    v0.1.0 first real release. Small fixes.
    v0.1.1 Small fixes.
    v0.1.2 Initial 0.11 support
    v0.1.3 quick fix for changes in roboport prototype
    v0.2.0 first version using armor module
    v0.2.1 Fixed migration script and research amount
    v0.2.2 Fixed bug caused by changes in the API
    v1.0.0 Final release, code from cpw and small bug fix
Old Thread

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sat Jun 21, 2014 2:19 pm
by Loscil
Coolness, thanks m8.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sat Jun 21, 2014 9:40 pm
by atehxx
Hi,
great mod :)
Any chance to make construction bots put deconstructed items back to player's inventory? They just stay floating wherever they picked up something.
There is a workaround but it's not great - I could set those items as requested in logistics.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sat Jun 21, 2014 11:31 pm
by JamesOFarrell
atehxx wrote:Any chance to make construction bots put deconstructed items back to player's inventory? They just stay floating wherever they picked up something.
They should put things back into your inventory already, they will also over flow from you inventory onto the ground (try this by deconstruction a forrest, it gets pretty crazy). What may be happening is if you are more than 12 tiles away from all construction bots the pocket roboport will be put away and the bots will stop. If you want to trigger it just put down a ghost or damage a close by building. Can you try that and let me know if it works because if it does not it is a bug.

I am thinking of adding a GUI so you know when it is active and be able to toggle it manually for this situation so it is a little less confusing.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sun Jun 22, 2014 10:29 am
by Doskan
JamesOFarrell wrote:Description
This armor is just a version of the Mk2 Power Armor but comes with some pre-installed extras, a fusion reactor, some batteries and a roboport.
Hrm... i don't have anything preinstalled (or its not working) :?

Using v0.1.0

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sun Jun 22, 2014 10:34 am
by JamesOFarrell
Sorry, the wording is not great. The gird is smaller than the normal grid to emulate the preinstalled extra, I'll reword the first post. If you want to see if it works, put some construction bots and some repair-packs in your inventory and damage a wall outside of roboport coverage, they should come out and fix it for you.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sun Jun 22, 2014 11:07 am
by Doskan
JamesOFarrell wrote:Sorry, the wording is not great. The gird is smaller than the normal grid to emulate the preinstalled extra, I'll reword the first post. If you want to see if it works, put some construction bots and some repair-packs in your inventory and damage a wall outside of roboport coverage, they should come out and fix it for you.
Yes, the roboport works, but everything else dont.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Sun Jun 22, 2014 12:13 pm
by JamesOFarrell
Oh, I understand, sorry. Those items cant be used, they are used to power the Roboport.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Mon Jun 23, 2014 12:55 pm
by atehxx
JamesOFarrell wrote:
atehxx wrote:Any chance to make construction bots put deconstructed items back to player's inventory? They just stay floating wherever they picked up something.
They should put things back into your inventory already, they will also over flow from you inventory onto the ground (try this by deconstruction a forrest, it gets pretty crazy). What may be happening is if you are more than 12 tiles away from all construction bots the pocket roboport will be put away and the bots will stop. If you want to trigger it just put down a ghost or damage a close by building. Can you try that and let me know if it works because if it does not it is a bug.

I am thinking of adding a GUI so you know when it is active and be able to toggle it manually for this situation so it is a little less confusing.
I'm still close to them when they stop.
I think they stop when pocket roboport disables since there is no other work to do.
Basicly: I order to destroy some turrets, roboport activates, bots come out and pick up stuff, once everything is picked up roboport deactivates and bots stop their movement.
Other workaround (besides logistics from 1st post) I found is to pick normal roboport from inventory and hover it around - so it's working area gets painted on ground - this makes bots fly again and back to my inventory.

Possible fix for this problem I can think of is - scan player's area for flying bots, and if found any then don't disable pocket roboport yet. Should work? findentities would see flyign bots?

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Mon Jun 23, 2014 9:04 pm
by darius456
Flying is the relative concept. Fake flight right now. 8-) just my 2 cents.

Re: [MOD 0.10.x] Pocket Bots. Construction bots for your poc

Posted: Mon Jun 23, 2014 9:39 pm
by JamesOFarrell
atehxx wrote:Possible fix for this problem I can think of is - scan player's area for flying bots
This is the fix already in the mod but there is a limit to how many entities I can check before the game starts to suffer. The full checks in the current build are:
  • Get all roboports in a 26 (logistics network + 1) tile radius, if there is a non pocket roboport, disable
    Next get everything in a 12 tile radius (Pocket roboport construction network + 1)
    Is there is a logistics bot? disable (this is to avoid them using your inventory chest to supply your current logistics requests)
    Is there is a construction bot and a pocket roboport? enable (This is so your roboport is not used to recharge your normal every day construction bots)
    is there is a ghost? enable
    is there is a something that needs repairing? enable
    If you have checked over 1000 entities, give up and make an educated guess
What i think it happening is you are getting more than 12 blocks away from the bots and your pocket roboport is disabling, once it is disabled it will not re-enable for your construction bots. There is not a really easy fix to this situation, here are the ideas i have had.
  • Increase the roboport check to include the construction network radius then enable on all construction bots
    Increase the entity check range from 12 to something larger.
    Do a special check just for construction bots that is larger than 12 if there is a pocket roboport already enabled
    Always enable if I see construction bots and no logistics bots.
    Use a special kind of pocket construction bot but there would be no way to stop them being used in a normal roboports
    Add a GUI to toggle the roboport and let you know what is going on
I would like to decrease the CPU usage on this so i can check more often as the more often the roboport position is updated the smoother the bots seem to behave when running around. I am open to suggestions on how to address this edge case as it is the one that I am least happy with, thoughts?
darius456 wrote:Flying is the relative concept. Fake flight right now. 8-) just my 2 cents.
Huh?

Compatibility to v0.10.x

Posted: Mon Sep 08, 2014 3:20 pm
by ssilk
To make this mod run with v0.10.x you need to

- unpack the zip into the mods folder, delete the zip (there should be then a directory named "Pocket Bots" or so)
- rename the resulting directory to "PocketBots_0.1.0"
- open the file info.json and change it like so:

Code: Select all

{
	"name":"PocketBots",
	"author":"JamesOFarrell",
	"version":"0.1.0",
	"title":"PocketBots",
	"homepage":"http://localhost/",
	"description":"Pocket Bots!",
	"dependencies": ["base"]
}

Re: Compatibility to v0.10.x

Posted: Sat Oct 04, 2014 9:19 pm
by JamesOFarrell
ssilk wrote:To make this mod run with v0.10.x you need to...
Thanks Ssilk, i've put an updated version in the first port.

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Sun Nov 02, 2014 2:56 am
by JamesOFarrell
v0.1.2 has been released, this is now working with 0.11 single player only. While there will be a working multiplayer release I am going to make changes to the way this mod works before the next version. With the updated mod API in 0.11 I can now make this an item you put into your armor instead of a replacement for power armor. This will allow you to use upgraded armor form other mods or just the standard mk1 or mk2 armor. I've also now got some experience with guis thanks to TheFatController so I might add a little status window and roboport toggle button. Let me know about bugs you find.

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Sat Dec 06, 2014 5:43 am
by CobaltShield
I get an error when i use 0.11.4 version of factorio


Error while loading entity prototype "roboport-pocket" (roboport): No such node (base_patch).
Modifications: PocketBots

help? :cry:

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Sat Dec 06, 2014 12:22 pm
by JamesOFarrell
CobaltShield wrote:help?:
All fixed. I've uploaded a new version that works around this issue. Your post has also motivated me into finishing up multi-player support for pocket bots and moving it over to be a piece of equipment for modular armor. This is mostly done but is still being tested and should be available tomorrow.

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Mon Dec 08, 2014 5:28 am
by JamesOFarrell
New version is up, it should work as a module for power armor now. Before upgrading remove the modules from your pocket bots armor if you dont want to lose them. This release was designed to work with MP but I hit a snag that I think is a bug in Factorio. While it does work it will desync when ever the game saves so turn off auto-save.

There will be bugs in this version as most of the code base had to change for multiplayer. Let me know of any issues.

EDIT:

New version has been uploaded that remove the purple science requirement and fixed the migration script.

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Tue Feb 03, 2015 9:11 pm
by Talguy
Quick fix for 0.11.14+, Find in control.lua:

Code: Select all

player.getinventory(defines.inventory.playerarmor).getitemstack(1)
Replace with:

Code: Select all

player.getinventory(defines.inventory.playerarmor)[1]

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Wed Feb 04, 2015 5:37 am
by SuperSandro2000
Talguy wrote:Quick fix for 0.11.14+, Find in control.lua:

Code: Select all

player.getinventory(defines.inventory.playerarmor).getitemstack(1)
Replace with:

Code: Select all

player.getinventory(defines.inventory.playerarmor)[1]
The code is in line 70.

Re: [MOD 0.11.x] Pocket Bots. Construction bots for your poc

Posted: Wed Feb 04, 2015 6:03 am
by JamesOFarrell
Thanks guys! Life has been pretty busy lately but I'll try and make some time this weekend to upload the fix.