m my save-load code doesnt work
Well, the main problem here is
my save load code is very limited, and it doesnt load
The limitations being, its either A-1 or 2-G lolz
And loading it doesnt work I've got no idea where I went wrong, and its probably too much to ask someone to help me figure this out, but hey someone may have alot of spare time, and just want to help me -.-
(This is copied off a tutorial)
Initilize Saveload
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
-------- -------- Need to load your number system in here, right now its 36 chars. -------- --------
-------- -------- Slot1=36 -------- --------
-------- -------- Slot2=1296 -------- --------
-------- -------- Slot2=1296 ---------------- --------
-------- -------- Slot3=46656 -------- --------
-------- -------- Slot4=1679616 -------- --------
-------- -------- Slot5=60466176 -------- --------
-------- -------- I like making 0 the actual 0 for the unencrypted system. makes it easier to track stuff later. -------- --------
Set SetLoadCharaterSet = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Set SaveLoadMaxCharacters = 36
-------- -------- Need to load your encryption system in here, right now its 5 sets. Load code will get broken if you use a '-' in the Number system -------- --------
Set SaveLoadEncryptionSet[1] = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
Set SaveLoadEncryptionSet[2] = GHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF
Set SaveLoadEncryptionSet[3] = ABCDEFPQRSTUVWXYZ012345GHIJKLMNO6789
Set SaveLoadEncryptionSet[4] = ASTUVWXYBCJKLMNOPQRZ01234DFEGHI56789
Set SaveLoadEncryptionSet[5] = HIJKLABCDEVWXYZ0123FGM4567NOPQRSTU89
-------- -------- Now time to populate the Number system. this loop will put the characters into an array which acts like a counting system from 0 till MaxChars -------- --------
For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
Loop - Actions
Set SaveLoadCharacterNumbers[((Integer A) - 1)] = (Substring(SetLoadCharaterSet, (Integer A), (Integer A)))
-------- -------- Size of Levels to be saved for herolevel -------- --------
Set SaveLoadSlotHeroLevel = 3
-------- -------- Load the Heroes into an array to make numbers out of them. -------- --------
Set SetSaveLoadHeroesStored[1] = Ice Lord
Set SetSaveLoadHeroesStored[2] = Saghi
Set MaxHeroesStored = 2
Set SaveLoadSlotsHero = 2
-------- -------- Load the Items into an array to make numbers out of them. --------' --------
Set SaveLoadItems[1] = Ring Of Exceptional Regeneration
Set SaveLoadItems[2] = Ring Of Life
Set SaveLoadItems[3] = Ring Of Regeneration
Set SaveLoadItems[4] = Ring Of Supreme Regeneration
Set SaveLoadItems[5] = Ring Of Ultimate Regeneration
Set SaveLoadItems[6] = Health Potion
Set SaveLoadItems[7] = Magic Potion
Set SaveLoadMaxItemsStored = 7
Set SaveLoadSlotsItem = 2
-------- -------- Need to setup slots for Gold and Lumber, 4 chars will cover up to 1.6 mill with 36 chars -------- --------
Set SaveLoadSlotsGold = 4
Set SaveLoadSlotsWood = 4
-------- -------- Set the Block Size, basically the amount of characters between dashes. -------- --------
Set SaveLoadBlockSize = 4
-------- -------- Set the Variables to be stored size, good time to setup your variable positions. -------- --------
Set SaveLoadVariablesStored[1] = SaveLoadSlotsHero
Set SaveLoadVariablesStored[2] = SaveLoadSlotHeroLevel
Set SaveLoadVariablesStored[3] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[4] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[5] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[6] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[7] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[8] = SaveLoadSlotsItem
Set SaveLoadVariablesStored[9] = SaveLoadSlotsGold
Set SaveLoadVariablesStored[10] = SaveLoadSlotsWood
-------- -------- This variable stops players from loading again after they load the first time. -------- --------
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Set SaveLoadHasLoaded[(Integer A)] = False
Saving
Events
Player - Player 1 (Red) types a chat message containing -save as A substring
Player - Player 2 (Blue) types a chat message containing -save as A substring
Player - Player 3 (Teal) types a chat message containing -save as A substring
Player - Player 4 (Purple) types a chat message containing -save as A substring
Player - Player 5 (Yellow) types a chat message containing -save as A substring
Player - Player 6 (Orange) types a chat message containing -save as A substring
Player - Player 7 (Green) types a chat message containing -save as A substring
Player - Player 8 (Pink) types a chat message containing -save as A substring
Player - Player 9 (Gray) types a chat message containing -save as A substring
Player - Player 10 (Light Blue) types a chat message containing -save as A substring
Player - Player 11 (Dark Green) types a chat message containing -save as A substring
Conditions
Actions
-------- -------- This PlayerGroup is so you can broadcast the correct player the message in the end. -------- --------
Player Group - Add (Triggering player) to SaveLoadPlayerGroupFocus
-------- -------- Decide how many variables the system will store -------- --------
Set SaveLoadMaxVariablesStored = 10
-------- -------- Default everything and load the basic stuff. Needs to happen each trigger activation or bad things happen. -------- --------
Set SaveLoadCheckSumChar = <Empty String>
Set SaveLoadEncryptedString = <Empty String>
Set SaveLoadEncryptedkey = <Empty String>
Set SaveLoadCheckSumInt = 0
Set SaveLoadPreEncryptedString = <Empty String>
Set SaveLoadFinalString = <Empty String>
For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
Loop - Actions
Set SaveLoadEncryptedNumbers[((Integer A) - 1)] = <Empty String>
For each (Integer A) from 1 to SaveLoadMaxVariablesStored, do (Actions)
Loop - Actions
Set SaveLoadTempStrings[(Integer A)] = <Empty String>
-------- -------- Setup the encryption for use. -------- --------
Set SaveLoadEncryptionKeyInt = (Random integer number between 1 and SaveLoadMaxEncryptionSets)
Set SaveLoadEncryptedkey = SaveLoadCharacterNumbers[SaveLoadEncryptionKeyInt]
For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
Loop - Actions
Set SaveLoadEncryptedNumbers[((Integer A) - 1)] = (Substring(SaveLoadEncryptionSet[SaveLoadEncryptionKeyInt], (Integer A), (Integer A)))
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptedkey
-------- -------- Now to start converting things to save -------- --------
-------- -------- Final string will be Encryption+Hero+HeroLevel+ItemsX6+Gold+Lumber+Checksum -------- --------
-------- -------- Hero first -------- --------
For each (Integer A) from 1 to MaxHeroesStored, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of SaveLoadPlayerHeroSingle[(Player number of (Triggering player))]) Equal to SetSaveLoadHeroesStored[(Integer A)]
Then - Actions
Set SaveLoadConversionInteger = (Integer A)
Else - Actions
Set SaveLoadPowerOfCurrent = (SaveLoadSlotsHero - 1)
For each (Integer A) from 1 to SaveLoadSlotsHero, do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = 1
For each (Integer B) from (Integer A) to (SaveLoadSlotsHero - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsHero - (Integer A)) Greater than or equal to 1
Then - Actions
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadPowerOfMaxNumber)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadPowerOfMaxNumber))
Set SaveLoadTempStrings[1] = (SaveLoadTempStrings[1] + SaveLoadCharacterNumbers[SaveLoadConversionDividedInt])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsHero - (Integer A)) Less than 1
Then - Actions
Set SaveLoadTempStrings[1] = (SaveLoadTempStrings[1] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
Else - Actions
Set SaveLoadConversionInteger = SaveLoadConversionRemainder
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[1]
-------- -------- now to create the string section for the hero level -------- --------
For each (Integer A) from 1 to SaveLoadSlotHeroLevel, do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = 1
For each (Integer B) from (Integer A) to (SaveLoadSlotHeroLevel - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotHeroLevel - (Integer A)) Greater than or equal to 1
Then - Actions
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadPowerOfMaxNumber)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadPowerOfMaxNumber))
Set SaveLoadTempStrings[2] = (SaveLoadTempStrings[2] + SaveLoadCharacterNumbers[SaveLoadConversionDividedInt])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotHeroLevel - (Integer A)) Less than 1
Then - Actions
Set SaveLoadTempStrings[2] = (SaveLoadTempStrings[2] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
Else - Actions
Set SaveLoadConversionInteger = SaveLoadConversionRemainder
Game - Display to (All players) for 30.00 seconds the text: SaveLoadTempStrings[2]
-------- -------- Now the Items carried by hero -------- --------
-------- -------- Item Slot1-6 courtesy the loop C -------- --------
For each (Integer IntegerC) from 1 to 6, do (Actions)
Loop - Actions
Set SaveLoadConversionInteger = 0
For each (Integer A) from 1 to SaveLoadMaxItemsStored, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] in slot IntegerC)) Equal to SaveLoadItems[(Integer A)]
Then - Actions
Set SaveLoadConversionInteger = (Integer A)
Else - Actions
For each (Integer B) from 1 to (SaveLoadSlotsItem - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = 1
For each (Integer B) from (Integer A) to (SaveLoadSlotsItem - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsItem - (Integer A)) Greater than or equal to 1
Then - Actions
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadPowerOfMaxNumber)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadPowerOfMaxNumber))
Set SaveLoadTempStrings[(IntegerC + 2)] = (SaveLoadTempStrings[(IntegerC + 2)] + SaveLoadCharacterNumbers[SaveLoadConversionDividedInt])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsItem - (Integer A)) Less than 1
Then - Actions
Set SaveLoadTempStrings[(IntegerC + 2)] = (SaveLoadTempStrings[(IntegerC + 2)] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
Else - Actions
Set SaveLoadConversionInteger = SaveLoadConversionRemainder
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[(IntegerC + 2)]
-------- -------- Now to convert the Gold into the strings -------- --------
Set SaveLoadConversionInteger = ((Triggering player) Current gold)
For each (Integer A) from 1 to SaveLoadSlotsGold, do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = 1
For each (Integer B) from (Integer A) to (SaveLoadSlotsGold - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsGold - (Integer A)) Greater than or equal to 1
Then - Actions
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadPowerOfMaxNumber)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadPowerOfMaxNumber))
Set SaveLoadTempStrings[9] = (SaveLoadTempStrings[9] + SaveLoadCharacterNumbers[SaveLoadConversionDividedInt])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsGold - (Integer A)) Less than 1
Then - Actions
Set SaveLoadTempStrings[9] = (SaveLoadTempStrings[9] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
Else - Actions
Set SaveLoadConversionInteger = SaveLoadConversionRemainder
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[9]
-------- -------- Now to convert the Lumber into the strings -------- --------
Set SaveLoadConversionInteger = ((Triggering player) Current lumber)
For each (Integer A) from 1 to SaveLoadSlotsWood, do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = 1
For each (Integer B) from (Integer A) to (SaveLoadSlotsWood - 1), do (Actions)
Loop - Actions
Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsWood - (Integer A)) Greater than or equal to 1
Then - Actions
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadPowerOfMaxNumber)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadPowerOfMaxNumber))
Set SaveLoadTempStrings[10] = (SaveLoadTempStrings[10] + SaveLoadCharacterNumbers[SaveLoadConversionDividedInt])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SaveLoadSlotsWood - (Integer A)) Less than 1
Then - Actions
Set SaveLoadTempStrings[10] = (SaveLoadTempStrings[10] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
Else - Actions
Set SaveLoadConversionInteger = SaveLoadConversionRemainder
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[10]
-------- -------- Now to combine the current finished strings. -------- --------
For each (Integer A) from 1 to SaveLoadMaxVariablesStored, do (Actions)
Loop - Actions
Set SaveLoadPreEncryptedString = (SaveLoadPreEncryptedString + SaveLoadTempStrings[(Integer A)])
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptedString
-------- -------- Now to create a checksum for security, there are many ways to create this number. We will use the previous variables since its easy. -------- --------
Set SaveLoadCheckSumInt = 0
For each (Integer A) from 1 to (Length of SaveLoadPreEncryptedString), do (Actions)
Loop - Actions
For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(SaveLoadPreEncryptedString, (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]
Then - Actions
Set SaveLoadCheckSumInt = (SaveLoadCheckSumInt + (Integer B))
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadCheckSumInt))
Else - Actions
Set SaveLoadConversionInteger = SaveLoadCheckSumInt
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadMaxCharacters)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadMaxCharacters))
Set SaveLoadCheckSumChar = SaveLoadCharacterNumbers[SaveLoadConversionRemainder]
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadCheckSumChar
-------- -------- Now we have all the characters ready to combine and encrypt fully, then package it pretty. -------- --------
-------- -------- This will convert the characters to the encrypted data set. It will also place a '-' every specified number of characters. -------- --------
Set SaveLoadPreEncryptedString = (SaveLoadPreEncryptedString + SaveLoadCheckSumChar)
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptedString
For each (Integer A) from 1 to (Length of SaveLoadPreEncryptedString), do (Actions)
Loop - Actions
For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(SaveLoadPreEncryptedString, (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]
Then - Actions
Set SaveLoadEncryptedString = (SaveLoadEncryptedString + SaveLoadEncryptedNumbers[(Integer B)])
Else - Actions
Set SaveLoadConversionInteger = (Integer A)
Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadBlockSize)
Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadBlockSize))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SaveLoadConversionRemainder Less than or equal to 0
Then - Actions
Set SaveLoadEncryptedString = (SaveLoadEncryptedString + -)
Else - Actions
Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptedString
-------- -------- Now for the final string, which will be the unencrypted key, and the rest of the encrypted information -------- --------
Set SaveLoadFinalString = ((SaveLoadEncryptedkey + -) + SaveLoadEncryptedString)
-------- -------- And now to broadcast all the hard work -------- --------
Game - Display to SaveLoadPlayerGroupFocus for 300.00 seconds the text: SaveLoadFinalString
Player Group - Remove all players from SaveLoadPlayerGroupFocus
Trigger:
Loading

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


