Computercraft control issues
ThizThizzyDizzy opened this issue ยท 5 comments
Minecraft Version 1.12.2
Forge Version 14.23.5.2847
Mod Version 1.12.2-0.11.10-385
CC: Tweaked 1.86.2
The Issue
Drones do not properly respond to most tasks given by CC: Tweaked through a Drone interface (Some also crash the game)
I tested most of the actions; about 20% of them worked. Their outcomes listed below
Steps to reproduce for inventoryImport
:
Step 1: Program and place a drone with 3 puzzle pieces: start->Computer Control->Area containing a drone interface
Step 2: Place a computer next to the drone interface
Step 3: on the computer, run these commands, in order:
lua
drone = peripheral.wrap("right")
drone.addArea(3889,65,-14341)
(where those are the coordinates of a chest containing items)
drone.setAction("inventoryImport")
The drone will not even move.
If you then run drone.isActionDone()
it will return true
, despite not having done anything
I tested almost every action; most of them had issues listed here:
entityAttack
- on player, Server crashed: https://hastebin.com/ayocevupod.rb (NullPointer on getEntitiesWithinArea)
dig
- on dirt; Nothing happened
harvest
- on fully grown wheat; Nothing happened
place
with cobblestone; Nothing happened (Once it placed a block of cobblestone above the drone, but I could not reproduce this)
blockRightClick
on trapdoors; Only one of 6 was opened
entityRightClick
holding shears on sheep, Server crashed: https://hastebin.com/ijelimohul.rb (NullPointer on getEntitiesWithinArea)
pickupItem
- did not test due to the identical crashes on entityAttack
and entityRightClick
dropItem
- Usually works, but I've had some (not reproducible) issues- sometimes the drone doesn't move at all or moves around randomly (like a bat)
inventoryExport
on chest while holding cobblestone - Nothing happened; drone did not move
inventoryImport
on chest containing cobblestone - Nothing happened; drone did not move
liquidExport
on OpenBlocks tank while holding IE creosote - Nothing happened; drone did not move
liquidImport
on OpenBlocks tank containing IE creosote - Drone traveled to and emptied tank
entityExport
- did not test due to the identical crashes on entityAttack
and entityRightClick
entityImport
- did not test due to the identical crashes on entityAttack
and entityRightClick
Goto
- Works perfectly; drone even teleports when at long distances
teleport
- Works perfectly
emitRedstone
- Nothing happened; drone did not move (also tried setCount(13)
and setUseCount(true)
to set redstone level?)
rename
(Did not provide any name) - Server crash: https://hastebin.com/josaroyose.rb (accessing client I18n class on server)
suicide
- Works Perfectly
crafting
(furnace, with nil
in the center) - Server crash: https://hastebin.com/jozixuwoza.rb
standby
- Works Perfectly, can be woken up by any command
logistics
- Didn't do anything, but I also don't have any logistics stuff.
editSign
from "This is a sign" to "This" "Is" "TEXT!"
- Nothing happened; drone did not move
I don't know how to use conditions with computers, so I didn't test any of the condition actions
rfExport
on IE LV Capacitor- Nothing happened, drone did not move
rfImport
on IE LV Capacitor- Nothing happened, drone did not move
computerCraft
- Moot point, did not test
I had to do some debugging on this, since I'm not overly familiar with this code myself (I didn't write it), but what I discovered was that when programming drones with the Drone Interface, you also need to explicitly set a side or sides of the block to interact with, at least in the case of the import/export pieces. The default is no valid sides, which is why the drone ignores the "importInventory" action.
drone = peripheral.wrap("right")
drone.addArea(3889,65,-14341)
drone.setSide("up", true)
drone.setAction("inventoryImport")
will work fine (assuming you want to import from the UP side of the inventory). This will apply to any progwidget which takes a side setting (so place/dig/etc. too)
I'm also pushing some changes which should fix the three crashes you reported. Can you try out build 386+ from https://jenkins.k-4u.nl/job/PneumaticCraft-Repressurized/ and let me know if that helps? (Should also fix the crash you reported in #424)
With the specific sides set, the drones do now dig, import, export, and etc. form inventories.
However, I'm having some issues getting them to drop items again.
drone = peripheral.wrap("right")
drone.addArea(3889,65,-14341)
drone.setSide("up", true)
drone.setAction("inventoryImport")
--wait until the drone finishes
drone.clearArea()
drone.addArea(3891,66,-14343) --nearby in open air
drone.setAction("dropItem")
The drone is successfully collecting the items, but is ignoring the drop request.
Does dropping items have a requirement similar to the side requirement that world interactions have?
Edit:
Doing some testing with the new version- the crashes are fixed, but they have a similar unwillingness to entityExport
as they do to dropItem
Edit 2:
The interface can have drones drop items, but only as their first action. Once they do, they will refuse until the drone entity is broken and replaced. I haven't found a way around this yet. (Tried things such as standby, abortAction(), clearing everything I can, or exiting the piece, but nothing seemed to work)
I have found reproducible weirdness similar to the one mentioned above:
(Once it placed a block of cobblestone above the drone, but I could not reproduce this)
(using build 388)
https://www.youtube.com/watch?v=t181S7CuzIs&feature=youtu.be
Give build 389 a go. I fixed a bug where the drone's cached area set wasn't being cleared when calling "setArea", "addArea" or "removeArea". Tested working with this program:
drone = peripheral.wrap("right")
drone.addArea(896, 4, -1148)
drone.setSide("up", true)
drone.setAction("inventoryImport")
sleep(1)
drone.clearArea()
drone.addArea(900, 4, -1148)
drone.setAction("dropItem")
Note I needed to use the sleep(1)
there, otherwise the drone doesn't get a chance to import the item before its area is cleared. Don't think there's any way around this; timing issues due to the way Computercraft is running on a separate thread (the setAction()
doesn't happen instantly).