Save\load help..

C-Death

I love you
Reaction score
45
sup? i know i posted earlyer... but now i need more help please.

Now i want the players in my RPG to be able to type:
-save
(save there Hero, gold and such and only Show the code to them,
and some -load (code help)

Thanks in advance

:banghead:
 

Chocobo

White-Flower
Reaction score
409
Up to 399 items and 999 Hero Levels. I post triggers. To define items and heroes that can be saved, modify yourself the InitializeItems trigger. You must give an item for each integer from 100 to 499 (It also must be done with a For Each Integer A from 100 to 499 Do Actions Set InitializeItems[Integer A] = Unknown Item, which is included). You can modify the Max Level of the Save Code. Writing an InitializeItems below 100 or greater than 499 may cause some problems with saving.

Required Variables List :
Code:
Base10Convert, Integer
Base10Input, Integer
Base10Output, Integer
Base32Input, String
Base32Int, Integer (Array)
Base32String, Integer (Array)
CarriedItems, Integer (Array)
FinalCode, String
Hero, Unit (Array)
HeroType, Unit-Type (Array)
InitializeItems, Item-Type (Array)
ItemNumber, Integer
LevelCode, Integer
LoadLevel, Integer
LoadString, String
MaxLevel, Integer
MaxSavableHeroes, Integer
Part1, String
Playername, String
RandomizeCode, Integer
SaveCode, String (Array)
SavingHero, Unit
SortTempInt, Integer
UnitNumber, Integer
WhileLoop, [COLOR=Red]Unknown Variable[/COLOR]

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)

Code:
Randomize
    Events
    Conditions
    Actions
        Set Playername = (Substring(Playername, 1, 1))
        Set RandomizeCode = 17
        If (Playername Equal to a) then do (Set RandomizeCode = 17) else do (Do nothing)
        If (Playername Equal to b) then do (Set RandomizeCode = 5) else do (Do nothing)
        If (Playername Equal to c) then do (Set RandomizeCode = 16) else do (Do nothing)
        If (Playername Equal to d) then do (Set RandomizeCode = 8) else do (Do nothing)
        If (Playername Equal to e) then do (Set RandomizeCode = 4) else do (Do nothing)
        If (Playername Equal to f) then do (Set RandomizeCode = 7) else do (Do nothing)
        If (Playername Equal to g) then do (Set RandomizeCode = 1) else do (Do nothing)
        If (Playername Equal to h) then do (Set RandomizeCode = 15) else do (Do nothing)
        If (Playername Equal to i) then do (Set RandomizeCode = 10) else do (Do nothing)
        If (Playername Equal to j) then do (Set RandomizeCode = 12) else do (Do nothing)
        If (Playername Equal to k) then do (Set RandomizeCode = 9) else do (Do nothing)
        If (Playername Equal to l) then do (Set RandomizeCode = 3) else do (Do nothing)
        If (Playername Equal to m) then do (Set RandomizeCode = 6) else do (Do nothing)
        If (Playername Equal to n) then do (Set RandomizeCode = 11) else do (Do nothing)
        If (Playername Equal to o) then do (Set RandomizeCode = 2) else do (Do nothing)
        If (Playername Equal to p) then do (Set RandomizeCode = 14) else do (Do nothing)
        If (Playername Equal to q) then do (Set RandomizeCode = 13) else do (Do nothing)
        If (Playername Equal to r) then do (Set RandomizeCode = 11) else do (Do nothing)
        If (Playername Equal to s) then do (Set RandomizeCode = 6) else do (Do nothing)
        If (Playername Equal to t) then do (Set RandomizeCode = 5) else do (Do nothing)
        If (Playername Equal to u) then do (Set RandomizeCode = 1) else do (Do nothing)
        If (Playername Equal to v) then do (Set RandomizeCode = 8) else do (Do nothing)
        If (Playername Equal to w) then do (Set RandomizeCode = 17) else do (Do nothing)
        If (Playername Equal to x) then do (Set RandomizeCode = 15) else do (Do nothing)
        If (Playername Equal to y) then do (Set RandomizeCode = 9) else do (Do nothing)
        If (Playername Equal to z) then do (Set RandomizeCode = 16) else do (Do nothing)
        If (Playername Equal to A) then do (Set RandomizeCode = 14) else do (Do nothing)
        If (Playername Equal to B) then do (Set RandomizeCode = 13) else do (Do nothing)
        If (Playername Equal to C) then do (Set RandomizeCode = 10) else do (Do nothing)
        If (Playername Equal to D) then do (Set RandomizeCode = 4) else do (Do nothing)
        If (Playername Equal to E) then do (Set RandomizeCode = 12) else do (Do nothing)
        If (Playername Equal to F) then do (Set RandomizeCode = 2) else do (Do nothing)
        If (Playername Equal to G) then do (Set RandomizeCode = 3) else do (Do nothing)
        If (Playername Equal to H) then do (Set RandomizeCode = 7) else do (Do nothing)
        If (Playername Equal to I) then do (Set RandomizeCode = 8) else do (Do nothing)
        If (Playername Equal to J) then do (Set RandomizeCode = 7) else do (Do nothing)
        If (Playername Equal to K) then do (Set RandomizeCode = 13) else do (Do nothing)
        If (Playername Equal to L) then do (Set RandomizeCode = 12) else do (Do nothing)
        If (Playername Equal to M) then do (Set RandomizeCode = 10) else do (Do nothing)
        If (Playername Equal to N) then do (Set RandomizeCode = 16) else do (Do nothing)
        If (Playername Equal to O) then do (Set RandomizeCode = 17) else do (Do nothing)
        If (Playername Equal to P) then do (Set RandomizeCode = 11) else do (Do nothing)
        If (Playername Equal to Q) then do (Set RandomizeCode = 14) else do (Do nothing)
        If (Playername Equal to R) then do (Set RandomizeCode = 1) else do (Do nothing)
        If (Playername Equal to S) then do (Set RandomizeCode = 4) else do (Do nothing)
        If (Playername Equal to T) then do (Set RandomizeCode = 5) else do (Do nothing)
        If (Playername Equal to U) then do (Set RandomizeCode = 6) else do (Do nothing)
        If (Playername Equal to V) then do (Set RandomizeCode = 15) else do (Do nothing)
        If (Playername Equal to W) then do (Set RandomizeCode = 9) else do (Do nothing)
        If (Playername Equal to X) then do (Set RandomizeCode = 2) else do (Do nothing)
        If (Playername Equal to Y) then do (Set RandomizeCode = 3) else do (Do nothing)
        If (Playername Equal to Z) then do (Set RandomizeCode = 4) else do (Do nothing)

