Save\load help..

werasd

New Member
Reaction score
14
Reply...

Chocobo i did the InitializeItems Trigger, but the item, i copied from ur save/load map and paste... cause i dont understand the item... why is necessary item??

---And yes i did the initialize items, and also i put a paladin in my map to test, but i receive the same error... Hero Not Found...(the paladin is for player 1 red, the player of the test)


---well i forgot... i also use your save/load map to test, and nothing different... i put a paladin in the map and i tested... (the paladin is for player 1 red, the player of the test)

--- lol i forgot another thing... u asked if Does Hero[Player number of (Triggering Player)] returns YOUR HERO?

^ i dont understand... that Hero[Player number of (Triggering Player)], the "Hero" is the variable eh? i dont understand the "returns your hero"...


Hey... that item u said is a require to save??
 

werasd

New Member
Reaction score
14
YAHHHH I FIXED!!

But now i can save... buutt... when i load with my code it load a footman... and not my paladin... and usually when i save is the same code...

How can i fix??
 

werasd

New Member
Reaction score
14
Yeah...

The first i tried: apaawaeaeaeaeaeae


The Second i tried: aeaawaeaeaeaeae


They only load footmans...
 
X

xflip04

Guest
omg this is confusing, can someone send me a map with this so i can understand it better?
 

Chocobo

White-Flower
Reaction score
409
Hey... that item u said is a require to save??
Not really, it is only for hackers.

6 digit codes.. Encryption.

Code:
Save Char (Add This to the regular code. Backup Trigger recommanded)
Actions
\\ TO BE WRITTEN BEFORE ANY OTHER ACTIONS
Set gold = 0
Set goldcode = 0
local string udg_Gold
local string udg_goldcode
\\ TO BE WRITTEN BEFORE Set FinalCode =...
Set gold = (Integer(Current gold of (Triggering Player)))
If Gold lesser than 10 Then Set Gold = 00000 + (Gold)
If Gold lesser than 100 Then Set Gold = 0000 + (Gold)
If Gold lesser than 1000 Then Set Gold = 000 + (Gold)
If Gold lesser than 10000 Then Set Gold = 00 + (Gold)
If Gold lesser than 100000 Then Set Gold = 0 + (Gold)
For Each Integer A from 1 to 6, Do Actions
     If (Substring, (Gold), (Integer A), (Integer A)) Equal to 0
     Then Set goldcode = (goldcode + a)
     Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 1
           Then Set goldcode = (goldcode + c)
           Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 2
                 Then Set goldcode = (goldcode + e)
                 Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 3
                       Then Set goldcode = (goldcode + i)
                       Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 4
                             Then Set goldcode = (goldcode + j)
                             Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 5
                                   Then Set goldcode = (goldcode + m)
                                   Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 6
                                         Then Set goldcode = (goldcode + n)
                                         Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 7
                                               Then Set goldcode = (goldcode + o)
                                               Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 8
                                                     Then Set goldcode = (goldcode + r)
                                                     Else If (Substring, (Gold), (Integer A), (Integer A)) Equal to 9
                                                           Then Set goldcode = (goldcode + v)
                                                           Else
Set FinalCode = ((((SaveCode[0] + SaveCode[1]) + (SaveCode[2] + SaveCode[3])) + ((SaveCode[4] + SaveCode[5]) + (SaveCode[6] + SaveCode[7]) + (goldcode)))

Code:
Load Char
    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
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Length of (Entered chat string)) Not equal to [COLOR=Red]29[/COLOR]
            Then - Actions
                Game - Display to (Player group((Triggering player))) the text: ERROR: Code Length ...
                Skip remaining actions
            Else - Actions
        Trigger - Turn off (This trigger)
        Set Playername = (Name of (Triggering player))
        Set LoadString = (abcde + (Entered chat string))
        Trigger - Run Randomize <gen> (ignoring conditions)
        Set Base32Input = (a + (Substring(LoadString, 12, 13)))
        Trigger - Run Base32 to Base10 <gen> (ignoring conditions)
        Set UnitNumber = (Base10Output / RandomizeCode)
        Set Base32Input = (Substring(LoadString, 14, 16))
        Trigger - Run Base32 to Base10 <gen> (ignoring conditions)
        Set LoadLevel = (Base10Output / (RandomizeCode x ((UnitNumber mod 9) + 1)))
        [COLOR=Red]Set goldcode = (Substring(Entered Chat String), 24, 29))
        Set Gold = 0[/COLOR]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        UnitNumber Greater than MaxSavableHeroes
                        UnitNumber Less than 1
                        LoadLevel Greater than MaxLevel
                        LoadLevel Less than 0
            Then - Actions
                Game - Display to (Player group((Triggering player))) the text: ERROR: Error Loadin...
                Trigger - Turn on (This trigger)
                Skip remaining actions
            Else - Actions
                Do nothing
        For each (Integer A) from 1 to MaxSavableHeroes, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        UnitNumber Equal to (Integer A)
                    Then - Actions
                        Unit - Create 1 HeroType[UnitNumber] for (Triggering player) at (Center of (Playable map area)) facing 0.00 degrees
                    Else - Actions
        Hero - Set (Last created unit) Hero-level to LoadLevel, Show level-up graphics
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Hero - Drop the item from slot (Integer A) of (Last created unit)
                Item - Remove (Last dropped item)
        For each (Integer B) from 0 to 5, do (Actions)
            Loop - Actions
                Set Base32Input = (a + (Substring(LoadString, (17 + ((Integer B) x 2)), (18 + ((Integer B) x 2)))))
                Trigger - Run Base32 to Base10 <gen> (ignoring conditions)
                Set ItemNumber = ((Base10Output - (UnitNumber + (Integer B))) / ((RandomizeCode mod 2) + 1))
                Set ItemNumber = (ItemNumber + 100)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (ItemNumber Less than 100) or (ItemNumber Greater than 499)
                                InitializeItems[ItemNumber] Equal to Unknown Item
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ItemNumber Equal to 500
                            Then - Actions
                                Do nothing
                            Else - Actions
                                Game - Display to (Player group((Triggering player))) the text: ((|c00ff0000ERROR:Code Error Bit |r + (String(((Integer B) + 3)))) +  Continuing Load...)
                    Else - Actions
                        Hero - Create InitializeItems[ItemNumber] and give it to (Last created unit) aceijmnorv
