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

[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