script to write objects position works but not apply positio

help %|

i made a script to write objects positions.(it works)
But the script to apply there positions dos not work.
here is the save script(it works)

import GameLogic

#Change the file/path name!(e.g c:\Programfiler\3D\JONAS\SAVES\save.sv)
FILE=’/Programfiler/3D/JONAS/SAVES/save.sv’

f = open(FILE,‘a’,8192) # opening for appending

cont = GameLogic.getCurrentController()
owner = cont.getOwner()

#Get position
pos = owner.getPosition()

f.write(owner.getName()[2:]+" "+str(pos[0])+’’
‘’+str(pos[1])+’’ "+str(pos[2])+’’
")

f.close()

here is the load script(do not work)

import Blender

#Change the file/path name!(e.g c:\Programfiler\3D\JONAS\SAVES\save.sv)
FILE=’/Programfiler/3D/JONAS/SAVES/save.sv’
f = open(FILE,‘r’,8192) # opening for appending

lines = f.readlines()

for line in lines:
words=line.split(’ ')[:-1]
obj=Blender.Object.Get(words[0])
obj.LocX=float(words[1])
obj.LocY=float(words[2])
obj.LocZ=float(words[3])

Blender.Redraw()

blender publisher 225
HELP!!! %|


lines=['Plane 0.0 1.0 2.0 
']
for line in lines:
     words=line.split(' ')[:-1]
     obj=Blender.Object.Get(words[0])
     obj.LocX=float(words[1])
     obj.LocY=float(words[2])
     obj.LocZ=float(words[3])
Blender.Redraw() 

Tested in publisher2.25… no problem.

i mean so i can save there positions and load it later in real-time

Sorry, not in real-time…

THX enyway :smiley:

To do these modifications in realtime mode,
you have to use the gamelogic module too
but I believe that you can not read and
write file with this module because, for
security reasons, it is “sandboxed”.

I have blender gamekitt and i am learning fast.

if you can help i be glad :smiley: