Well, I used the Ace Hart save/load system.
At first it worked well, because I used to save some things only, but when I advanced I have only one problem.
I can't do that the code saves the abilities for the heros, and i don't know what can be the cause either, so here is the code
-Save
-Load
NOTE THAT MY EDITOR IS IN SPANISH, but is still understable the part that is the problem
At first it worked well, because I used to save some things only, but when I advanced I have only one problem.
I can't do that the code saves the abilities for the heros, and i don't know what can be the cause either, so here is the code
-Save
Trigger:
- Acontecimientos
- Player - Player 1 (red) types a chat message containing -save as Una correspondencia exacta
- Player - Player 2 (blue) types a chat message containing -save as Una correspondencia exacta
- Player - Player 3 (teal) types a chat message containing -save as Una correspondencia exacta
- Player - Player 4 (purple) types a chat message containing -save as Una correspondencia exacta
- Acciones
- -------- Prepare the save array with this player's Hero --------
- Set SaveCount = 0
- -------- Player's Gold --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = ((Triggering player) Oro actual)
- -------- Player Lumber --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = ((Triggering player) Madera actual)
- -------- Take all Heroes --------
- Set UnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is Un héroe) Igual a True))
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Number of units in UnitGroup)
- Grupo de unidad - Pick every unit in UnitGroup and do (Actions)
- Bucle: Acciones
- -------- Save the Hero --------
- Set SaveCount = (SaveCount + 1)
- Set TempUnit = (Picked unit)
- Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
- -------- Hero Experience --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Hero experience of (Picked unit))
- -------- Hero Position X --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Integer((X of (Position of (Picked unit)))))
- -------- Hero Position Y --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Integer((Y of (Position of (Picked unit)))))
- -------- How many items does he carry --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Number of items carried by (Picked unit))
- -------- Add all abilities --------
- For each (Integer A) from 1 to SaveLoad_Abilities_LastIndex, do (Actions)
- Bucle: Acciones
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Si: Condiciones
- (Level of SaveLoad_Abilities[(Integer A)] for (Picked unit)) Mayor que 0
- Entonces: Acciones
- -------- The actual ability --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Integer A)
- -------- Its level --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Level of SaveLoad_Abilities[(Integer A)] for (Picked unit))
- Otros: Acciones
- Si: Condiciones
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Bucle: Acciones
- -------- Add all items --------
- For each (Integer A) from 1 to 6, do (Actions)
- Bucle: Acciones
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Si: Condiciones
- ((Item carried by (Picked unit) in slot (Integer A)) is owned) Igual a True
- Entonces: Acciones
- -------- The actual item --------
- Set SaveCount = (SaveCount + 1)
- Set TempItem = (Item carried by (Picked unit) in slot (Integer A))
- Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
- -------- The number of charges it has --------
- Set SaveCount = (SaveCount + 1)
- Set Save[SaveCount] = (Charges remaining in (Item carried by (Picked unit) in slot (Integer A)))
- Otros: Acciones
- Si: Condiciones
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Bucle: Acciones
- Bucle: Acciones
- -------- Turn values into code --------
- Custom script: set udg_Code = SaveLoad_Encode()
- -------- Show code to player --------
- Misión - Display to (Player group((Triggering player))) the Secreto message: Your code:
- Partida - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
-Load
Trigger:
- Acontecimientos
- Jugador - Jugador 1 (rojo) types a chat message containing -load as Una subcadena
- Jugador - Jugador 2 (azul) types a chat message containing -load as Una subcadena
- Jugador - Jugador 3 (teja) types a chat message containing -load as Una subcadena
- Jugador - Jugador 4 (morado) types a chat message containing -load as Una subcadena
- Condiciones
- (Substring((Entered chat string), 1, 6)) Igual a (Matched chat string)
- (Length of (Entered chat string)) Mayor que 6
- Acciones
- -------- 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)
- Si: Condiciones
- Validate Igual a False
- Entonces: Acciones
- -------- Invalid code --------
- Partida - Display to (Player group((Triggering player))) the text: There's some error ...
- Skip remaining actions
- Otros: Acciones
- Si: Condiciones
- -------- It worked, let's do something with it --------
- Grupo de unidad - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is Un héroe) Igual a True)) and do (Actions)
- Bucle: Acciones
- Unidad - Remove (Picked unit) from the game
- Bucle: Acciones
- Set TempInteger = SaveCount
- Set SaveCount = 1
- -------- Restore Gold --------
- Jugador - Set (Triggering player) Oro actual to Save[SaveCount]
- -------- Restore Lumber --------
- Set SaveCount = (SaveCount + 1)
- Jugador - Set (Triggering player) Madera actual to Save[SaveCount]
- -------- For "number of Heroes", do --------
- Set SaveCount = (SaveCount + 1)
- For each (Integer B) from 1 to Save[SaveCount], do (Actions)
- Bucle: Acciones
- -------- Restore Hero --------
- Set SaveCount = (SaveCount + 1)
- Custom script: set udg_TempUnitType = SaveLoad_Integer2Unit(udg_Save[udg_SaveCount])
- Unidad - Create 1 TempUnitType for (Triggering player) at ((Triggering player) start location) facing Vista edificio predeterminada degrees
- -------- Set Experience --------
- Set SaveCount = (SaveCount + 1)
- Héroe - Set (Last created unit) experience to Save[SaveCount], Ocultar level-up graphics
- -------- Move to saved position --------
- Set SaveCount = (SaveCount + 1)
- Unidad - Move (Last created unit) instantly to (Center of Hero Start <gen>)
- Set SaveCount = (SaveCount + 1)
- -------- Abilities --------
- For each (Integer SaveCount) from (SaveCount + 1) to TempInteger, do (Actions)
- Bucle: Acciones
- For each (Integer A) from 1 to Save[(SaveCount + 1)], do (Actions)
- Bucle: Acciones
- Custom script: call SelectHeroSkill( GetLastCreatedUnit(), udg_SaveLoad_Abilities[ udg_Save[ udg_SaveCount ] ] )
- Bucle: Acciones
- Set SaveCount = (SaveCount + 1)
- For each (Integer A) from 1 to Save[(SaveCount + 1)], do (Actions)
- Bucle: Acciones
- -------- Recreate all items --------
- Set SaveCount = (SaveCount + 1)
- For each (Integer A) from 1 to Save[SaveCount], do (Actions)
- Bucle: Acciones
- -------- The actual item --------
- Set SaveCount = (SaveCount + 1)
- Custom script: set udg_TempItemType = SaveLoad_Integer2Item(udg_Save[udg_SaveCount])
- Héroe - Create TempItemType and give it to (Last created unit)
- -------- Number of charges --------
- Set SaveCount = (SaveCount + 1)
- Objeto - Set charges remaining in (Last created item) to Save[SaveCount]
- Bucle: Acciones
- Bucle: Acciones
NOTE THAT MY EDITOR IS IN SPANISH, but is still understable the part that is the problem