AceHart
Your Friendly Neighborhood Admin
- Reaction score
- 1,497
That's because no one ever reads the "How to import" chapter in post #1 here...
Warcraft 3 has very limited processing power.
The characters being displayed aren't the problem. It's the calculator being used. At one point, the numbers go beyond the maximum, the loops go beyond the maximum, etc. In truth, it wouldn't crash warcraft 3, but Blizzard supports stability, so in order to stop something that might prove a tiny bit unstable, Warcraft 3 just stops processing the commands all together. This is why your save/load codes won't appear.
Now, what Acehart said was a good idea if you are trying to get around the calculator issue, however.. you need to give the processor a break. It's like running thru 5000 loops. Do you think warcraft 3 will actually run thru all 5000???
Probably not... unless you pause it at some point and give it a break.
What I suggest:
Save portion by portion, maybe even show what's being saved and the %. Store all of the information. When your done saving one chunk, pause, then start the next chunk. When it's all saved, show the code to the player. That will work.
For example:
Now Saving Heroes
Now Saving Items
Now Saving Gold and Lumber
As long as you have MPI (multi-player instance), it should work fine.
You can't go beyond the processing power of what you are using ; )
hope this helps
SaveLoad Initialization
Events
Map initialization
Conditions
Actions
-------- List of Scores --------
Set PlayerScore[1] = 0
Set PlayerScore[2] = 0
Set PlayerScore[3] = 0
Set PlayerScore[4] = 0
Set PlayerScore[5] = 0
Set PlayerScore[6] = 0
Set PlayerScore[7] = 0
Set PlayerScore[8] = 0
Set PlayerScore[9] = 0
Set PlayerScore[10] = 0
Set PlayerScore[11] = 0
Set PlayerScore[12] = 0
-------- Number of PlayersScores --------
Set SaveLoad_LastIndex = 12
-------- These three lines may be changed if needed --------
Set Saveload_Alphabet = abcdefghijklmnopqrstuvwxyz1234567890?!@$%^&*()<>[]
Set SaveLoad_CaseSensitive = False
Set SaveLoad_UsePlayerName = True
-------- Required: false --------
Set SaveLoad_Initialized = False
-------- Leave as is. Used to autocreate variables when copy & pasting to a new map --------
Set Code = AceHart
Set Save[1] = 0
Set SaveCount = 1
Set Validate = False
Set SaveLoad_Compress[1] = 0
Set SaveLoad_Uncompress[1] = 0
SaveLoad Save
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Conditions
Actions
-------- Those values need saving --------
Set Save[1] = PlayerScore[1]
Set Save[2] = PlayerScore[2]
Set Save[3] = PlayerScore[3]
Set Save[4] = PlayerScore[4]
Set Save[5] = PlayerScore[5]
Set Save[6] = PlayerScore[6]
Set Save[7] = PlayerScore[7]
Set Save[8] = PlayerScore[8]
Set Save[9] = PlayerScore[9]
Set Save[10] = PlayerScore[10]
Set Save[11] = PlayerScore[11]
Set Save[12] = PlayerScore[12]
-------- The number of values we have --------
Set SaveCount = 12
-------- Turn values into code --------
Custom script: set udg_Code = SaveLoad_Encode()
-------- Show code to player --------
Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
Game - Display to (Player group((Triggering player))) for 900.00 seconds the text: Code
Game - Display to (Player group((Triggering player))) for 900.00 seconds the text: Tip: Write down or ...
SaveLoad Load
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Player - Player 2 (Blue) types a chat message containing -load as A substring
Player - Player 3 (Teal) types a chat message containing -load as A substring
Player - Player 4 (Purple) types a chat message containing -load as A substring
Conditions
(Substring((Entered chat string), 1, 6)) Equal to (Matched chat string)
(Length of (Entered chat string)) Greater than 6
Actions
-------- Try to decode what was typed --------
Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
Custom script: set udg_Validate = SaveLoad_Decode( udg_Code )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Validate Equal to True
Then - Actions
-------- It worked, let's do something with it --------
For each (Integer A) from 1 to SaveCount, do (Actions)
Loop - Actions
Game - Display to (Player group((Triggering player))) the text: (Decode: + (String(Save[(Integer A)])))
Else - Actions
-------- Invalid code --------
Game - Display to (Player group((Triggering player))) the text: Invalid Code
exitwhen i > udg_SaveLoad_Heroes_LastIndex
endif
endif
local integer i = 0
set i = i + 1
Actions
-------- Prepare the save array with this player's Hero --------
Set SaveCount = 0
Set SaveCount = (SaveCount + 1)
Set Save[SaveCount] = PlayerXPshow[(Player number of (Triggering player))]
-------- Turn values into code --------
Custom script: set udg_Code = SaveLoad_Encode()
-------- Show code to player --------
Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
Actions:
-------- Try to decode what was typed --------
Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
Custom script: set udg_Validate = SaveLoad_Decode( udg_Code )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Validate Equal to False
Then - Actions
-------- Invalid code --------
Game - Display to (Player group((Triggering player))) the text: There's some error ...
Skip remaining actions
Else - Actions
-------- It worked, let's do something with it --------
-------- Load EXP --------
Set SaveCount = 0
Set SaveCount = (SaveCount + 1)
Set PlayerXPshow[(Player number of (Triggering player))] = Save[SaveCount]
For Each Integer A from 1-100 do Actions:
Set Save [Integer A] to Ability [Integer A]
Set Save [Integer A + 100] to Level of Ability [Integer A]