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

[General] SaveToDisk

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
I've seen this in multiple save-load systems, specifically in CodeGen (spell section).

JASS:
function SaveToDisk takes string msg, string filename returns nothing
    call PreloadGenClear()
    call PreloadGenStart()
    call Preload(msg)
    call PreloadGenEnd(filename)
    call ClearSelection()
endfunction

Isn't preloading for preloading? Then how can I create a text file with preloading? How can I use it?
 
Level 11
Joined
Dec 19, 2012
Messages
411
It is correct, just that you will end up with creating 1 text line only, you would need multiple Preload() for creating more lines.

Oh and for the PreloadGenEnd(), the input should be file path+file name+file extesion type instead of file name only, else your file will just end up creating at war3 folder.
 

Ardenian

A

Ardenian

So
JASS:
call Preload(msg1)
call Preload(msg2)
call Preload(msg3)
would create three lines ?
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
It is correct, just that you will end up with creating 1 text line only, you would need multiple Preload() for creating more lines.

Oh and for the PreloadGenEnd(), the input should be file path+file name+file extesion type instead of file name only, else your file will just end up creating at war3 folder.

Yes, the filename string will have it all. Thanks so much!

So
JASS:
call Preload(msg1)
call Preload(msg2)
call Preload(msg3)
would create three lines ?

Yes.
 
Status
Not open for further replies.
Top