• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Creating Folder For Save Codes

Status
Not open for further replies.
Level 3
Joined
Sep 8, 2013
Messages
21
Please Help me I want to do if someone write -save create folder by name safsafa.txt and in this txt file says writer's save code helpp
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Generate the savecode by using any saveload system (for example this: http://www.wc3c.net/showthread.php?t=87360) and then call this function:

JASS:
function WriteFile takes string filename, string savecode returns nothing
	set savecode = "\r\n\r\n
Code: "+savecode+"\r\n\r\n"
	call PreloadGenClear()
	call PreloadGenStart()
	call Preload("\")
	"+savecode+"
	(\"")
	call PreloadGenEnd(filename)
endfunction

Example:
call WriteFile("\\Savecode\\code.txt", "QWERT-ZUIOP-ASDFG-HJKLY-XCVBN")
 
Last edited:
Level 3
Joined
Sep 8, 2013
Messages
21
i dont understand if i write -save in game the folder is creating already ? (sory my bad english )
it gives this error expected returns
function WriteFile takes string filename string savecode returns nothing
 
Last edited:
Level 14
Joined
Jun 27, 2008
Messages
1,325
well it has to be "function WriteFile takes string filename, string savecode returns nothing"

This function only creates the folder and the textfile, to generate the savecode you will have to use a SaveLoad system (either the one i linked or some other one). Use the search function.

And posting your questions here should suffice, no need to write me a pm and a visitor message.
 
Status
Not open for further replies.
Top