Code:
Base10 to Base32
    Events
    Conditions
    Actions
        For each (Integer A) from 0 to 2, do (Set Base32Int[(Integer A)] = 0)
        Set Base10Convert = Base10Input
        For each (Integer WhileLoop) from 1 to 31, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Base10Convert Greater than or equal to 1024
                    Then - Actions
                        Set Base10Convert = (Base10Convert - 1024)
                        Set Base32Int[2] = (Base32Int[2] + 1)
                    Else - Actions
                        For each (Integer WhileLoop) from 1 to 31, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Base10Convert Greater than or equal to 32
                                    Then - Actions
                                        Set Base10Convert = (Base10Convert - 32)
                                        Set Base32Int[1] = (Base32Int[1] + 1)
                                    Else - Actions
                                        Set Base32Int[0] = Base10Convert
                                        Set WhileLoop = 31
                        Set WhileLoop = 31
        For each (Integer A) from 0 to 2, do (Actions)
            Loop - Actions
                If (Base32Int[(Integer A)] Equal to 23) then do (Set Base32String[(Integer A)] = 0) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 26) then do (Set Base32String[(Integer A)] = 1) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 17) then do (Set Base32String[(Integer A)] = 2) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 24) then do (Set Base32String[(Integer A)] = 3) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 6) then do (Set Base32String[(Integer A)] = 4) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 5) then do (Set Base32String[(Integer A)] = 5) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 11) then do (Set Base32String[(Integer A)] = 6) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 4) then do (Set Base32String[(Integer A)] = 7) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 10) then do (Set Base32String[(Integer A)] = 8) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 13) then do (Set Base32String[(Integer A)] = 9) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 0) then do (Set Base32String[(Integer A)] = a) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 9) then do (Set Base32String[(Integer A)] = b) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 18) then do (Set Base32String[(Integer A)] = c) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 31) then do (Set Base32String[(Integer A)] = d) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 1) then do (Set Base32String[(Integer A)] = e) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 21) then do (Set Base32String[(Integer A)] = f) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 30) then do (Set Base32String[(Integer A)] = g) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 27) then do (Set Base32String[(Integer A)] = h) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 25) then do (Set Base32String[(Integer A)] = i) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 3) then do (Set Base32String[(Integer A)] = k) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 8) then do (Set Base32String[(Integer A)] = m) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 2) then do (Set Base32String[(Integer A)] = n) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 14) then do (Set Base32String[(Integer A)] = p) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 22) then do (Set Base32String[(Integer A)] = r) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 16) then do (Set Base32String[(Integer A)] = s) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 7) then do (Set Base32String[(Integer A)] = t) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 12) then do (Set Base32String[(Integer A)] = u) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 15) then do (Set Base32String[(Integer A)] = v) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 28) then do (Set Base32String[(Integer A)] = w) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 20) then do (Set Base32String[(Integer A)] = x) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 29) then do (Set Base32String[(Integer A)] = y) else do (Do nothing)
                If (Base32Int[(Integer A)] Equal to 19) then do (Set Base32String[(Integer A)] = z) else do (Do nothing)

Code:
Base32 to Base10
    Events
    Conditions
    Actions
        Set Base32String[2] = (Substring(Base32Input, 1, 1))
        Set Base32String[1] = (Substring(Base32Input, 2, 2))
        Set Base32String[0] = (Substring(Base32Input, 3, 3))
        For each (Integer A) from 0 to 2, do (Actions)
            Loop - Actions
                If (Base32String[(Integer A)] Equal to 0) then do (Set Base32Int[(Integer A)] = 23) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 1) then do (Set Base32Int[(Integer A)] = 26) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 2) then do (Set Base32Int[(Integer A)] = 17) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 3) then do (Set Base32Int[(Integer A)] = 24) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 4) then do (Set Base32Int[(Integer A)] = 6) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 5) then do (Set Base32Int[(Integer A)] = 5) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 6) then do (Set Base32Int[(Integer A)] = 11) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 7) then do (Set Base32Int[(Integer A)] = 4) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 8) then do (Set Base32Int[(Integer A)] = 10) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to 9) then do (Set Base32Int[(Integer A)] = 13) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to a) then do (Set Base32Int[(Integer A)] = 0) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to b) then do (Set Base32Int[(Integer A)] = 9) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to c) then do (Set Base32Int[(Integer A)] = 18) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to d) then do (Set Base32Int[(Integer A)] = 31) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to e) then do (Set Base32Int[(Integer A)] = 1) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to f) then do (Set Base32Int[(Integer A)] = 21) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to g) then do (Set Base32Int[(Integer A)] = 30) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to h) then do (Set Base32Int[(Integer A)] = 27) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to i) then do (Set Base32Int[(Integer A)] = 25) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to k) then do (Set Base32Int[(Integer A)] = 3) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to m) then do (Set Base32Int[(Integer A)] = 8) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to n) then do (Set Base32Int[(Integer A)] = 2) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to p) then do (Set Base32Int[(Integer A)] = 14) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to r) then do (Set Base32Int[(Integer A)] = 22) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to s) then do (Set Base32Int[(Integer A)] = 16) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to t) then do (Set Base32Int[(Integer A)] = 7) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to u) then do (Set Base32Int[(Integer A)] = 12) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to v) then do (Set Base32Int[(Integer A)] = 15) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to w) then do (Set Base32Int[(Integer A)] = 28) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to x) then do (Set Base32Int[(Integer A)] = 20) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to y) then do (Set Base32Int[(Integer A)] = 29) else do (Do nothing)
                If (Base32String[(Integer A)] Equal to z) then do (Set Base32Int[(Integer A)] = 19) else do (Do nothing)
        Set Base10Output = (((Base32Int[2] x 1024) + (Base32Int[1] x 32)) + Base32Int[0])

