Сейчас 20:51:08 Воскресенье, 5 мая, 2024 год
[ x ] Главная ⇒ Форум ⇐ RSS Файлы Cтатьи Картинки В о й т и   или   з а р е г и с т р и р о в а т ь с я


[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Модератор форума: PUVer, SirNikolas, Ty3uK  
Форум о Warcraft 3 » Раздел для картостроителей » Раздел картостроителя » GUI save\load system (by Effane)
GUI save\load system
[DUОS]Дата: Суббота, 29 Августа 2009, 20:50:46 | Сообщение # 1
Группа: Заблокированные
Сообщений: 6279
Награды: 9
Репутация: 1708
Блокировки:
Триггеры:
Code
SaveLoadInitialize 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 SaveLoadCharacterSet = 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
Set SaveLoadMaxEncryptionSets = 5  
-------- 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(SaveLoadCharacterSet, (Integer A), (Integer A)))  
-------- Make sure you calculate on paper how many numbers per the amount of slots you get from Characters, this will make it MUCH easier to do slot sizes --------  
-------- Size of Levels to be saved for herolevel --------  
Set SaveLoadSlotsHeroLevel = 2  
-------- Load the Heroes into an array to make numbers out of them. --------  
Set SaveLoadHeroesStored[1] = Paladin  
Set SaveLoadHeroesStored[2] = Archmage  
Set SaveLoadHeroesStored[3] = Mountain King  
Set SaveLoadHeroesStored[4] = Blood Mage  
Set SaveLoadMaxHeroesStored = 4  
Set SaveLoadSlotsHero = 2  
-------- Load the Items into an array to make numbers out of them. --------  
Set SaveLoadItemsStored[1] = Dust of Appearance  
Set SaveLoadItemsStored[2] = Minor Replenishment Potion  
Set SaveLoadItemsStored[3] = Potion of Speed  
Set SaveLoadItemsStored[4] = Ring of the Archmagi  
Set SaveLoadItemsStored[5] = Cloak of Shadows  
Set SaveLoadItemsStored[6] = Gauntlets of Ogre Strength +3  
Set SaveLoadItemsStored[7] = Mantle of Intelligence +3  
Set SaveLoadItemsStored[8] = Slippers of Agility +3  
Set SaveLoadItemsStored[9] = Manual of Health  
Set SaveLoadItemsStored[10] = Healing Salve  
Set SaveLoadMaxItemsStored = 10  
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 SaveLoadSlotsLumber = 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] = SaveLoadSlotsHeroLevel  
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] = SaveLoadSlotsLumber  
-------- This variable stops players from loading again after they load the first time. --------  
For each (Integer A) from 1 to 4, do (Actions) Loop - Actions Set SaveLoadHasLoaded[(Integer A)] = False

Добавлено (29-08-2009, 20:48)
---------------------------------------------

Code
SaveModuleSingle
     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
         -------- 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 SaveLoadEncryptionKey = <Empty String>
         Set SaveLoadCheckSumInt = 0
         Set SaveLoadPreEncryptionString = <Empty String>
         Set SaveLoadFinalString = <Empty String>
         For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
             Loop - Actions
                 Set SaveLoadEncryptionNumbers[((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 SaveLoadEncryptionKey = SaveLoadCharacterNumbers[SaveLoadEncryptionKeyInt]
         For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
             Loop - Actions
                 Set SaveLoadEncryptionNumbers[((Integer A) - 1)] = (Substring(SaveLoadEncryptionSet[SaveLoadEncryptionKeyInt], (Integer A), (Integer A)))
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptionKey
         -------- 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 SaveLoadMaxHeroesStored, 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 SaveLoadHeroesStored[(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 <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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 --------
         Set SaveLoadConversionInteger = (Hero level of SaveLoadPlayerHeroSingle[(Player number of (Triggering player))])
         Set SaveLoadPowerOfCurrent = (SaveLoadSlotsHeroLevel - 1)
         For each (Integer A) from 1 to SaveLoadSlotsHeroLevel, do (Actions)
             Loop - Actions
                 Set SaveLoadPowerOfMaxNumber = 1
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="B)"> from (Integer A) to (SaveLoadSlotsHeroLevel - 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
                         (SaveLoadSlotsHeroLevel - (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
                         (SaveLoadSlotsHeroLevel - (Integer A)) Less than 1
                     Then - Actions
                         Set SaveLoadTempStrings[2] = (SaveLoadTempStrings[2] + SaveLoadCharacterNumbers[SaveLoadConversionRemainder])
                     Else - Actions
                 Set SaveLoadConversionInteger = SaveLoadConversionRemainder
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[2]
         -------- Now the Items carried by hero --------
         -------- Item Slot1-6 courtesy the loop C --------

Добавлено (29-08-2009, 20:48)
---------------------------------------------

Code
        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 SaveLoadItemsStored[(Integer A)]
                             Then - Actions
                    Set SaveLoadConversionInteger = (Integer A)
                             Else - Actions
                 For each (Integer A) from 1 to SaveLoadSlotsItem, do (Actions)
                     Loop - Actions
                         Set SaveLoadPowerOfMaxNumber = 1
                         For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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 <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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 SaveLoadSlotsLumber, do (Actions)
             Loop - Actions
                 Set SaveLoadPowerOfMaxNumber = 1
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="B)"> from (Integer A) to (SaveLoadSlotsLumber - 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
                         (SaveLoadSlotsLumber - (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
                         (SaveLoadSlotsLumber - (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 SaveLoadPreEncryptionString = (SaveLoadPreEncryptionString + SaveLoadTempStrings[(Integer A)])
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptionString
         -------- 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 SaveLoadPreEncryptionString), do (Actions)
             Loop - Actions
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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(SaveLoadPreEncryptionString, (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 SaveLoadPreEncryptionString = (SaveLoadPreEncryptionString + SaveLoadChecksumChar)
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptionString
         For each (Integer A) from 1 to (Length of SaveLoadPreEncryptionString), do (Actions)
             Loop - Actions
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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(SaveLoadPreEncryptionString, (Integer A), (Integer A))) Equal to SaveLoadCharacterNumbers[(Integer B)]
                             Then - Actions
                    Set SaveLoadEncryptedString = (SaveLoadEncryptedString + SaveLoadEncryptionNumbers[(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 = ((SaveLoadEncryptionKey + -) + 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

Добавлено (29-08-2009, 20:49)
---------------------------------------------

Code
LoadModuleSingle
     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, 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 SaveLoadTriggerErrored = False
         Set SaveLoadChecksumChar = <Empty String>
         Set SaveLoadEncryptedString = <Empty String>
         Set SaveLoadEncryptionKey = <Empty String>
         Set SaveLoadPreEncryptionString = <Empty String>
         Set SaveLoadFinalString = <Empty String>
         Set SaveLoadEncryptionKeyInt = 0
         For each (Integer A) from 1 to SaveLoadMaxCharacters, do (Actions)
             Loop - Actions
                 Set SaveLoadEncryptionNumbers[((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 = (String((Substring((Entered chat string), 7, (Length of (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 SaveLoadEncryptionKey = (Substring(SaveLoadFinalString, 1, 1))
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadEncryptionKey
         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
                         SaveLoadEncryptionKey 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 SaveLoadEncryptionNumbers[((Integer A) - 1)] = (Substring(SaveLoadEncryptionSet[SaveLoadEncryptionKeyInt], (Integer A), (Integer A)))
         -------- Now to Decrypt the Encrypted Section and remove the Dashes --------
         Set SaveLoadPreEncryptionString = <Empty String>
         For each (Integer A) from 1 to (Length of SaveLoadEncryptedString), do (Actions)
             Loop - Actions
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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 SaveLoadEncryptionNumbers[(Integer B)]
                             Then - Actions
                    Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadCharacterNumbers[(Integer B)]
                    Set SaveLoadPreEncryptionString = (SaveLoadPreEncryptionString + SaveLoadCharacterNumbers[(Integer B)])
                             Else - Actions
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptionString
         -------- 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 SaveLoadPreEncryptionString)
         Set SaveLoadChecksumChar = (String((Substring(SaveLoadPreEncryptionString, IntegerC, IntegerC))) as Upper case)
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: (SaveLoadChecksumChar +  = From Load)
         Set SaveLoadPreEncryptionString = (Substring(SaveLoadPreEncryptionString, 1, ((Length of SaveLoadPreEncryptionString) - 1)))
         Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadPreEncryptionString
         -------- 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 SaveLoadPreEncryptionString), do (Actions)
             Loop - Actions
                 For each (Integer <img rel="usm" src="http://www.warcraft3ft.info/image/smiles/cool.gif" border="0" align="absmiddle" alt="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(SaveLoadPreEncryptionString, (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 the text: Either your code is...
                 Set SaveLoadTriggerErrored = True
             Else - Actions

Добавлено (29-08-2009, 20:49)
---------------------------------------------

Code
        -------- 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
                 SaveLoadTriggerErrored Equal to False
             Then - Actions
                 -------- Need to break each part of the String apart to each variable stored. --------
                 Set IntegerC = 1
                 -------- First the hero type --------
                 Set SaveLoadTempStrings[1] = (Substring(SaveLoadPreEncryptionString, 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(SaveLoadPreEncryptionString, IntegerC, (IntegerC + (SaveLoadSlotsHeroLevel - 1))))
                 Game - Display to SaveLoadPlayerGroupFocus for 30.00 seconds the text: SaveLoadTempStrings[2]
                 Set IntegerC = (IntegerC + SaveLoadSlotsHeroLevel)


НУ И ЧТО ТЕПЕРЬ?


Кликайте на дракошку ;)
 

ShalanarДата: Пятница, 04 Сентября 2009, 21:13:07 | Сообщение # 2
7 уровень
Группа: Проверенные
Сообщений: 368
Награды: 0
Репутация: 30
Блокировки:
Можешь выложить карту пример?
 

windrunnerДата: Пятница, 04 Сентября 2009, 21:22:21 | Сообщение # 3
10 уровень
Группа: Проверенные
Сообщений: 1259
Награды: 0
Репутация: 218
Блокировки:
Не стоит выкладывать такие статьи потому что во 1 есть более простые и профисиональные статьи (и описанные подробнее) сматрите на хгм
во 2 так как прочитав ету статьи народ сможет сломать код созданный на етой системе!
Лучше писать свои запутанные системы которые будут понятны токо вам!


И в правду мир сошел с ума...
И до тех пор пока нас не обесточат
Пока не догорит аварийных фонарей заряд
Мы будем жечь тут электричество что есть мочи
Русский мапмейкинг - бессмысленный и беспощадный.xD
 

ЭллесарДата: Суббота, 12 Сентября 2009, 17:03:58 | Сообщение # 4
DeMoN
Группа: Ветераны
Сообщений: 934
Награды: 1
Репутация: 210
Блокировки:
Имхо моя система самая лучшая из-за всех..... так как она низкоуровневая относительно варика + перевод в двоичную систему....

база паролей: https://yadi.sk/d/mdDhWuvPcTSKw
бекап сайта от 26.12.2010 https://yadi.sk/d/L3xNpibbiHpYE
 

Форум о Warcraft 3 » Раздел для картостроителей » Раздел картостроителя » GUI save\load system (by Effane)
  • Страница 1 из 1
  • 1
Поиск:

Copyright © 2006 - 2024 Warcraft3FT.info При копировании материалов c сайта ставьте, пожалуйста, активную обратную ссылку на нас • Design by gReeB04ki ©
Хостинг от uCoz