• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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