Code:
Save Char
    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
        Player - Player 5 (Yellow) types a chat message containing -save as An exact match
        Player - Player 6 (Orange) types a chat message containing -save as An exact match
        Player - Player 7 (Green) types a chat message containing -save as An exact match
        Player - Player 8 (Pink) types a chat message containing -save as An exact match
        Player - Player 9 (Gray) types a chat message containing -save as An exact match
        Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
        Player - Player 11 (Dark Green) types a chat message containing -save as An exact match
    Conditions
        (Substring((Entered chat string), 1, 5)) Equal to -save
    Actions
        Trigger - Turn off (This trigger)
        Set Part1 = NONE
        Set LevelCode = (Hero level of Hero[(Player number of (Triggering player))])
        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
                        HeroType[(Integer A)] Equal to (Unit-type of Hero[(Player number of (Triggering player))])
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Integer A) Less than 10
                            Then - Actions
                                Set Part1 = (0 + (String((Integer A))))
                            Else - Actions
                                Set Part1 = (String((Integer A)))
                    Else - Actions
        If (Part1 Not equal to NONE) then do (Set SavingHero = Hero[(Player number of (Triggering player))]) else do (Do nothing)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Part1 Equal to NONE
            Then - Actions
                Game - Display to (Player group((Triggering player))) the text: ERROR:No Hero Found...
                Trigger - Turn on (This trigger)
                Skip remaining actions
            Else - Actions
        Set Playername = (Name of (Triggering player))
        Trigger - Run Randomize <gen> (ignoring conditions)
        Set Base10Input = ((Integer(Part1)) x RandomizeCode)
        Trigger - Run Base10 to Base32 <gen> (ignoring conditions)
        Set SaveCode[0] = (Base32String[1] + Base32String[0])
        Set Base10Input = ((LevelCode x RandomizeCode) x (((Integer(Part1)) mod 9) + 1))
        Trigger - Run Base10 to Base32 <gen> (ignoring conditions)
        Set SaveCode[1] = ((Base32String[2] + Base32String[1]) + Base32String[0])
        For each (Integer A) from 0 to 5, do (Set CarriedItems[(Integer A)] = 500)
        For each (Integer B) from 0 to 5, do (Actions)
            Loop - Actions
                For each (Integer A) from 100 to 499, do (Actions)
                    Loop - Actions
                        If ((Item-type of (Item carried by SavingHero in slot ((Integer B) + 1))) Equal to InitializeItems[(Integer A)]) then do (Set CarriedItems[(Integer B)] = (Integer A)) else do (Do nothing)
        For each (Integer WhileLoop) from 0 to 4, do (Actions)
            Loop - Actions
                For each (Integer B) from (WhileLoop + 1) to 5, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                CarriedItems[WhileLoop] Greater than CarriedItems[(Integer B)]
                            Then - Actions
                                Set SortTempInt = CarriedItems[WhileLoop]
                                Set CarriedItems[WhileLoop] = CarriedItems[(Integer B)]
                                Set CarriedItems[(Integer B)] = SortTempInt
                            Else - Actions
        For each (Integer B) from 0 to 5, do (Actions)
            Loop - Actions
                Set Base10Input = (((Integer(Part1)) + (Integer B)) + ((CarriedItems[(Integer B)] - 100) x ((RandomizeCode mod 2) + 1)))
                Trigger - Run Base10 to Base32 <gen> (ignoring conditions)
                Set SaveCode[((Integer B) + 2)] = (Base32String[1] + Base32String[0])
        Set FinalCode = (((SaveCode[0] + SaveCode[1]) + (SaveCode[2] + SaveCode[3])) + ((SaveCode[4] + SaveCode[5]) + (SaveCode[6] + SaveCode[7])))
        Game - Display to (Player group((Triggering player))) for 200.00 seconds the text: (((Character:  + (Proper name of Hero[(Player number of (Triggering player))])) +  - ) + (Loading Code:  + FinalCode))
        Trigger - Turn on (This trigger)

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 23
            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)))
        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)
        Trigger - Turn on (This trigger)

Code:
Initialize Items
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        For each (Integer A) from 100 to 499, do (Set InitializeItems[(Integer A)] = Unknown Item)
        Set MaxSavableHeroes = 4
        Set MaxLevel = 999
        Set HeroType[1] = Paladin
        Set HeroType[2] = Archimage
        Set HeroType[3] = Mountain King
        Set HeroType[4] = Blood Mage
 

C-Death

I love you
Reaction score
45
?

Lol, is there any way to copy this code, and paste it as a trigger?
but thanks :banghead:
 

Sim

Forum Administrator
Staff member
Reaction score
534
There is a map coming along with his post...

copy triggers from there.
 

Chocobo

White-Flower
Reaction score
409
Part 1

Code:
function Trig_Detect_Hero_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Detect_Hero_Actions takes nothing returns nothing
    set udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetTriggerUnit()
endfunction

//===========================================================================
function InitTrig_Detect_Hero takes nothing returns nothing
    set gg_trg_Detect_Hero = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Detect_Hero, GetPlayableMapRect() )
    call TriggerAddCondition( gg_trg_Detect_Hero, Condition( function Trig_Detect_Hero_Conditions ) )
    call TriggerAddAction( gg_trg_Detect_Hero, function Trig_Detect_Hero_Actions )
endfunction

Code:
function Trig_Randomize_Func003001 takes nothing returns boolean
    return ( udg_Playername == "a" )
endfunction

function Trig_Randomize_Func004001 takes nothing returns boolean
    return ( udg_Playername == "b" )
endfunction

function Trig_Randomize_Func005001 takes nothing returns boolean
    return ( udg_Playername == "c" )
endfunction

function Trig_Randomize_Func006001 takes nothing returns boolean
    return ( udg_Playername == "d" )
endfunction

function Trig_Randomize_Func007001 takes nothing returns boolean
    return ( udg_Playername == "e" )
endfunction

function Trig_Randomize_Func008001 takes nothing returns boolean
    return ( udg_Playername == "f" )
endfunction

function Trig_Randomize_Func009001 takes nothing returns boolean
    return ( udg_Playername == "g" )
endfunction

function Trig_Randomize_Func010001 takes nothing returns boolean
    return ( udg_Playername == "h" )
endfunction

function Trig_Randomize_Func011001 takes nothing returns boolean
    return ( udg_Playername == "i" )
endfunction

function Trig_Randomize_Func012001 takes nothing returns boolean
    return ( udg_Playername == "j" )
endfunction

function Trig_Randomize_Func013001 takes nothing returns boolean
    return ( udg_Playername == "k" )
endfunction

function Trig_Randomize_Func014001 takes nothing returns boolean
    return ( udg_Playername == "l" )
endfunction

function Trig_Randomize_Func015001 takes nothing returns boolean
    return ( udg_Playername == "m" )
endfunction

function Trig_Randomize_Func016001 takes nothing returns boolean
    return ( udg_Playername == "n" )
endfunction

function Trig_Randomize_Func017001 takes nothing returns boolean
    return ( udg_Playername == "o" )
endfunction

function Trig_Randomize_Func018001 takes nothing returns boolean
    return ( udg_Playername == "p" )
endfunction

function Trig_Randomize_Func019001 takes nothing returns boolean
    return ( udg_Playername == "q" )