Player - Player 5 (Yellow) types a chat message containing -load as A substring


Player - Player 6 (Orange) types a chat message containing -load as A substring


Player - Player 7 (Green) types a chat message containing -load as A substring


Player - Player 8 (Pink) types a chat message containing -load as A substring


Player - Player 9 (Gray) types a chat message containing -load as A substring


Player - Player 10 (Light Blue) types a chat message containing -load as A substring


Player - Player 11 (Dark Green) types a chat message containing -load as A substring

Conditions


(Substring((Entered chat string), 1, 5)) Equal to -load

Actions


-------- -------- This PlayerGroup is so you can broadcast the correct player the message in the end. -------- --------


Player Group - Add (Triggering player) to SaveLoadPlayerGroupFocus


-------- -------- This will confirm if the player has loaded before since last reset. -------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




SaveLoadHasLoaded[(Player number of (Triggering player))] Equal to True



Then - Actions




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: You have loaded you...



Else - Actions


-------- -------- Decide how many variables the system will store -------- --------


Set SaveLoadMaxVariablesStored = 10


-------- -------- Default everything and load the basic stuff. Needs to happen each trigger activation or bad things happen. -------- --------


Set SaveLoadTriggeredError = False


Set SaveLoadCheckSumChar = <Empty String>


Set SaveLoadEncryptedString = <Empty String>


Set SaveLoadEncryptedkey = <Empty String>


Set SaveLoadPreEncryptedString = <Empty String>


Set SaveLoadFinalString = <Empty String>


Set SaveLoadEncryptionKeyInt = 0


For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)



Loop - Actions




Set SaveLoadEncryptedNumbers[((Integer A) - 1)] = <Empty String>


For each (Integer A) from 1 to SaveLoadMaxVariablesStored, do (Actions)



Loop - Actions




Set SaveLoadTempStrings[(Integer A)] = <Empty String>


-------- -------- Now we need to pick up our load code from the message -------- --------


Set SaveLoadFinalString = (Substring((Entered chat string), 7, (Length of (String((Entered chat string)) as Upper case))))


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadFinalString


-------- ------- Now we need to break the string into 2 parts, Encryption set number and encrypted string -------- --------


Set SaveLoadEncryptedkey = (Substring(SaveLoadFinalString, 1, 1))


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptedkey


Set SaveLoadEncryptedString = (Substring(SaveLoadFinalString, 2, (Length of SaveLoadFinalString)))


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptedString


-------- -------- Setup the encryption for use. -------- --------


For each (Integer A) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






SaveLoadEncryptedkey Equal to SaveLoadCharacterNumbers[(Integer A)]





Then - Actions






