AutoSave.Script.txt error

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

AutoSave.Script.txt error

Post 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.
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
sterretje22
Posts: 26
Joined: 19 Aug 2011, 23:27
Location: Ostend
Contact:

Re: AutoSave.Script.txt error

Post by sterretje22 »

How can I change the folder destination
I would like to have
"My maps/Shootmania"
BK-ZD50
Posts: 265
Joined: 25 Nov 2011, 18:55
Location: 29646 Bispingen

Re: AutoSave.Script.txt error

Post by BK-ZD50 »

can we have in the autosave some values?
like this
{mapname}-{savedtime}-{envi}- a.s.o.
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: AutoSave.Script.txt error

Post 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"
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    sterretje22
    Posts: 26
    Joined: 19 Aug 2011, 23:27
    Location: Ostend
    Contact:

    Re: AutoSave.Script.txt error

    Post by sterretje22 »

    Thx! :3
    The change of the directory did word
    I didn't knew it had to be a double back slash :p
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: AutoSave.Script.txt error

    Post by steeffeen »

    yeah easy mistake ;)

    \ is a special character and if you want to add a \ it needs another \ :D
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      Post Reply

      Return to “ManiaScript”

      Who is online

      Users browsing this forum: No registered users and 1 guest