endfunction

function Trig_Randomize_Func020001 takes nothing returns boolean
    return ( udg_Playername == "r" )
endfunction

function Trig_Randomize_Func021001 takes nothing returns boolean
    return ( udg_Playername == "s" )
endfunction

function Trig_Randomize_Func022001 takes nothing returns boolean
    return ( udg_Playername == "t" )
endfunction

function Trig_Randomize_Func023001 takes nothing returns boolean
    return ( udg_Playername == "u" )
endfunction

function Trig_Randomize_Func024001 takes nothing returns boolean
    return ( udg_Playername == "v" )
endfunction

function Trig_Randomize_Func025001 takes nothing returns boolean
    return ( udg_Playername == "w" )
endfunction

function Trig_Randomize_Func026001 takes nothing returns boolean
    return ( udg_Playername == "x" )
endfunction

function Trig_Randomize_Func027001 takes nothing returns boolean
    return ( udg_Playername == "y" )
endfunction

function Trig_Randomize_Func028001 takes nothing returns boolean
    return ( udg_Playername == "z" )
endfunction

function Trig_Randomize_Func029001 takes nothing returns boolean
    return ( udg_Playername == "A" )
endfunction

function Trig_Randomize_Func030001 takes nothing returns boolean
    return ( udg_Playername == "B" )
endfunction

function Trig_Randomize_Func031001 takes nothing returns boolean
    return ( udg_Playername == "C" )
endfunction

function Trig_Randomize_Func032001 takes nothing returns boolean
    return ( udg_Playername == "D" )
endfunction

function Trig_Randomize_Func033001 takes nothing returns boolean
    return ( udg_Playername == "E" )
endfunction

function Trig_Randomize_Func034001 takes nothing returns boolean
    return ( udg_Playername == "F" )
endfunction

function Trig_Randomize_Func035001 takes nothing returns boolean
    return ( udg_Playername == "G" )
endfunction

function Trig_Randomize_Func036001 takes nothing returns boolean
    return ( udg_Playername == "H" )
endfunction

function Trig_Randomize_Func037001 takes nothing returns boolean
    return ( udg_Playername == "I" )
endfunction

function Trig_Randomize_Func038001 takes nothing returns boolean
    return ( udg_Playername == "J" )
endfunction

function Trig_Randomize_Func039001 takes nothing returns boolean
    return ( udg_Playername == "K" )
endfunction

function Trig_Randomize_Func040001 takes nothing returns boolean
    return ( udg_Playername == "L" )
endfunction

function Trig_Randomize_Func041001 takes nothing returns boolean
    return ( udg_Playername == "M" )
endfunction

function Trig_Randomize_Func042001 takes nothing returns boolean
    return ( udg_Playername == "N" )
endfunction

function Trig_Randomize_Func043001 takes nothing returns boolean
    return ( udg_Playername == "O" )
endfunction

function Trig_Randomize_Func044001 takes nothing returns boolean
    return ( udg_Playername == "P" )
endfunction

function Trig_Randomize_Func045001 takes nothing returns boolean
    return ( udg_Playername == "Q" )
endfunction

function Trig_Randomize_Func046001 takes nothing returns boolean
    return ( udg_Playername == "R" )
endfunction

function Trig_Randomize_Func047001 takes nothing returns boolean
    return ( udg_Playername == "S" )
endfunction

function Trig_Randomize_Func048001 takes nothing returns boolean
    return ( udg_Playername == "T" )
endfunction

function Trig_Randomize_Func049001 takes nothing returns boolean
    return ( udg_Playername == "U" )
endfunction

function Trig_Randomize_Func050001 takes nothing returns boolean
    return ( udg_Playername == "V" )
endfunction

function Trig_Randomize_Func051001 takes nothing returns boolean
    return ( udg_Playername == "W" )
endfunction

function Trig_Randomize_Func052001 takes nothing returns boolean
    return ( udg_Playername == "X" )
endfunction

function Trig_Randomize_Func053001 takes nothing returns boolean
    return ( udg_Playername == "Y" )
endfunction

function Trig_Randomize_Func054001 takes nothing returns boolean
    return ( udg_Playername == "Z" )
endfunction

function Trig_Randomize_Actions takes nothing returns nothing
    set udg_Playername = SubStringBJ(udg_Playername, 1, 1)
    set udg_RandomizeCode = 17
    if ( Trig_Randomize_Func003001() ) then
        set udg_RandomizeCode = 17
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func004001() ) then
        set udg_RandomizeCode = 5
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func005001() ) then
        set udg_RandomizeCode = 16
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func006001() ) then
        set udg_RandomizeCode = 8
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func007001() ) then
        set udg_RandomizeCode = 4
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func008001() ) then
        set udg_RandomizeCode = 7
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func009001() ) then
        set udg_RandomizeCode = 1
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func010001() ) then
        set udg_RandomizeCode = 15
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func011001() ) then
        set udg_RandomizeCode = 10
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func012001() ) then
        set udg_RandomizeCode = 12
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func013001() ) then
        set udg_RandomizeCode = 9
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func014001() ) then
        set udg_RandomizeCode = 3
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func015001() ) then
        set udg_RandomizeCode = 6
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func016001() ) then
        set udg_RandomizeCode = 11
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func017001() ) then
        set udg_RandomizeCode = 2
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func018001() ) then
        set udg_RandomizeCode = 14
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func019001() ) then
        set udg_RandomizeCode = 13
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func020001() ) then
        set udg_RandomizeCode = 11
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func021001() ) then
        set udg_RandomizeCode = 6
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func022001() ) then
        set udg_RandomizeCode = 5
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func023001() ) then
        set udg_RandomizeCode = 1
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func024001() ) then
        set udg_RandomizeCode = 8
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func025001() ) then
        set udg_RandomizeCode = 17
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func026001() ) then
        set udg_RandomizeCode = 15
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func027001() ) then
        set udg_RandomizeCode = 9
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func028001() ) then
        set udg_RandomizeCode = 16
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func029001() ) then
        set udg_RandomizeCode = 14
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func030001() ) then
        set udg_RandomizeCode = 13
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func031001() ) then
        set udg_RandomizeCode = 10
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func032001() ) then
        set udg_RandomizeCode = 4
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func033001() ) then
        set udg_RandomizeCode = 12
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func034001() ) then
        set udg_RandomizeCode = 2
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func035001() ) then
        set udg_RandomizeCode = 3
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func036001() ) then
        set udg_RandomizeCode = 7
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func037001() ) then
        set udg_RandomizeCode = 8
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func038001() ) then
        set udg_RandomizeCode = 7
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func039001() ) then
        set udg_RandomizeCode = 13
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func040001() ) then
        set udg_RandomizeCode = 12
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func041001() ) then
        set udg_RandomizeCode = 10
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func042001() ) then
        set udg_RandomizeCode = 16
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func043001() ) then
        set udg_RandomizeCode = 17
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func044001() ) then
        set udg_RandomizeCode = 11
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func045001() ) then
        set udg_RandomizeCode = 14
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func046001() ) then
        set udg_RandomizeCode = 1
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func047001() ) then
        set udg_RandomizeCode = 4
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func048001() ) then
        set udg_RandomizeCode = 5
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func049001() ) then
        set udg_RandomizeCode = 6
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func050001() ) then
        set udg_RandomizeCode = 15
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func051001() ) then
        set udg_RandomizeCode = 9
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func052001() ) then
        set udg_RandomizeCode = 2
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func053001() ) then
        set udg_RandomizeCode = 3
    else
        call DoNothing(  )
    endif
    if ( Trig_Randomize_Func054001() ) then
        set udg_RandomizeCode = 4
    else
        call DoNothing(  )
    endif
