saving game scene??

Does anybody know of a way to save a game scene?

I’m making a walkthrough interior in which you can add and position some furniture. The purpose is that the client designs his own interior while playing my game. I’d like to make it possible to save certain scenes from within the executable runtime (either as a .exe (so he can still change it later-on) or as a still frame (.jpg or so).

thx :o

a picture?

or the locations of those objects?

in python, Rasterizer.makeScreenshot(path) will take a picture
in blender it uses the type selected in the render buttons, in the runtime it uses tga [if it works]

to save positions of game objects you need to use the standard python file io methods, then just get the objects [a near sensor] and set them back when you load

to save positions of game objects you need to use the standard python file io methods, then just get the objects [a near sensor] and set them back when you load

Could you please explain this a bit more elaborate?

in python, Rasterizer.makeScreenshot(path) will take a picture

Do you know of a working example of this “screenshot-script”?

## saving
import GameLogic
cont = GameLogic.getCurrentController()
ns = cont.getSensor("near")
f = open("somefile.txt","w")
for obj in ns.getHitObjectList():
	print obj.getName()
	f.write("%s"%(obj.getName()) )
	f.write(" %f %f %f
"%tuple(obj.getPosition()))
f.close()
## loading
import GameLogic
cont = GameLogic.getCurrentController()
ns = cont.getSensor("near")
f = open("somefile.txt","r")
line = f.readline()
locations = {}
while line:
	lp = line.split()
	nme = lp[0]
	loc = map(float,lp[1:4])
	locations[nme] = loc
	line = f.readline()
for obj in ns.getHitObjectList():
	if locations.has_key(obj.getName()):
		obj.setPosition(locations[obj.getName()])
		print obj.getName()
f.close()




[quote="jesar"]

> in python, Rasterizer.makeScreenshot(path) will take a picture

Do you know of a working example of this "screenshot-script"?
[/quote]

https://blenderartists.org/forum/viewtopic.php?p=151256#151256
http://home.earthlink.net/~nwinters99/BlenderStuff/saveAnim.blend

these questions have been asked before... but I didn't have a save/load script handy