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

[vJASS] PreloadFiles

Status
Not open for further replies.
Level 8
Joined
Sep 7, 2008
Messages
320
JASS:
call PreloadGenStart()
call PreloadGenClear()
call Preload( codes )  //")
call PreloadGenEnd("DataManager\\" + name +"-" + class + ".txt")

// codes = save code
// name = player name
// class = class of hero

Here's my code but i dont know how to save it to txt file correctly :vw_wtf: or take string code from txt files :vw_death:

Anyone can help me this :thumbs_up:
 
Level 13
Joined
Sep 13, 2010
Messages
550
What you want it to do?

If I am right you need this:
JASS:
call PreloadGenStart()
call PreloadGenClear()
call Preload( "\" )
call SetPlayerName( Player( 15 ) , \"" + codes + "\" )  //")
call PreloadGenEnd("DataManager\\" + name +"-" + class + ".txt")
then
JASS:
call Preloader( "DataManager\\" + name +"-" + class + ".txt" )
// Use GetPlayerName( Player( 15 ) ) to get your "codes"
But WARNING!, usually "DataManager\\" + name +"-" + class + ".txt" will be local and other players won't have this value( problem only in multiplayer ). So before decoding and execute its data you would have to convert it into integer then synchronize it. After all players will have that value, you can start loading process

Also you can't make warcraft open the file if you don't have local files enabled( this can be easily checked with a short code )
 
Level 8
Joined
Sep 7, 2008
Messages
320
1.I alway wonder how ppl can get code from this file :vw_wtf: Even it havent any action.
JASS:
function PreloadFiles takes nothing returns nothing
	call Preload( "

Name: Spartipilo
Class: Arcanist
Level: 16
Exp: 3963
Gold: 1838

Password:
COAaI-eI0rn-7IzUL-YrvSU-LgwII-4ASYC-uDCYD-swflU-kC8IP-Zrx5n-DVDVR-NSxrW-zzWzA-0dfGH-PUosc-VLqox...

Note: Ignore the text about Preloading, that is normal.
" )
	call PreloadEnd( 0.0 )
endfunction

2. In multi player, player A got A' file, how could player B get value from A' file ?
 
Level 13
Joined
Sep 13, 2010
Messages
550
1.I alway wonder how ppl can get code from this file :vw_wtf: Even it havent any action.
JASS:
function PreloadFiles takes nothing returns nothing
    call Preload( "

Name: Spartipilo
Class: Arcanist
Level: 16
Exp: 3963
Gold: 1838

Password:
COAaI-eI0rn-7IzUL-YrvSU-LgwII-4ASYC-uDCYD-swflU-kC8IP-Zrx5n-DVDVR-NSxrW-zzWzA-0dfGH-PUosc-VLqox...

Note: Ignore the text about Preloading, that is normal.
" )
    call PreloadEnd( 0.0 )
endfunction
2. In multi player, player A got A' file, how could player B get value from A' file ?

1. Nohow... or just I don't know how to do. Only way I know is with SetPlayerName or SetPlayerTechMaxAllowed( I personally prefer SetPlayerName ). You can make a file dump like that, but you won't be able to load it. Users usually open that txt, copy it's content, then paste it into wc3

2. Convert the code into integer( maybe if you are lucky enough string won't cause desync ), then synchronize it with gamecaches.
I have a beta( mostly working ) synchronization library. If you need I will share it with you.

3. Umm if you want to use Preloader then generate preload file like this way:

JASS:
call PreloadGenStart()
call PreloadGenClear()
call Preload( "\" )
call SetPlayerName( Player( 15 ) , \"" + codes + "\" )  //")
call Preload( "\" )
endfunction
function Speedup takes nothing returns nothing //")
call PreloadGenEnd("DataManager\\" + name +"-" + class + ".txt")
If you put endfunction into script it will be 10 times faster.
 
Status
Not open for further replies.
Top