This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Error saving to program
Started by EpicMCEngineer12, 28 January 2013 - 07:06 AMPosted 28 January 2013 - 08:06 AM
I got a very long program. Over 130 lines. And it seems like it does not want to let me save when it is too long. Whenever I try to save it says 'Error saving to movement' The program is saved on the turtle. This only happens on this program and none else. Any idea why I cannot save?
Posted 28 January 2013 - 08:25 AM
Please provide us with some code, maybe we can see if it is a syntax error or something else.
Posted 28 January 2013 - 08:42 AM
I don't see how a syntax error could cause that :P/> it isn't even interpreted as lua code yet…Please provide us with some code, maybe we can see if it is a syntax error or something else.
I've never seen that a file couldn't be saved because of the content, but you never know so posting the code could be an idea anyway.
But what's even more important is what you're exactly doing. Did you do "edit movement" ? Can you save a file like "foobar"? Are you sure that you're in the root directory when editing the file?
Posted 28 January 2013 - 08:42 AM
I am pretty sure it is not in the code. The file itself does not want to save. But here you go(I am completly aware this is unreadable)
function faceDir(dir)
if dir-f == 3 then
turtle.turnLeft()
elseif f-dir == 3 then
turtle.turnRight()
elseif f-dir == 2 or dir-f == 2 then
turtle.turnLeft()
turtle.turnleft()
elseif f-dir == 1 then
turtle.turnLeft()
elseif dir-f == 1 then
turtle.turnRight()
end
f = dir
end
function move(ax,v)
if ax == "x" then
if v then
faceDir(3)
else
faceDir(1)
end
elseif ax == "z" then
if v then
faceDir(0)
else
faceDir(2)
end
end
while not turtle.forward() do
sleep(0.1)
end
end
local bool = false
local num = 0
if tx > x then
bool = true
num = tx - x
else
bool = false
num = x - tx
end
function setPriorities(x,z)
straight = nil
xWay,ixWay = nil,nil
zWay,izWay = nil,nil
back = nil
if x > tx then
xWay = 1
ixWay = 3
elseif x < tx then
xWay = 3
ixWay = 1
end
if z > tz then
zWay = 2
izWay = 0
elseif z < tz then
zWay = 0
izWay = 2
end
if xWay == nil then
straight = zWay
back = izWay
elseif zWay == nil then
straight = xWay
back = ixWay
end
return straight,xway,zway,back
end
function plan()
local occupied = false
local testX,testZ = x,z
local testFace = 3
– Priority: Straight,Left,Right,Back
local f1,f2,f3,f4 = setPriorities(testX,testZ)
if f1 ~= nil then
testFace = f1
else
testFace = f2
end
while not testX == tx or not testZ == tz do
if testFace == 0 then
testZ = testZ +1
elseif testFace == 1 then
testX = testX -1
elseif testFace == 2 then
testZ = testZ -1
else
testX = testX + 1
tx,ty,tz = tonumber(tArgs[1]),tonumber(tArgs[2]),tonumber(tArgs[3])
local f = 0
local path = {}
print(x)
print(y)
print(z)
function faceDir(dir)
if dir-f == 3 then
turtle.turnLeft()
elseif f-dir == 3 then
turtle.turnRight()
elseif f-dir == 2 or dir-f == 2 then
turtle.turnLeft()
turtle.turnleft()
elseif f-dir == 1 then
turtle.turnLeft()
elseif dir-f == 1 then
turtle.turnRight()
end
f = dir
end
function move(ax,v)
if ax == "x" then
if v then
faceDir(3)
else
faceDir(1)
end
elseif ax == "z" then
if v then
faceDir(0)
else
faceDir(2)
end
end
while not turtle.forward() do
sleep(0.1)
end
end
local bool = false
local num = 0
if tx > x then
bool = true
num = tx - x
else
bool = false
num = x - tx
end
function setPriorities(x,z)
straight = nil
xWay,ixWay = nil,nil
zWay,izWay = nil,nil
back = nil
if x > tx then
xWay = 1
ixWay = 3
elseif x < tx then
xWay = 3
ixWay = 1
end
if z > tz then
zWay = 2
izWay = 0
elseif z < tz then
zWay = 0
izWay = 2
end
if xWay == nil then
straight = zWay
back = izWay
elseif zWay == nil then
straight = xWay
back = ixWay
end
return straight,xway,zway,back
end
function plan()
local occupied = false
local testX,testZ = x,z
local testFace = 3
– Priority: Straight,Left,Right,Back
local f1,f2,f3,f4 = setPriorities(testX,testZ)
if f1 ~= nil then
testFace = f1
else
testFace = f2
end
while not testX == tx or not testZ == tz do
if testFace == 0 then
testZ = testZ +1
elseif testFace == 1 then
testX = testX -1
elseif testFace == 2 then
testZ = testZ -1
else
testX = testX + 1
Edited on 28 January 2013 - 07:45 AM
Posted 28 January 2013 - 08:46 AM
Yes I am in the main Directory. I can save all other short files. But this very long one does not want to get saved. It just errors.I don't see how a syntax error could cause that :P/> it isn't even interpreted as lua code yet…Please provide us with some code, maybe we can see if it is a syntax error or something else.
I've never seen that a file couldn't be saved because of the content, but you never know so posting the code could be an idea anyway.
But what's even more important is what you're exactly doing. Did you do "edit movement" ? Can you save a file like "foobar"? Are you sure that you're in the root directory when editing the file?
Posted 28 January 2013 - 09:19 AM
Ehm, I can't imagine this to be true… But maybe the server's filesystem is full? That's like completely impossible but yeh. :P/> Same goes for the filesystem of the turtle, but that's also nearly impossible.
Posted 28 January 2013 - 05:29 PM
I take it that movement is the name of the file?
If some other process on the server has access to the file at the same time, then this error occurs. It could simply be that someone who has access to the server is looking over your file in notepad.
Try copying the file to a new name. If that works, then you know the turtle/server isn't full. Then see if you can edit the new file.
If some other process on the server has access to the file at the same time, then this error occurs. It could simply be that someone who has access to the server is looking over your file in notepad.
Try copying the file to a new name. If that works, then you know the turtle/server isn't full. Then see if you can edit the new file.
Posted 28 January 2013 - 09:53 PM
I am not on a server. I am on singleplayer. Renaming the file does not work.I take it that movement is the name of the file?
If some other process on the server has access to the file at the same time, then this error occurs. It could simply be that someone who has access to the server is looking over your file in notepad.
Try copying the file to a new name. If that works, then you know the turtle/server isn't full. Then see if you can edit the new file.
Posted 28 January 2013 - 10:23 PM
Do you mean that you can't copy the file, or that after copying it you couldn't edit the copy?
If you're on single-player, it could still be a process on your computer preventing write access to the file or the entire folder (I believe that several explorer programs can cause this).
You should check to make sure that the computer folder isn't overfull (there is a limit in kilobytes, which I do not recall off the top of my head), then make sure that you don't have any programs open which would be using those files, other than Minecraft itself (I know that some editors can be used without excluding access to the files by CC, but you would be well served by eliminating them as suspects, at least). Your file explorers particularly shouldn't be open to anything in the minecraft folder, many file explorers access all the files in a folder to get statistics/thumbnail information from them.
If you're on single-player, it could still be a process on your computer preventing write access to the file or the entire folder (I believe that several explorer programs can cause this).
You should check to make sure that the computer folder isn't overfull (there is a limit in kilobytes, which I do not recall off the top of my head), then make sure that you don't have any programs open which would be using those files, other than Minecraft itself (I know that some editors can be used without excluding access to the files by CC, but you would be well served by eliminating them as suspects, at least). Your file explorers particularly shouldn't be open to anything in the minecraft folder, many file explorers access all the files in a folder to get statistics/thumbnail information from them.
Posted 28 January 2013 - 10:54 PM
I do have many programs in the world yes. So apparently there is a limit on how much you can have? But how do I increase this limit? I do not have a extreme amount of stuff…Do you mean that you can't copy the file, or that after copying it you couldn't edit the copy?
If you're on single-player, it could still be a process on your computer preventing write access to the file or the entire folder (I believe that several explorer programs can cause this).
You should check to make sure that the computer folder isn't overfull (there is a limit in kilobytes, which I do not recall off the top of my head), then make sure that you don't have any programs open which would be using those files, other than Minecraft itself (I know that some editors can be used without excluding access to the files by CC, but you would be well served by eliminating them as suspects, at least). Your file explorers particularly shouldn't be open to anything in the minecraft folder, many file explorers access all the files in a folder to get statistics/thumbnail information from them.
Posted 28 January 2013 - 11:15 PM
Well I think Orwell is talking about the limit per computer or turtle.
Posted 29 January 2013 - 01:02 AM
Well I need this whole program on one turtle.Well I think Orwell is talking about the limit per computer or turtle.
Posted 29 January 2013 - 06:03 PM
Yeah…I've run programs a bit longer than this, and seen programs ten times as long as that. So it isn't just the size of this one program (unless the config has already been edited to make storage space on computers very limited). If the turtle's folder is full, then that's something to check. There is a line in the config/mod_ComputerCraft.cfg that reads "computerSpaceLimit=2097152", and editing this should allow you to increase the allowed total size of files on the computer.
Posted 30 January 2013 - 04:28 AM
It seems like whenever I try to save ingame, the file just destroys parts of itself. The program just gets shorter and shorter.
Posted 30 January 2013 - 10:18 AM
That's pretty weird. Could you check the turtle's folder using a file explorer program and list all the files and their sizes, as well as the relevant config file line for allowed file sizes?
Posted 04 February 2013 - 05:14 AM
I seem to have the same problem. I am on a server with the ftb dw20 v5.0.1 pack.
I was editing a file, saving and running it, and then suddenly after a save the file was empty.
After that i was unable to save new files on any other computer…
WebRep
Overall rating
This site has no rating
(not enough votes)
I was editing a file, saving and running it, and then suddenly after a save the file was empty.
After that i was unable to save new files on any other computer…
WebRep
Overall rating
This site has no rating
(not enough votes)