• 🏆 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!

[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