[COLOR=Red]For Each Integer A from 1 to 6, Do Actions
     If (Substring, (goldcode), (Integer A), (Integer A)) Equal to a
     Then Set Gold = (Gold + 0)
     Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to c
           Then Set Gold = (Gold + 1)
           Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to e
                 Then Set Gold = (Gold + 2)
                 Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to i
                       Then Set Gold = (Gold + 3)
                       Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to j
                             Then Set Gold = (Gold + 4)
                             Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to m
                                   Then Set Gold = (Gold + 5)
                                   Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to n
                                         Then Set Gold = (Gold + 6)
                                         Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to o
                                               Then Set Gold = (Gold + 7)
                                               Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to r
                                                     Then Set Gold = (Gold + 8)
                                                     Else If (Substring, (goldcode), (Integer A), (Integer A)) Equal to v
                                                           Then Set Gold = (Gold + 9)
                                                           Else
Player - Set (Triggering Player)'s current gold to (Gold)[/COLOR]
        Trigger - Turn on (This trigger)
 
X

xflip04

Guest
choco where can i download a working save/load code to help me understand this?

thanks
 
S

Shinyblade

Guest
1 more question:

How do you do the local string thing?

I can't figure out how lol.

☺§Shinyblade§☺
 

Saiza

New Member
Reaction score
10
Hey, Hey :) That save thingy seems very complicated, Cant you do it for me on my map? :) I would love you, if you did <3
 
X

xflip04

Guest
if he could just send us a map with the triggers on it would help :D
 

Chocobo

White-Flower
Reaction score
409
Chocobo and what about my error?
The first i tried: apaawaeaeaeaeaeae


The Second i tried: aeaawaeaeaeaeae


They only load footmans...

Ok I think I found the problem. There is a conflict in the Variable HeroType, Unit-Type (Array), and also with this trigger :
Code:
Detect Hero
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set Hero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)

Or, there is an another way (Save Char Trigger) :
Code:
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[1]) then Set Part1 = 01
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[2]) then Set Part1 = 02
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[3]) then Set Part1 = 03
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[4]) then Set Part1 = 04
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[5]) then Set Part1 = 05
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[6]) then Set Part1 = 06
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[7]) then Set Part1 = 07
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[8]) then Set Part1 = 08
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[9]) then Set Part1 = 09
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[10]) then Set Part1 = 10
If ((Unit Type of (Hero[Player number of (Triggering Player)]) Equal to (HeroType[11]) then Set Part1 = 11

It looks repetitive and has been replaced by For Each Integer A in old code, you must do this to get no error.

This can also confuse the trigger :
Code:
        For each (Integer A) from 1 to MaxSavableHeroes, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        UnitNumber Equal to (Integer A)
                    Then - Actions
                        Unit - Create 1 HeroType[UnitNumber] for (Triggering player) at (Center of (Playable map area)) facing 0.00 degrees
                    Else - Actions

It is INTEGER A and does not return 01. I am creating a new demo-map I will post there in which there will be no error problem.



P.S : I wonder if Save Load Code v0.13f was better than this new. It contains 2 less letters and can be understand easily. If someone has the map, please post it.
 

Chocobo

White-Flower
Reaction score
409
There are small bugs in that map :
- It won't support the setting of Hero[X] when hero is loaded. Add it manually to the trigger.
- There is a small chance to get a weird hero level, around 1 to 10 difference of level.

This Map is now a demo map in which it has now some possibilities. Also shows how to use locals in GUI and how to make a look of overlapping 522 max speed limit but still 522 speed -> Just reduce size of all things in your map.
 

werasd

New Member
Reaction score
14
Chocobo

Chocobo what trigger can i use to, when i load my char the other char continue in the map... how can i remove him from the game?? and a nearby praton that need to train the hero (tavern), how can i remove the whisp?
 
S

Shinyblade

Guest
Thanks! This trigger helped me tons!

And in case someone doesn't know how to add the loading thing, The easiest way I found was putting this at end of load trigger:

Else:
Hero - Create InitializeItems[ItemNumber] and give it to (Last Created Unit)
Set Hero[(Play number of (triggering player))] = Last created unit
Turn on (this trigger)
 
S

Shinyblade

Guest
And two question: (Lol, Yep i'm still having trouble.)

How do you do the first 6 triggers in the gold one. I can't get it to be (interger(Current Gold of (Triggering Player)))

And how do you make intergers on #'s 2-6 more than one zero?
 

Chocobo

White-Flower
Reaction score
409
How do you do the first 6 triggers in the gold one. I can't get it to be (interger(Current Gold of (Triggering Player)))

And how do you make intergers on #'s 2-6 more than one zero?
Reply With Quote

What do you suppose?


Set Hero[(Play number of (triggering player))] = Last created unit

I forget to add it because the old trigger uses an external trigger to set the Hero as the value needed. (Generic unit enters playable map area)
 

Chocobo

White-Flower
Reaction score
409
werasd said:
Chocobo what trigger can i use to, when i load my char the other char continue in the map... how can i remove him from the game?? and a nearby praton that need to train the hero (tavern), how can i remove the whisp?

Ok I forget werasd, the Function Unit - Remove Unit exists.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top