• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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