My blend is going on a school LAN soon . The exe will be placed on the hard drive of each machine. When students log off any save files on the machine they’re working on are deleted. Any saved files generated by the exe need to be sent to the school server drive (I thinks it’s called s:\ drive) I’m looking for a way to do the following:
Controlling where the output file is sent (most save scripts I’ve seen put the save file where the exe is - not good as they’ll be deleted and some students would find them and do unmentionable things). I want to select the correct drive and folder path to put my save files in while the exe is running.
Even more useful would be a way to create a new windows folder in a specific directory destination on a specific hard drive from within Blender and then put the save file in there. (Would I have to import a new python module to do this to get the right functions?)
I know that NorJ has done something along these lines and I must admit that i havn’t looked into what he’s done yet.
It should work fine if you just use the full path for the file. If you check out one of those save scripts, it should have something like:
f = open(“save.txt”,w)
where “save.txt” is the name of the save file. To change this to put the file on the s drive, just change it like so:
f = open(“s:/save.txt”,w)
Note that its s:/ and not s:\
Make sure you change both the save and load scripts to point to the correct file.
I should have emphasised that I want Blender to create the folder that the save file goes in. I have a name input field where the keystrokes are logged into a property called ‘student_name’. I take the student name and add it to the GameLogic module:
GameLogic.student_name = own.student_name
What python function could I then use to create a folder on s:/ based on the student name that is inputed by the student at the start of the blend? (I suspect I need to import another module into Blender?)
(I want to use this approach so that I can then use another peice of python based software that reads the contents of the folder).