endfunction

//===========================================================================
function InitTrig_Randomize takes nothing returns nothing
    set gg_trg_Randomize = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Randomize, function Trig_Randomize_Actions )
endfunction

Code:
function Trig_Base10_to_Base32_Func003Func001Func001Func001C takes nothing returns boolean
    if ( not ( udg_Base10Convert >= 32 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Base10_to_Base32_Func003Func001C takes nothing returns boolean
    if ( not ( udg_Base10Convert >= 1024 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Base10_to_Base32_Func004Func001001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 23 )
endfunction

function Trig_Base10_to_Base32_Func004Func002001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 26 )
endfunction

function Trig_Base10_to_Base32_Func004Func003001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 17 )
endfunction

function Trig_Base10_to_Base32_Func004Func004001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 24 )
endfunction

function Trig_Base10_to_Base32_Func004Func005001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 6 )
endfunction

function Trig_Base10_to_Base32_Func004Func006001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 5 )
endfunction

function Trig_Base10_to_Base32_Func004Func007001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 11 )
endfunction

function Trig_Base10_to_Base32_Func004Func008001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 4 )
endfunction

function Trig_Base10_to_Base32_Func004Func009001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 10 )
endfunction

function Trig_Base10_to_Base32_Func004Func010001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 13 )
endfunction

function Trig_Base10_to_Base32_Func004Func011001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 0 )
endfunction

function Trig_Base10_to_Base32_Func004Func012001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 9 )
endfunction

function Trig_Base10_to_Base32_Func004Func013001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 18 )
endfunction

function Trig_Base10_to_Base32_Func004Func014001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 31 )
endfunction

function Trig_Base10_to_Base32_Func004Func015001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 1 )
endfunction

function Trig_Base10_to_Base32_Func004Func016001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 21 )
endfunction

function Trig_Base10_to_Base32_Func004Func017001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 30 )
endfunction

function Trig_Base10_to_Base32_Func004Func018001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 27 )
endfunction

function Trig_Base10_to_Base32_Func004Func019001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 25 )
endfunction

function Trig_Base10_to_Base32_Func004Func020001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 3 )
endfunction

function Trig_Base10_to_Base32_Func004Func021001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 8 )
endfunction

function Trig_Base10_to_Base32_Func004Func022001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 2 )
endfunction

function Trig_Base10_to_Base32_Func004Func023001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 14 )
endfunction

function Trig_Base10_to_Base32_Func004Func024001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 22 )
endfunction

function Trig_Base10_to_Base32_Func004Func025001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 16 )
endfunction

function Trig_Base10_to_Base32_Func004Func026001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 7 )
endfunction

function Trig_Base10_to_Base32_Func004Func027001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 12 )
endfunction

function Trig_Base10_to_Base32_Func004Func028001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 15 )
endfunction

function Trig_Base10_to_Base32_Func004Func029001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 28 )
endfunction

function Trig_Base10_to_Base32_Func004Func030001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 20 )
endfunction

function Trig_Base10_to_Base32_Func004Func031001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 29 )
endfunction

function Trig_Base10_to_Base32_Func004Func032001 takes nothing returns boolean
    return ( udg_Base32Int[GetForLoopIndexA()] == 19 )
endfunction

function Trig_Base10_to_Base32_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 0
    set bj_forLoopAIndexEnd = 2
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_Base32Int[GetForLoopIndexA()] = 0
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set udg_Base10Convert = udg_Base10Input
    set udg_WhileLoop = 1
    loop
        exitwhen udg_WhileLoop > 31
        if ( Trig_Base10_to_Base32_Func003Func001C() ) then
            set udg_Base10Convert = ( udg_Base10Convert - 1024 )
            set udg_Base32Int[2] = ( udg_Base32Int[2] + 1 )
        else
            set udg_WhileLoop = 1
            loop
                exitwhen udg_WhileLoop > 31
                if ( Trig_Base10_to_Base32_Func003Func001Func001Func001C() ) then
                    set udg_Base10Convert = ( udg_Base10Convert - 32 )
                    set udg_Base32Int[1] = ( udg_Base32Int[1] + 1 )
                else
                    set udg_Base32Int[0] = udg_Base10Convert
                    set udg_WhileLoop = 31
                endif
                set udg_WhileLoop = udg_WhileLoop + 1
            endloop
            set udg_WhileLoop = 31
        endif
        set udg_WhileLoop = udg_WhileLoop + 1
    endloop
    set bj_forLoopAIndex = 0
    set bj_forLoopAIndexEnd = 2
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Base10_to_Base32_Func004Func001001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "0"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func002001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "1"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func003001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "2"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func004001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "3"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func005001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "4"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func006001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "5"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func007001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "6"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func008001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "7"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func009001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "8"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func010001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "9"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func011001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "a"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func012001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "b"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func013001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "c"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func014001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "d"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func015001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "e"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func016001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "f"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func017001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "g"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func018001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "h"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func019001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "i"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func020001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "k"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func021001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "m"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func022001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "n"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func023001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "p"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func024001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "r"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func025001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "s"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func026001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "t"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func027001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "u"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func028001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "v"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func029001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "w"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func030001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "x"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func031001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "y"
        else
            call DoNothing(  )
        endif
        if ( Trig_Base10_to_Base32_Func004Func032001() ) then
            set udg_Base32String[GetForLoopIndexA()] = "z"
        else
            call DoNothing(  )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Base10_to_Base32 takes nothing returns nothing
    set gg_trg_Base10_to_Base32 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Base10_to_Base32, function Trig_Base10_to_Base32_Actions )
