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!
Hello. I was just wondering it it's possible to save my save code to a text file (just like in GoH and TKOK) while using AceHart's GUI-friendly Save/Load System? If it's possible could somebody please explain as simple as possible? Unfortunately, I can't understand JASS, I tried but I really can't, but I'm really desperate in making my RPG Map. I am begging for help. Thank you.
I know you said you didn't understand JASS, but you'll have to deal with this for a short moment.
This is what the code looks like:
JASS:
function CreateTextFile takes nothing returns nothing
local integer p = GetPlayerId(GetTriggerPlayer())+1
local string heroName = GetUnitName(udg_Hero)
local integer heroLevel = GetHeroLevel(udg_Hero)
call PreloadGenClear()
call PreloadGenStart()
// The line below creates the log
// Right now, this is:
// Hero: (hero name)
// Level: (hero level)
// Code: -load XXXX
call Preload("\r\n\t\t\t\tHero: " + heroName + "\r\n\t\t\t\t" + "Level: " + I2S(heroLevel) + "\t\t\r\n\t\t\t\t" + "Code: -load " + udg_NPS_Password + "\r\n\n\t\t ")
// The line below creates the file at the specified location
// Right now, this is:
// "Warcraft III\MapName\(hero name) - (hero level)"
call PreloadGenEnd("MapName\\" + heroName + " - " + I2S(heroLevel) + ".txt")
endfunction
Yes, it's JASS, but you don't have to modify that much.
First thing you need to do, is place it in the map's header.
You have to change the variable "udg_NPS_Password" to ""udg_Code" (I believe AceHart uses that variable for the message).
The variable "Hero[X]" stores the hero for player X (so Hero[1] contains the hero for Player 1).
Once you understand that, you're good to go.
Thank you so much! Im sorry if I posted in the wrong thread, I saw triggers and scripts so i thought this would by the right place. But, thank you so much, really.
Ah right, the system I did it for didn't have that problem because it used 2 variables (1 with color codes, 1 without), AceHart's system doesn't do that.
The code can be changed to this, then:
JASS:
function CreateTextFile takes string saveCode returns nothing
local integer p = GetPlayerId(GetTriggerPlayer())+1
local string heroName = GetUnitName(udg_TempUnit)
local integer heroLevel = GetHeroLevel(udg_TempUnit)
call PreloadGenClear()
call PreloadGenStart()
// The line below creates the log
// Right now, this is:
// Hero: (hero name)
// Level: (hero level)
// Code: -load XXXX
call Preload("\r\n\t\t\t\tHero: " + heroName + "\r\n\t\t\t\t" + "Level: " + I2S(heroLevel) + "\t\t\r\n\t\t\t\t" + "Code: -load " + saveCode + "\r\n\n\t\t ")
// The line below creates the file at the specified location
// Right now, this is:
// "Warcraft III\MapName\(hero name) - (hero level)"
call PreloadGenEnd("MapName\\" + heroName + " - " + I2S(heroLevel) + ".txt")
endfunction
"saveCode" shouldn't be changed here.
What you need to do now, is create the text-file before any color gets added.
In case you have JNGP, you can press CTRL + F (while still in the map's header) and find "return c".
Right above that, paste call CreateTextFile(c).
If you don't have JNGP, "return c" is the last action of the function "SaveLoad_EncodeValues" (so that CreateTextFile-call should be the second to last action).
Yeah, i thought it's okay because when I tried earlier (when it includes colour codes) it works. But, man, you're a life saver, i am really really really really thankful for this. I was starting to get depressed because of how limited are the things i can do.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.