Set SaveLoadEncryptionKeyInt = (Integer A)






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadEncryptionKeyInt))





Else - Actions


For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)



Loop - Actions




Set SaveLoadEncryptedNumbers[((Integer A) - 1)] = (Substring(SaveLoadEncryptionSet[SaveLoadEncryptionKeyInt], (Integer A), (Integer A)))


-------- -------- Now to Decrypt the Encrypted Section and remove the Dashes -------- --------


Set SaveLoadEncryptedString = <Empty String>


For each (Integer A) from 1 to (Length of SaveLoadEncryptedString), do (Actions)



Loop - Actions




For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)





Loop - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Substring(SaveLoadEncryptedString, (Integer A), (Integer A))) Equal to SaveLoadEncryptedNumbers[(Integer B)]







Then - Actions








Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadCharacterNumbers[(Integer B)]








Set SaveLoadPreEncryptedString = (SaveLoadPreEncryptedString + SaveLoadCharacterNumbers[(Integer B)])







Else - Actions


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptedString


-------- -------- Now to seperate the strings out before reading -------- --------


-------- -------- Workaround for a bug involving String length being used twice in an action. -------- --------


Set IntegerC = (Length of SaveLoadPreEncryptedString)


Set SaveLoadCheckSumChar = (String((Substring(SaveLoadPreEncryptedString, IntegerC, IntegerC))) as Upper case)


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (SaveLoadCheckSumChar + From Load)