endfunction

Code:
function Trig_Base32_to_Base10_Func004Func001001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "0" )
endfunction

function Trig_Base32_to_Base10_Func004Func002001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "1" )
endfunction

function Trig_Base32_to_Base10_Func004Func003001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "2" )
endfunction

function Trig_Base32_to_Base10_Func004Func004001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "3" )
endfunction

function Trig_Base32_to_Base10_Func004Func005001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "4" )
endfunction

function Trig_Base32_to_Base10_Func004Func006001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "5" )
endfunction

function Trig_Base32_to_Base10_Func004Func007001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "6" )
endfunction

function Trig_Base32_to_Base10_Func004Func008001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "7" )
endfunction

function Trig_Base32_to_Base10_Func004Func009001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "8" )
endfunction

function Trig_Base32_to_Base10_Func004Func010001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "9" )
endfunction

function Trig_Base32_to_Base10_Func004Func011001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "a" )
endfunction

function Trig_Base32_to_Base10_Func004Func012001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "b" )
endfunction

function Trig_Base32_to_Base10_Func004Func013001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "c" )
endfunction

function Trig_Base32_to_Base10_Func004Func014001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "d" )
endfunction

function Trig_Base32_to_Base10_Func004Func015001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "e" )
endfunction

function Trig_Base32_to_Base10_Func004Func016001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "f" )
endfunction

function Trig_Base32_to_Base10_Func004Func017001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "g" )
endfunction

function Trig_Base32_to_Base10_Func004Func018001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "h" )
endfunction

function Trig_Base32_to_Base10_Func004Func019001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "i" )
endfunction

function Trig_Base32_to_Base10_Func004Func020001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "k" )
endfunction

function Trig_Base32_to_Base10_Func004Func021001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "m" )
endfunction

function Trig_Base32_to_Base10_Func004Func022001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "n" )
endfunction

function Trig_Base32_to_Base10_Func004Func023001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "p" )
endfunction

function Trig_Base32_to_Base10_Func004Func024001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "r" )
endfunction

function Trig_Base32_to_Base10_Func004Func025001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "s" )
endfunction

function Trig_Base32_to_Base10_Func004Func026001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "t" )
endfunction

function Trig_Base32_to_Base10_Func004Func027001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "u" )
endfunction

function Trig_Base32_to_Base10_Func004Func028001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "v" )
endfunction

function Trig_Base32_to_Base10_Func004Func029001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "w" )
endfunction

function Trig_Base32_to_Base10_Func004Func030001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "x" )
endfunction

function Trig_Base32_to_Base10_Func004Func031001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "y" )
endfunction

function Trig_Base32_to_Base10_Func004Func032001 takes nothing returns boolean
    return ( udg_Base32String[GetForLoopIndexA()] == "z" )
endfunction

function Trig_Base32_to_Base10_Actions takes nothing returns nothing
    set udg_Base32String[2] = SubStringBJ(udg_Base32Input, 1, 1)
    set udg_Base32String[1] = SubStringBJ(udg_Base32Input, 2, 2)
    set udg_Base32String[0] = SubStringBJ(udg_Base32Input, 3, 3)
    set bj_forLoopAIndex = 0
    set bj_forLoopAIndexEnd = 2
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Base32_to_Base10_Func004Func001001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 23
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func002001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 26
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func003001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 17
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func004001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 24
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func005001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 6
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func006001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 5
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func007001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 11
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func008001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 4
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func009001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 10
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func010001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 13
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func011001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 0
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func012001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 9
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func013001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 18
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func014001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 31
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func015001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 1
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func016001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 21
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func017001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 30
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func018001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 27
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func019001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 25
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func020001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 3
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func021001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 8
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func022001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 2
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func023001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 14
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func024001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 22
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func025001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 16
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func026001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 7
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func027001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 12
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func028001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 15
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func029001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 28
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func030001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 20
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func031001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 29
        else
            call DoNothing(  )
        endif
        if ( Trig_Base32_to_Base10_Func004Func032001() ) then
            set udg_Base32Int[GetForLoopIndexA()] = 19
        else
            call DoNothing(  )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set udg_Base10Output = ( ( ( udg_Base32Int[2] * 1024 ) + ( udg_Base32Int[1] * 32 ) ) + udg_Base32Int[0] )
endfunction

//===========================================================================
function InitTrig_Base32_to_Base10 takes nothing returns nothing
    set gg_trg_Base32_to_Base10 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Base32_to_Base10, function Trig_Base32_to_Base10_Actions )
endfunction
 

Chocobo

White-Flower
Reaction score
409
Part 2

