• 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.

File Save

Status
Not open for further replies.
Level 13
Joined
Sep 13, 2010
Messages
550
To save a file locally is:
JASS:
call PreloadGenStart( )
call PreloadGenClear( )
call Preload( "\" )
call SetPlayerName( Player( 15 ) , \"" + YOURVALUECONVERTEDTOSTRING + "\" ) //")
call PreloadGenEnd( "Somedir\\Somefilename.Someextension" )
To load that value: call Preloader( "Somedir\\Somefilename.Someextension" ). Now you have it as the Player( 15 )'s name and you can get it with GetPlayerName( Player( 15 ) ). You can save integers with SetPlayerTechMaxAllowed but I don't rely on that method.

This is far not hard as the things come then: You have to make a full file structure for more character support and because warcraft only has 16 players so that is the max amount of string that can be saved into a single file. Or you have to make big strings like a common save system. So make some encryption and other things here. Also you have to synchronize the values you load cause other players likely won't have the files. Thats the harder thing. So good luck with it.
 
Status
Not open for further replies.
Top