21 posts
Posted 29 December 2012 - 06:37 AM
Hello,
I'm having trouble with updating the GPS position of a computer, mounted on a quarry.
I've set up 4 GPS hosts, and "gps locate" is working fine.
However, after moving the quarry with frame motors, the command "gps locate" still tells me the old position.
I have tried fixing this by reloading the connected router:
rednet.close("right")
rednet.open("right")
I've also tried reloading the GPS API:
os.unloadAPI("rom/apis/gps")
os.loadAPI("rom/apis/gps")
but no luck :/
The only way I can fix it, is by restarting the computer. After doing so, the coordinates are updated again.
But restarting the computer over and over again is not an option.
Any suggestions?
-Fallout
8543 posts
Posted 29 December 2012 - 06:45 AM
You could try using a turtle. If just switching it out doesn't work, you may have to set it up to allow the turtle to move independently from the rest of the system and have the turtle move itself. I would imagine that computers' locations are cached somewhere on startup, causing the behavior you are experiencing.
21 posts
Posted 29 December 2012 - 06:51 AM
I'm not requesting the GPS location at startup, I'm manually using the "gps locate" command on the screen instead of "gps.locate()" in a program.
(I use the regular command for easy debugging now, but "gps.locate()" in a program is also not working after the quary moved)
I don't want to request the position just once at the startup, but constantly after each movement.
This, because the quarry sometimes doesn't move, like when it got stuck agains a wall or something else.
Using a turtle is also not a solution for me because then I still can't detect when the quarry got stuck.
Thank you for your reply ;)
2447 posts
Posted 29 December 2012 - 07:16 AM
Why wouldn't a turtle work? It would basically be a computer with an inbuilt modem.
I'll look into fixing this though - modems when placed obviously have no expectation that they'd move!
8543 posts
Posted 29 December 2012 - 07:38 AM
I'm not requesting the GPS location at startup, I'm manually using the "gps locate" command on the screen instead of "gps.locate()" in a program.
(I use the regular command for easy debugging now, but "gps.locate()" in a program is also not working after the quary moved)
I don't want to request the position just once at the startup, but constantly after each movement.
This, because the quarry sometimes doesn't move, like when it got stuck agains a wall or something else.
Using a turtle is also not a solution for me because then I still can't detect when the quarry got stuck.
Thank you for your reply ;)/>
Looks like Cloudy may be looking into fixing this for future versions, but you clearly did not understand what I said. I suggested using a turtle due to the (apparent) fact that
ComputerCraft itself is caching the location of the computer when it boots, and using that location every time for all rednet interactions. Using a turtle might be a workaround for that fact, since the mod shouldn't be caching the turtle's location. You could switch out the computer for a turtle (if this is the case, which I strongly suspect) with
no side effects; it would simply start getting the location correct
each time you request it.
I fully understood your request and provided a nearly-certain-to-work solution, so rejecting it outright without testing it is certainly not appreciated. I apologize if this reply seems to be in a harsh tone, but it seems like you didn't even bother thinking about what I was saying before rejecting the solution.
21 posts
Posted 29 December 2012 - 07:40 AM
modems when placed obviously have no expectation that they'd move!
Well yes, that's probably the cause of this bug, but it's understandable ofcourse :)
And I can't start using a turtle because for some reason, all my turtles always disappear after their chunk got unloaded
(like when I go to the neter, and come back, or when I walk a long distance and come back again)
8543 posts
Posted 29 December 2012 - 07:41 AM
Are you using ComputerCraft 1.33? That has been fixed in newer versions.
21 posts
Posted 29 December 2012 - 07:46 AM
Looks like Cloudy may be looking into fixing this for future versions, but you clearly did not understand what I said. I suggested using a turtle due to the (apparent) fact that ComputerCraft itself is caching the location of the computer when it boots, and using that location every time for all rednet interactions. Using a turtle might be a workaround for that fact, since the mod shouldn't be caching the turtle's location. You could switch out the computer for a turtle (if this is the case, which I strongly suspect) with no side effects; it would simply start getting the location correct each time you request it.
I fully understood your request and provided a nearly-certain-to-work solution, so rejecting it outright without testing it is certainly not appreciated. I apologize if this reply seems to be in a harsh tone, but it seems like you didn't even bother thinking about what I was saying before rejecting the solution.
I'm really sorry if it looked like that. I didn't think about trying out the turtle, because you said:
"you may have to set it up to allow the turtle to move independently from the rest of the system and have the turtle move itself.".
Manually moving the turtle would not give me information about the quarry being stuck somewhere.
However, if I attach the turtle to the quarrie's frames, then this solution will probably work.
Can I also attatch bundled cables to a turtle? because you said I can fully replace the computer with a turtle.
I couldn't log in to minecraft to test this, but now I finally could, so this question is solvedEDIT:
I'm not sure about the version, but it's very possible that the server where I'm playing on, is using an older version.
Does Tekkit include the newest version or do they also use 1.33?
8543 posts
Posted 29 December 2012 - 07:58 AM
Yep, you can use bundled cables with the turtles as well! If you just swap out the computer and modem for a wireless turtle, everything should work fine.
Keep in mind that the turtle's modem is on the right side, which may cause you to need to change the side outputs in your program and rotate the turtle to a different direction than the computer faced. This is because rednet can also output to bundled cables, not just modems. I don't think it will be an issue, but I don't have the rednet API in front of me, so I can't confirm that.
The only other potential issue you might run into would be the disappearing turtle problem, but if I recall correctly, that was an issue with turtles moving into unloaded chunks, so I don't know if that will affect a turtle being moved by a frame.
21 posts
Posted 29 December 2012 - 08:01 AM
Oh that's good news! I'll try it with the turtle now, and hope that it doesn't disappear.
And the modem position is not a problem for me since it was also on the right side of my computer ;)
I tested bundled cables on a turtle in single player now and that's indeed also not a problem.
I'm really happy that you are trying to help me out with this! Thanks a lot
8543 posts
Posted 29 December 2012 - 08:18 AM
Tekkit does indeed use 1.33, which is a little ancient at this point. Let us know if using a turtle there instead fixes the problem!
21 posts
Posted 29 December 2012 - 08:25 AM
It seems that as soon as the frame moves, with the turtle attached, my client instantly crashes.
I've tested it multiple times, and I always crash :(/>
8543 posts
Posted 29 December 2012 - 08:39 AM
Well, damn. Seems you'd need a newer version, or another, more complicated workaround. Something like the turtle checking the block below it after the frame moves (without the turtle attached) and moving to the correct position within the frame again. This way, the turtle can know whether or not the frame successfully moved. This method works well for frames that move on up to two axes. A three-axis frame is much more difficult.
Of course, there is always the option to update, but that obviously means your server would have to as well (which they may not be willing to do).
21 posts
Posted 29 December 2012 - 08:45 AM
It's a three axis frame.
So the problem with turtles+frames crashing is also fixed in the next update?
The owners of the server might want to update, but it's a Tekkit server.
Does that mean that it's impossible to get the computercraft 1.4 version? or is it still possible to just update it, even though Tekkit uses the older version?
8543 posts
Posted 29 December 2012 - 08:57 AM
I don't know what version exactly that bug is fixed in, though I believe they did fix it in 1.41. You could update to 1.41, but the server and every client would have to update. They may be interested in updating all the way to using Feed The Beast at some point (if it has all the mods, I'm not really sure whether it does or not), since it uses 1.4.5 or 1.4.6 version of Minecraft. Not really sure what you could do to fix it at this point, aside from re-designing the inside of your frame so the turtle can move independently.
2447 posts
Posted 29 December 2012 - 09:01 AM
That crash was indeed fixed ages ago - even in a bukkit port release. It is so annoying when things are fixed and people don't update timely.
21 posts
Posted 29 December 2012 - 09:14 AM
I will ask the server owner about this.
2005 posts
Posted 29 December 2012 - 05:04 PM
Um…why can't you just reboot the computer? I mean, I know that we usually suggest just using a loop when we see someone rebooting their computer over and over, but it isn't like rebooting a computer over and over isn't a possibility. So you must have some special circumstances. Exactly what are they?
21 posts
Posted 29 December 2012 - 10:56 PM
I thought rebooting over and over would create too much lag on the server, since I want to check the position after Every movement; meaning like each 2 seconds.
And also, it would be sad that the computer would jump out of it's current loops when it reboots.
For example, if it needs to move 10 blocks on the X axis, then I have simply a loop that loops 10 times.
However, if it has to reboot after each movement, then that loop's position will be forgotten, and then "using a loop" is totally useless.
It would just complicate things too much.
2005 posts
Posted 30 December 2012 - 12:15 AM
Rebooting once every two seconds isn't too often, not even close to too often.
Making a computer remember what stage of execution it's supposed to be at is trickier. But it can be done. And while I do encourage servers being updated to the latest version of CC possible…well, I do encourage that.
21 posts
Posted 30 December 2012 - 12:24 AM
I'll go for updating the version :P/> That'll be a lot easier. I'll tell you guys if it works then ;)/>
(still couldn't contact the owner)