Code:
function Trig_Save_Char_Conditions takes nothing returns boolean
    if ( not ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-save" ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Char_Func004Func001Func001C takes nothing returns boolean
    if ( not ( GetForLoopIndexA() < 10 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Char_Func004Func001C takes nothing returns boolean
    if ( not ( udg_HeroType[GetForLoopIndexA()] == GetUnitTypeId(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())]) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Char_Func005001 takes nothing returns boolean
    return ( udg_Part1 != "NONE" )
endfunction

function Trig_Save_Char_Func007C takes nothing returns boolean
    if ( not ( udg_Part1 == "NONE" ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Char_Func017Func001Func001001 takes nothing returns boolean
    return ( GetItemTypeId(UnitItemInSlotBJ(udg_SavingHero, ( GetForLoopIndexB() + 1 ))) == udg_InitializeItems[GetForLoopIndexA()] )
endfunction

function Trig_Save_Char_Func018Func001Func001C takes nothing returns boolean
    if ( not ( udg_CarriedItems[udg_WhileLoop] > udg_CarriedItems[GetForLoopIndexB()] ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Char_Actions takes nothing returns nothing
    call DisableTrigger( GetTriggeringTrigger() )
    set udg_Part1 = "NONE"
    set udg_LevelCode = GetHeroLevel(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())])
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = udg_MaxSavableHeroes
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Save_Char_Func004Func001C() ) then
            if ( Trig_Save_Char_Func004Func001Func001C() ) then
                set udg_Part1 = ( "0" + I2S(GetForLoopIndexA()) )
            else
                set udg_Part1 = I2S(GetForLoopIndexA())
            endif
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    if ( Trig_Save_Char_Func005001() ) then
        set udg_SavingHero = udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())]
    else
        call DoNothing(  )
    endif
    if ( Trig_Save_Char_Func007C() ) then
        call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_008" )
        call EnableTrigger( GetTriggeringTrigger() )
        return
    else
    endif
    set udg_Playername = GetPlayerName(GetTriggerPlayer())
    call TriggerExecute( gg_trg_Randomize )
    set udg_Base10Input = ( S2I(udg_Part1) * udg_RandomizeCode )
    call TriggerExecute( gg_trg_Base10_to_Base32 )
    set udg_SaveCode[0] = ( udg_Base32String[1] + udg_Base32String[0] )
    set udg_Base10Input = ( ( udg_LevelCode * udg_RandomizeCode ) * ( ModuloInteger(S2I(udg_Part1), 9) + 1 ) )
    call TriggerExecute( gg_trg_Base10_to_Base32 )
    set udg_SaveCode[1] = ( ( udg_Base32String[2] + udg_Base32String[1] ) + udg_Base32String[0] )
    set bj_forLoopAIndex = 0
    set bj_forLoopAIndexEnd = 5
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_CarriedItems[GetForLoopIndexA()] = 500
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set bj_forLoopBIndex = 0
    set bj_forLoopBIndexEnd = 5
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        set bj_forLoopAIndex = 100
        set bj_forLoopAIndexEnd = 499
        loop
            exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
            if ( Trig_Save_Char_Func017Func001Func001001() ) then
                set udg_CarriedItems[GetForLoopIndexB()] = GetForLoopIndexA()
            else
                call DoNothing(  )
            endif
            set bj_forLoopAIndex = bj_forLoopAIndex + 1
        endloop
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    set udg_WhileLoop = 0
    loop
        exitwhen udg_WhileLoop > 4
        set bj_forLoopBIndex = ( udg_WhileLoop + 1 )
        set bj_forLoopBIndexEnd = 5
        loop
            exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
            if ( Trig_Save_Char_Func018Func001Func001C() ) then
                set udg_SortTempInt = udg_CarriedItems[udg_WhileLoop]
                set udg_CarriedItems[udg_WhileLoop] = udg_CarriedItems[GetForLoopIndexB()]
                set udg_CarriedItems[GetForLoopIndexB()] = udg_SortTempInt
            else
            endif
            set bj_forLoopBIndex = bj_forLoopBIndex + 1
        endloop
        set udg_WhileLoop = udg_WhileLoop + 1
    endloop
    set bj_forLoopBIndex = 0
    set bj_forLoopBIndexEnd = 5
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        set udg_Base10Input = ( ( S2I(udg_Part1) + GetForLoopIndexB() ) + ( ( udg_CarriedItems[GetForLoopIndexB()] - 100 ) * ( ModuloInteger(udg_RandomizeCode, 2) + 1 ) ) )
        call TriggerExecute( gg_trg_Base10_to_Base32 )
        set udg_SaveCode[( GetForLoopIndexB() + 2 )] = ( udg_Base32String[1] + udg_Base32String[0] )
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    set udg_FinalCode = ( ( ( udg_SaveCode[0] + udg_SaveCode[1] ) + ( udg_SaveCode[2] + udg_SaveCode[3] ) ) + ( ( udg_SaveCode[4] + udg_SaveCode[5] ) + ( udg_SaveCode[6] + udg_SaveCode[7] ) ) )
    call DisplayTimedTextToForce( GetForceOfPlayer(GetTriggerPlayer()), 200.00, ( ( ( "Character: " + GetHeroProperName(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())]) ) + " - " ) + ( "Loading Code: " + udg_FinalCode ) ) )
    call EnableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Save_Char takes nothing returns nothing
    set gg_trg_Save_Char = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(0), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(1), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(2), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(3), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(4), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(5), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(6), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(7), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(8), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(9), "-save", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_Save_Char, Player(10), "-save", true )
    call TriggerAddCondition( gg_trg_Save_Char, Condition( function Trig_Save_Char_Conditions ) )
    call TriggerAddAction( gg_trg_Save_Char, function Trig_Save_Char_Actions )
endfunction

