Page 1 of 1

AutoSave.Script.txt error

Posted: 22 Feb 2012, 18:06
by w1lla
hi,

Code: Select all

#RequireContext CEditorPlugin

while(True) {
	sleep(60000);
	log("Saving File");
	declare Result = SaveMap("AutoSave", "AutoSave\\");// AutoSave after SaveMap is the Filename ;)	
}	
You need to alter the script as SaveChallenge doesn't work anymore with the latest update.

replace it with SaveMap and it will work.

With kind regards,

w1lla.

Re: AutoSave.Script.txt error

Posted: 03 Sep 2013, 02:10
by sterretje22
How can I change the folder destination
I would like to have
"My maps/Shootmania"

Re: AutoSave.Script.txt error

Posted: 05 Sep 2013, 16:22
by BK-ZD50
can we have in the autosave some values?
like this
{mapname}-{savedtime}-{envi}- a.s.o.

Re: AutoSave.Script.txt error

Posted: 05 Sep 2013, 16:38
by steeffeen
you will both need to change the script

the following is not tested! (i'm not at home)

for different folder change the second argument

Code: Select all

SaveMap("MyMapName", "Folder\\OtherFolder\\");
for different file name change the first argument

Code: Select all

SaveMap("MyMapName"^Now, "Autosave\\");
you can't determine the environment inside the script (closest thing would be adding TM/SM)
(the current time isn't the local daytime like that, it would need a bit more code to access to local time!
with "Now" it just represents how long the script is running)

my suggestion would be

Code: Select all

SaveMap(Map.MapInfo.Name"_"^Now, "Autosave\\");
this will save the map in the current name (so that you can properly distinguish between different autosaved maps) with a timestamp as prefix

example:
"MyMap_124124.Map.Gbx"

or if you want to autosave at the actual location of the map (if it has been saved already somewhere)

Code: Select all

SaveMap(Map.MapInfo.Name"_"^Now, Map.MapInfo.Path^"\\");
example:
"Storm/Royal/MyMap_124124.Map.Gbx"

Re: AutoSave.Script.txt error

Posted: 05 Sep 2013, 16:47
by sterretje22
Thx! :3
The change of the directory did word
I didn't knew it had to be a double back slash :p

Re: AutoSave.Script.txt error

Posted: 05 Sep 2013, 17:13
by steeffeen
yeah easy mistake ;)

\ is a special character and if you want to add a \ it needs another \ :D