Set SaveLoadPreEncryptedString = (Substring(SaveLoadPreEncryptedString, 1, ((Length of SaveLoadPreEncryptedString) - 1)))


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptedString


-------- -------- Verify the Checksum to prove the code is correct. 1:MaxChars chance of being an error that would allow code to process. -------- --------


Set SaveLoadCheckSumInt = 0


For each (Integer A) from 1 to (Length of SaveLoadPreEncryptedString), do (Actions)



Loop - Actions




For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)





Loop - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Substring(SaveLoadPreEncryptedString, (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]







Then - Actions








Set SaveLoadCheckSumInt = (SaveLoadCheckSumInt + (Integer B))








Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadCheckSumInt))







Else - Actions


Set SaveLoadConversionInteger = SaveLoadCheckSumInt


Set SaveLoadConversionDividedInt = (SaveLoadConversionInteger / SaveLoadMaxCharacters)


Set SaveLoadConversionRemainder = (SaveLoadConversionInteger - (SaveLoadConversionDividedInt x SaveLoadMaxCharacters))


Set SaveLoadCheckSumCharCompare = SaveLoadCharacterNumbers[SaveLoadConversionRemainder]


Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (SaveLoadCheckSumCharCompare + = Compare)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




SaveLoadCheckSumChar Not equal to SaveLoadCheckSumCharCompare



Then - Actions




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: |cffff0000Your code...




Set SaveLoadTriggeredError = True



Else - Actions


-------- -------- This IF is to make sure once they fail the checksum they cannot continue through the trigger. -------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




SaveLoadHasLoaded[(Player number of (Triggering player))] Equal to False




SaveLoadTriggeredError Equal to False



Then - Actions




-------- -------- Need to break each part of the String apart to each variable stored. -------- --------




-------- -------- First the hero type -------- --------




Set SaveLoadTempStrings[1] = (Substring(SaveLoadPreEncryptedString, IntegerC, (IntegerC + (SaveLoadSlotsHero - 1))))




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[1]




Set IntegerC = (IntegerC + SaveLoadSlotsHero)




-------- -------- Now the Hero level -------- --------




Set SaveLoadTempStrings[2] = (Substring(SaveLoadPreEncryptedString, IntegerC, (IntegerC + (SaveLoadSlotHeroLevel - 1))))




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[2]




Set IntegerC = (IntegerC + SaveLoadSlotHeroLevel)




-------- -------- now the Items X6 -------- --------




For each (Integer A) from 1 to 6, do (Actions)





Loop - Actions






Set SaveLoadTempStrings[((Integer A) + 2)] = (Substring(SaveLoadPreEncryptedString, IntegerC, (IntegerC + (SaveLoadSlotsItem - 1))))






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[((Integer A) + 2)]






Set IntegerC = (IntegerC + SaveLoadSlotsItem)




-------- -------- Now the Player Gold -------- --------




Set SaveLoadTempStrings[9] = (Substring(SaveLoadPreEncryptedString, IntegerC, (IntegerC + (SaveLoadSlotsGold - 1))))




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[9]




Set IntegerC = (IntegerC + SaveLoadSlotsGold)




-------- -------- Finally the lumber -------- --------




Set SaveLoadTempStrings[10] = (Substring(SaveLoadPreEncryptedString, IntegerC, (IntegerC + (SaveLoadSlotsWood - 1))))




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[10]




Set IntegerC = (IntegerC + SaveLoadSlotsWood)




-------- -------- Start performing actions and building the players stuff -------- --------




-------- -------- The ReBirth of a Hero! -------- --------




Set SaveLoadMultiple = 0




For each (Integer A) from 1 to SaveLoadSlotsHero, do (Actions)





Loop - Actions






Set SaveLoadPowerOfMaxNumber = 1






For each (Integer B) from (Integer A) to (SaveLoadSlotsHero - 1), do (Actions)







Loop - Actions








Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)






For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)