Code:
function Trig_Load_Char_Conditions takes nothing returns boolean
    if ( not ( SubStringBJ(GetEventPlayerChatString(), 1, 5) == "-load" ) ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Func002C takes nothing returns boolean
    if ( not ( StringLength(GetEventPlayerChatString()) != 23 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Func013Func002C takes nothing returns boolean
    if ( ( udg_UnitNumber > udg_MaxSavableHeroes ) ) then
        return true
    endif
    if ( ( udg_UnitNumber < 1 ) ) then
        return true
    endif
    if ( ( udg_LoadLevel > udg_MaxLevel ) ) then
        return true
    endif
    if ( ( udg_LoadLevel < 0 ) ) then
        return true
    endif
    return false
endfunction

function Trig_Load_Char_Func013C takes nothing returns boolean
    if ( not Trig_Load_Char_Func013Func002C() ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Func014Func001C takes nothing returns boolean
    if ( not ( udg_UnitNumber == GetForLoopIndexA() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Func017Func005Func001C takes nothing returns boolean
    if ( not ( udg_ItemNumber == 500 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Func017Func005Func003Func001001 takes nothing returns boolean
    return ( udg_ItemNumber < 100 )
endfunction

function Trig_Load_Char_Func017Func005Func003Func001002 takes nothing returns boolean
    return ( udg_ItemNumber > 499 )
endfunction

function Trig_Load_Char_Func017Func005Func003C takes nothing returns boolean
    if ( GetBooleanOr( Trig_Load_Char_Func017Func005Func003Func001001(), Trig_Load_Char_Func017Func005Func003Func001002() ) ) then
        return true
    endif
    if ( ( udg_InitializeItems[udg_ItemNumber] == 'I000' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Load_Char_Func017Func005C takes nothing returns boolean
    if ( not Trig_Load_Char_Func017Func005Func003C() ) then
        return false
    endif
    return true
endfunction

function Trig_Load_Char_Actions takes nothing returns nothing
    if ( Trig_Load_Char_Func002C() ) then
        call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_012" )
        return
    else
    endif
    call DisableTrigger( GetTriggeringTrigger() )
    set udg_Playername = GetPlayerName(GetTriggerPlayer())
    set udg_LoadString = ( "abcde" + GetEventPlayerChatString() )
    call TriggerExecute( gg_trg_Randomize )
    set udg_Base32Input = ( "a" + SubStringBJ(udg_LoadString, 12, 13) )
    call TriggerExecute( gg_trg_Base32_to_Base10 )
    set udg_UnitNumber = ( udg_Base10Output / udg_RandomizeCode )
    set udg_Base32Input = SubStringBJ(udg_LoadString, 14, 16)
    call TriggerExecute( gg_trg_Base32_to_Base10 )
    set udg_LoadLevel = ( udg_Base10Output / ( udg_RandomizeCode * ( ModuloInteger(udg_UnitNumber, 9) + 1 ) ) )
    if ( Trig_Load_Char_Func013C() ) then
        call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), "TRIGSTR_013" )
        call EnableTrigger( GetTriggeringTrigger() )
        return
    else
        call DoNothing(  )
    endif
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = udg_MaxSavableHeroes
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Load_Char_Func014Func001C() ) then
            call CreateNUnitsAtLoc( 1, udg_HeroType[udg_UnitNumber], GetTriggerPlayer(), GetRectCenter(GetPlayableMapRect()), 0.00 )
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call SetHeroLevelBJ( GetLastCreatedUnit(), udg_LoadLevel, true )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 6
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call UnitRemoveItemFromSlotSwapped( GetForLoopIndexA(), GetLastCreatedUnit() )
        call RemoveItem( GetLastRemovedItem() )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set bj_forLoopBIndex = 0
    set bj_forLoopBIndexEnd = 5
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        set udg_Base32Input = ( "a" + SubStringBJ(udg_LoadString, ( 17 + ( GetForLoopIndexB() * 2 ) ), ( 18 + ( GetForLoopIndexB() * 2 ) )) )
        call TriggerExecute( gg_trg_Base32_to_Base10 )
        set udg_ItemNumber = ( ( udg_Base10Output - ( udg_UnitNumber + GetForLoopIndexB() ) ) / ( ModuloInteger(udg_RandomizeCode, 2) + 1 ) )
        set udg_ItemNumber = ( udg_ItemNumber + 100 )
        if ( Trig_Load_Char_Func017Func005C() ) then
            if ( Trig_Load_Char_Func017Func005Func001C() ) then
                call DoNothing(  )
            else
                call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), ( ( "|c00ff0000ERROR:Code Error Bit |r" + I2S(( GetForLoopIndexB() + 3 )) ) + " Continuing Load..." ) )
            endif
        else
            call UnitAddItemByIdSwapped( udg_InitializeItems[udg_ItemNumber], GetLastCreatedUnit() )
        endif
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    call EnableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Load_Char takes nothing returns nothing
    set gg_trg_Load_Char = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(0), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(1), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(2), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(3), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(4), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(5), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(6), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(7), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(8), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(9), "-load", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Load_Char, Player(10), "-load", false )
    call TriggerAddCondition( gg_trg_Load_Char, Condition( function Trig_Load_Char_Conditions ) )
    call TriggerAddAction( gg_trg_Load_Char, function Trig_Load_Char_Actions )
endfunction

Code:
[COLOR=Red]//===========================================================================
// Trigger: Initialize Items
//
// Define items and heroes type there.
// Up to 399 items from 100 to 499. Below or after makes some bads things.
//===========================================================================
function Trig_Initialize_Items_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 100
    set bj_forLoopAIndexEnd = 499
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_InitializeItems[GetForLoopIndexA()] = 'I000'
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set udg_MaxSavableHeroes = 4
    set udg_MaxLevel = 999
    set udg_HeroType[1] = 'Hpal'
    set udg_HeroType[2] = 'Hamg'
    set udg_HeroType[3] = 'Hmkg'
    set udg_HeroType[4] = 'Hblm'
endfunction[/COLOR]

//===========================================================================
function InitTrig_Initialize_Items takes nothing returns nothing
    set gg_trg_Initialize_Items = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Initialize_Items, 0.00 )
    call TriggerAddAction( gg_trg_Initialize_Items, function Trig_Initialize_Items_Actions )
endfunction
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
When i downloaded this map and saved a charcter tehn tryed to load it but it said errors and when i tryed to save it wouldnt go becuase Set Part1 = NONE then

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Part1 Equal to NONE
Then - Actions
Game - Display to (Player group((Triggering player))) the text: ERROR:No Hero Found...
Trigger - Turn on (This trigger)
Skip remaining actions
Else - Actions

ITs always gonna say this!
Help plz
 

Chocobo

White-Flower
Reaction score
409
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
                        [COLOR=Red]HeroType[(Integer A)] Equal to (Unit-type of Hero[(Player number of (Triggering player))])[/COLOR]
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Integer A) Less than 10
                            Then - Actions
                                Set Part1 = (0 + (String((Integer A))))
                            Else - Actions
                                Set Part1 = (String((Integer A)))

Do you added 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)

Do you defined unit-type and item-type?

Code:
Initialize Items
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        For each (Integer A) from 100 to 499, do (Set InitializeItems[(Integer A)] = Unknown Item)
        [COLOR=Red]Set MaxSavableHeroes = 4
        Set MaxLevel = 999
        Set HeroType[1] = Paladin
        Set HeroType[2] = Archimage
        Set HeroType[3] = Mountain King
        Set HeroType[4] = Blood Mage[/COLOR]
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
yea.. i downloaded the map and it wouldnt work when i tested
 
L

Liquidshock

Guest
Yeah i got the same problem.. i just downloaded the map and when i tried to save the hero, is said "Error - No hero found"...
 

Chocobo

White-Flower
Reaction score
409
Then remove it. It is just for detecting the hero. Better to do is :

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......
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
ok thanks
:D

edit - can u make the code save gold also and test teh code to make sure it works
 

Chocobo

White-Flower
Reaction score
409
Ok I will create it. For the moment, the best to do is :

Code:
[COLOR=Red]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......[/COLOR]

About Gold saving, what how many numbers/letters do you want? For a full gold save, you will need an add-on of 6 letters/numbers, for a medium gold save style, you will need only to add 3 letters/numbers.
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
well since i was having so many problems with ur system i got a new one but yea thanks for trying before


this is the system i use
 

werasd

New Member
Reaction score
14
{Omg...

Hey i did all u said in the topic Chocobo, but when i try to test my map, i put there -save but i receive the Error of Hero not Found...
How can i fix it?
 

Chocobo

White-Flower
Reaction score
409
Does Hero[Player number of (Triggering Player)] returns YOUR HERO?
Did you do InitializeItems Trigger?

Code:
[COLOR=Red]        Set MaxSavableHeroes = 4
        Set MaxLevel = 999
        Set HeroType[1] = Paladin
        Set HeroType[2] = Archimage
        Set HeroType[3] = Mountain King
        Set HeroType[4] = Blood Mage[/COLOR]
In those values you have to modify them as you want.. so does Items..
Code:
Set InitializeItems[X] = X Item
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top