- Joined
- Jun 26, 2020
- Messages
- 1,928
Question, can this save multiple heros at the time? I mean a group of heros each match.
(12 ratings)
What are you trying to do? Because your message is a bit confusing.spent nearly a days worth of time trying to get this working in a simple test environment. our intention is to use the -save/-load or rather the write/read to add a nice update an old old rpg. we're able to get the save working but can't (burning with pure frustration, hard to type rn) for goodness sakes cannot simply get the loaded code to spit out. Call Save/Call Load are trigs we were toiling in. trust me i know it looks like almost nothing was done and also trust me that tons of code was added/cut/commented/etc/etc/etc/etc/etc. needless to say dying trying to reinvent the wheel. someone anyone please help. many thanks in advance
read in the saved code as a string. Save is working. Dont need load to do anything more then read a saved code from the file that save is able to successfully create so we can access the saved code as a string.What are you trying to do? Because your message is a bit confusing.
read in the saved code as a string. Save is working. Dont need load to do anything more then read a saved code from the file that save is able to successfully create so we can access the saved code as a string.
Savecode.Save
and then is saved with the function SaveFile.create
I have understood the code is obtained with the function
Custom script: set udg_SaveTempInt = Savecode.create()
For each (Integer A) from 0 to SaveCount, do (Actions)
Loop - Actions
Custom script: call Savecode(udg_SaveTempInt).Encode(udg_SaveValue[bj_forLoopAIndex], udg_SaveMaxValue[bj_forLoopAIndex])
Set VariableSet SaveTempString = <Empty String>
Custom script: set udg_SaveTempString = Savecode(udg_SaveTempInt).Save(GetTriggerPlayer(), 1)
Custom script: call SaveFile.create(GetTriggerPlayer(), SaveHelper.GetUnitTitle(udg_SaveTempUnit), -1, udg_SaveTempString)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SaveShowCode Equal to True
Then - Actions
Custom script: set udg_SaveCodeColored = Savecode_colorize(udg_SaveTempString)
Game - Display to (All players) the text: SaveCodeColored
Else - Actions
Savecode.Save
and then is saved with the functionSaveFile.create
The main problem is you messed up a bit the configuration.We tried .save and it's returning something vastly different then what's in the save file. Please see sample and type -save and then -load to view the stored cored (you'll see a lengthy code [path- CustomMapData/CodelessDemo]). When using -load (which utilizes the .save method) we are receiving back "g%" not the code stored in the save file. Also thank you for your swift responses. Much appreciated.
private function LoadSaveSlot_OnLoad takes nothing returns nothing
local player p = GetTriggerPlayer()
local string prefix = BlzGetTriggerSyncPrefix()
local string data = BlzGetTriggerSyncData()
local User user = User[p]
call SaveHelper.SetUserLoading(user, false)
if (udg_SaveUseGUI) then
set udg_SaveLoadEvent_Code = data
set udg_SaveLoadEvent_Player = p
set udg_SaveLoadEvent = 1.
set udg_SaveLoadEvent = -1
endif
endfunction
The main problem is you messed up a bit the configuration.
...
My recommendation is redoing everything.
That'd be helpful! Messaged TriggerHappy themselves regarding a reduced/simplified library which doesn't include any code generation aspects rather simply just the read/write functionality with simple parameters to enable less experienced devs the ability to add codeless saving/loading into older maps that already have a code generation system in place (i.e. fldrName to save to, fileName to save file as, saveCode string to be saved, integer slot [optional param] for maps that would benefit from multiple save files).I was dealing with this system a lot, so maybe I could grant that tutorial.
Would a gui interface to the read/write be asking for too much? Currently the only option is a limited save/load in gui and the rest is vjass.I was dealing with this system a lot, so maybe I could grant that tutorial.
@PurpleHephalump , @uiuinpp you need to give the ability Aerial Shackles (Amls) 2 levels instead of 1. And set the Level 2 - Text - Tooltip - Normal to "!". Otherwise it wont work.
The Aerial Shackles ability needs 2 levels in order for the system to work.
This is because Aerial Shackles is used in generating the save/load code. The problem: Blizzard made level indices start at 0 in the recent patches, which messed up any existing code that was using 1 to represent 1 (0 now represents 1).
So now the code is attempting to reference level 2 of Aerial Shackles when the ability only has 1 level by default.
Edit: I think you also need to set the Tooltip for level 2 to: "!"
See attached picture!
yes, you understand correct, sorry for my confusing english.as i understand you want to save food but gold and lumber is not required to be saved ?
Did you enable JassHelper & vJass? It is disabled by default somehow lul, maybe this solves it for you.
View attachment 405381
This system saves/loads a file that is stored locally on your pc. You can find it at this directory:There are 2 players A and B. The question is: Is this still working if I first save from player A's computer but second time I save from player B's computer
It has no ties to your BNET account or anything like that but there's nothing stopping you from manually transferring the save file between computers. You could even edit/create copies of the file if you wanted to.C:\Users\Username\Documents\Warcraft III\CustomMapData
This. The aggressive caching introduced in this patch seems to have not helped anything at all. Don't know why they did this?After Patch 1.33, it now requires players to restart the game to save the next game, any way to fix that?
//x*BASE() must be less than MAXINT()
method MulSmall takes integer x returns nothing
x = 2^24
, BASE() = 89
and MAXINT() = 2,147,483,647 = 2^31 - 1
2^24 * 89 = 1,493,172,224 < 2,147,483,647
2^25 * 89 = 2,986,344,448 > 2,147,483,647
The second, probably it was made with the Jass New Gen tool and that is why it appears like that.this is confusing which one do i use for reforged? there are 2 versions. the one that was made in 2017 is recommended for patches up to 1.28 but the one that was made in 2019 supports patches till up to 1.21
In my tests it seems to lock you on to one name/account, if you change accounts it gives you this message. Fix is to change map file name and "refresh" everything.Do you save and load a lot in-game? Like hundreds of times? There is a leak in pipedreams savecode system, but you would only notice it after many saves or loads. If you have a replay of this bug it would help.
are you using any name change triggers with purple?I need help im using this system. I save 3 integer varriables normal win points, hard win points and impossible win points. It works fine in game except for one player slot purple. Whenever purple plays as character named eomer he will lose his victory points it will be set to 0 no matter what value it has been before. If purple plays as boromir issue doesnt occour. I never set varriables to 0. What can be reason of this issue, does it lie inside system? it was made long time ago before reforged
Yea so that would be itare you using any name change triggers with purple?
You could store the Player Names in a variable before changing it:Not sure a good way to deal with that.
This system should rely on player IDs as opposed to player names. I think player IDs are constant where as player named can be changed.
function GetPlayerNameFix takes player p returns string s
return udg_PlayerNameOriginal[GetConvertedPlayerId(p)]
endfunction
Not really, even of you have problems when you have a lot of values, its not impossible to overcome them.Is there a limit on how many variables we can use with that system?
What is someone wanted to save, umm.. maybe up to a hundred thousand variables? Would the save / load process be slow? Possible? Error prone?Not really, even of you have problems when you have a lot of values, its not impossible to overcome them.
If you do hundred thousand of any thing the process would be slow, and also if you write hundred thousand of lines of any code, is more prone to errors, I never tried to save that many values, I at most saved around 615 values and if I get an error, I just found it and solve it, but barely it has to do with the system itself, the errors were mine. The only issue the system would have is the length of the saved code, I think it saves by default at most 2000 characters, but that can be configured.What is someone wanted to save, umm.. maybe up to a hundred thousand variables? Would the save / load process be slow? Possible? Error prone?
How did u solve it?Hello, I'm having an issue with saving a max value, I wanna save a boolean list, and to converting it to an integer I have to use bits, so the max number I would save is 2^(max length of the list), I though that the max length of that list would be 24, because in the bignum library says:
WhereJASS://x*BASE() must be less than MAXINT() method MulSmall takes integer x returns nothing
x = 2^24
,BASE() = 89
andMAXINT() = 2,147,483,647 = 2^31 - 1
So2^24 * 89 = 1,493,172,224 < 2,147,483,647
And in case the length is 25:2^25 * 89 = 2,986,344,448 > 2,147,483,647
But for some reason the real max length is 18, because when I set 19, the system breaks, what's wrong?
Does this mean we can only save a single value or all values up to 262144?I don't know why, but we can't save a value bigger than 2^18 with this system while the biggest value should be iirc (2^31 - 1) / 76 (I think I asked on the threat of the original system, but none replied), what I said was about high amount of vales, not a high value.