Loop - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(Substring(SaveLoadTempStrings[1], (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]









Then - Actions










Set SaveLoadMultiple = (SaveLoadMultiple + ((Integer B) x SaveLoadPowerOfMaxNumber))









Else - Actions




Unit - Create 1 SetSaveLoadHeroesStored[SaveLoadMultiple] for (Triggering player) at Region[1] facing Default building facing (270.0) degrees




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadMultiple))




Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] = (Last created unit)




-------- -------- Give that man a raise! -------- --------




Set SaveLoadMultiple = 0




For each (Integer A) from 1 to SaveLoadSlotHeroLevel, do (Actions)





Loop - Actions






Set SaveLoadPowerOfMaxNumber = 1






For each (Integer B) from (Integer A) to (SaveLoadSlotHeroLevel - 1), do (Actions)







Loop - Actions








Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)






For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)







Loop - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(Substring(SaveLoadTempStrings[2], (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]









Then - Actions










Set SaveLoadMultiple = (SaveLoadMultiple + ((Integer B) x SaveLoadPowerOfMaxNumber))









Else - Actions




Hero - Set SaveLoadPlayerHeroSingle[(Player number of (Triggering player))] Hero-level to SaveLoadMultiple, Hide level-up graphics




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadMultiple))




-------- -------- Time to Accessorize! -------- --------




For each (Integer IntegerC) from 1 to 6, do (Actions)





Loop - Actions






Set SaveLoadMultiple = 0






For each (Integer A) from 1 to SaveLoadSlotsItem, do (Actions)







Loop - Actions








Set SaveLoadPowerOfMaxNumber = 1








For each (Integer B) from (Integer A) to (SaveLoadSlotsItem - 1), do (Actions)









Loop - Actions










Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)








For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)









Loop - Actions










If (All Conditions are True) then do (Then Actions) else do (Else Actions)











If - Conditions












(Substring(SaveLoadTempStrings[(IntegerC + 2)], (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]











Then - Actions












Set SaveLoadMultiple = (SaveLoadMultiple + ((Integer B) x SaveLoadPowerOfMaxNumber))











Else - Actions






Hero - Create SaveLoadItems[SaveLoadMultiple] and give it to SaveLoadPlayerHeroSingle[(Player number of (Triggering player))]






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadMultiple))






-------- -------- Show me the money! -------- --------






For each (Integer A) from 1 to SaveLoadSlotsGold, do (Actions)







Loop - Actions








Set SaveLoadPowerOfMaxNumber = 1








For each (Integer B) from (Integer A) to (SaveLoadSlotsGold - 1), do (Actions)









Loop - Actions










Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)








For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)









Loop - Actions










If (All Conditions are True) then do (Then Actions) else do (Else Actions)











If - Conditions












(Substring(SaveLoadTempStrings[9], (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]











Then - Actions












Set SaveLoadMultiple = (SaveLoadMultiple + ((Integer B) x SaveLoadPowerOfMaxNumber))











Else - Actions






Player - Set (Triggering player) Current gold to SaveLoadMultiple






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadMultiple))






-------- -------- How much wood could a woodchuck chuck, if a woodchuck could chuck wood? -------- --------






Set SaveLoadMultiple = 0






For each (Integer A) from 1 to SaveLoadSlotsWood, do (Actions)







Loop - Actions








Set SaveLoadPowerOfMaxNumber = 1








For each (Integer B) from (Integer A) to (SaveLoadSlotsWood - 1), do (Actions)









Loop - Actions










Set SaveLoadPowerOfMaxNumber = (SaveLoadPowerOfMaxNumber x SaveLoadMaxCharacters)








For each (Integer B) from 0 to (SaveLoadMaxCharacters - 1), do (Actions)









Loop - Actions










If (All Conditions are True) then do (Then Actions) else do (Else Actions)











If - Conditions












(Substring(SaveLoadTempStrings[10], (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]











Then - Actions












Set SaveLoadMultiple = (SaveLoadMultiple + ((Integer B) x SaveLoadPowerOfMaxNumber))











Else - Actions






Player - Set (Triggering player) Current lumber to SaveLoadMultiple






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (String(SaveLoadMultiple))






-------- -------- All done, now to tell the player how good we did! -------- --------






Set SaveLoadHasLoaded[(Integer A)] = False






Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: |cfffff000Load Succ...



Else - Actions




Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: |cffff0000Load Unsu...




Player Group - Remove all players from SaveLoadPlayerGroupFocus
Can someone please help, I dont know what I did wrong (I barely understand what does what, and what is where, :/)
-.- +rep if someone can figure it out lolz
I think it has something to do with the final string, or something like that:/