• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ability Save/Load

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hello there.

I have a system that is vital for the campaign The Chosen Ones. It's a JASS made system by some Swedish guy who made it about 2 years ago. After updating the campaign from Alpha versions to Beta versions it mysteriously didn't work like before. I have been trying to fix it time to time without succeed. I thought I fixed already. It seems like my skills aren't enough to fix this so I'm now counting on you.

The system is about adding new abilities to spell books. This works correctly, but the part where the abilities are saved and at next chapter loaded doesn't work. They simply doesn't appear at all.


This system works in a test map, here's everything from the test map:

JASS:
function GetSpellBook takes nothing returns integer
    return 'A6AU'
endfunction

function CreateSpell takes integer itemid, integer spellbookid, integer spellid returns nothing
local integer p = 0
    set udg_Spell_System_last = udg_Spell_System_last + 1
    set udg_Spell_System_item[udg_Spell_System_last] = itemid
    set udg_Spell_System_abil[udg_Spell_System_last] = spellbookid
    set udg_Spell_System_spell[udg_Spell_System_last] = spellid
    loop
        exitwhen p > 12
        call SetPlayerAbilityAvailable(Player(p), udg_Spell_System_abil[udg_Spell_System_last], false)
        set p = p + 1
    endloop
endfunction

function UnitAddSpell takes unit u, integer itemid returns boolean
    local integer i = 0
    set udg_Spell_System_success = false
    loop
        exitwhen i > udg_Spell_System_last
        if (udg_Spell_System_item[i] == itemid) then
            if GetUnitAbilityLevel(u, udg_Spell_System_abil[i]) <= 0 then
                call UnitAddAbility(u, udg_Spell_System_abil[i])
                set udg_Spell_System_success = true
return true
            else
                call SetUnitAbilityLevel(u, udg_Spell_System_spell[i], GetUnitAbilityLevel(u, udg_Spell_System_spell[i]) + 1)
                set udg_Spell_System_success = true
                return true
            endif
        endif
        set i = i + 1
    endloop
    return false
endfunction

function UnitRemoveSpell takes unit u, integer abilid returns boolean
    local integer i = 0
    loop
        exitwhen i > udg_Spell_System_last
        if udg_Spell_System_spell[i] == abilid then
            if GetUnitAbilityLevel(u, udg_Spell_System_abil[i]) <= 0 then
return false
            else
                call UnitRemoveAbility(u, udg_Spell_System_abil[i])
                set udg_Spell_System_success = true
                return true
            endif
        endif
        set i = i + 1
    endloop
    return false
endfunction

function StoreHeroSpells takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    local integer i = 0
    if udg_Spell_System_Active then
loop
            exitwhen i > udg_Spell_System_last
            if GetUnitAbilityLevel(whichunit, udg_Spell_System_abil[i]) > 0 then
                call StoreInteger(cache, missionkey, key + "spell" + I2S(i), GetUnitAbilityLevel(whichunit, udg_Spell_System_spell[i]))
            else
                call StoreInteger(cache, missionkey, key + "spell" + I2S(i), 0)
endif
            set i = i + 1
        endloop
    endif
endfunction

function RestoreHeroSpells takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    local integer i = 0
    if udg_Spell_System_Active then
        loop
            exitwhen i > udg_Spell_System_last
if HaveStoredInteger(cache, missionkey, key + "spell" + I2S(i)) then
                if GetStoredInteger(cache, missionkey, key + "spell" + I2S(i)) > 0 then
                    call UnitAddAbility(whichunit, udg_Spell_System_abil[i])
                    //call BJDebugMsg("Loading spell " + I2S(i) + ": " + I2S(GetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i])))
                    call SetUnitAbilityLevel(whichunit, udg_Spell_System_spell[i], GetStoredInteger(cache, missionkey, key + "spell" + I2S(i)))
                endif
            endif
set i = i + 1
        endloop
    endif
endfunction

function StoreHero takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    call StoreHeroSpells(cache, missionkey, key, whichunit)
    call UnitRemoveAbility(whichunit, GetSpellBook())
    //call TriggerSleepAction(0.0)
    call StoreUnit(cache, missionkey, key, whichunit)
endfunction

function RestoreHero takes gamecache cache, string missionkey, string key, player whichplayer, location whichloc, real angle returns unit
    set bj_lastLoadedUnit = RestoreUnit(cache, missionkey, key, whichplayer, GetLocationX(whichloc), GetLocationY(whichloc), angle)
    call UnitAddAbility(bj_lastLoadedUnit, GetSpellBook())
    call RestoreHeroSpells(cache, missionkey, key, bj_lastLoadedUnit)
    return bj_lastLoadedUnit
endfunction
  • Save Things
    • Events
      • Player - Player 1 (Red) types a chat message containing !S as An exact match
    • Conditions
    • Actions
      • -------- === CREATE GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_12.w3v
      • Set GameCache = (Last created game cache)
      • -------- === SAVE HEROS === --------
      • Custom script: call StoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom", udg_AAAPhodom )
      • Custom script: call StoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz", udg_AAAFradz )
      • Custom script: call StoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth", udg_AAAGaleoth )
      • -------- === SAVE BOXES === --------
      • Game Cache - Store AAPhodom_Box as TCO_Phodom_Box of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAPhodom_Box2 as TCO_Phodom_Box2 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAPhodom_Box3 as TCO_Phodom_Box3 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAPhodom_Box4 as TCO_Phodom_Box4 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAFradz_Box as TCO_Fradz_Box of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAFradz_Box2 as TCO_Fradz_Box2 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAFradz_Box3 as TCO_Fradz_Box3 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAFradz_Box4 as TCO_Fradz_Box4 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAGaleoth_Box as TCO_Galeoth_Box of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAGaleoth_Box2 as TCO_Galeoth_Box2 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAGaleoth_Box3 as TCO_Galeoth_Box3 of TCO_Heroes in (Last created game cache)
      • Game Cache - Store AAGaleoth_Box4 as TCO_Galeoth_Box4 of TCO_Heroes in (Last created game cache)
      • -------- === Campaign Status Bar === --------
      • Game Cache - Store SB_Dies_C as TCO_SB_Dies_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Optional_Q_C as TCO_SB_Optional_Q_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Elite_B_C as TCO_SB_Elite_B_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Epic_B_C as TCO_SB_Epic_B_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Digging_C as TCO_SB_Digging_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_GU_C as TCO_SB_GU_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Kill_C as TCO_SB_Kill_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Dies_C as TCO_SB_Dies_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Easy_C as TCO_SB_Easy_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Normal_C as TCO_SB_Normal_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Hard_C as TCO_SB_Hard_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_Extreme_C as TCO_SB_Extreme_C of TCO_Bar in (Last created game cache)
      • Game Cache - Store SB_TPTC_C[1] as TCO_SB_TPTC_C of TCO_Bar in (Last created game cache)
      • -------- === SAVE SPELLS === --------
      • -------- === PHODOM === --------
      • -------- 1 --------
      • Game Cache - Store (Level of Area Attack (P, X, 2, US) for AAAPhodom) as TCO_Area_Attack of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Level of Avatar (P, R, 2, US) for AAAPhodom) as TCO_Avatar of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Level of Warcry (P, R, 2, US) for AAAPhodom) as TCO_Warcry of TCO_Spells in (Last created game cache)
      • -------- 2 --------
      • Game Cache - Store (Current research level of Meltdown (Single Ability) for Player 1 (Red)) as TCO_Meltdown of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Impact Flare (Single Ability) for Player 1 (Red)) as TCO_Impact_Flare of TCO_Spells in (Last created game cache)
      • -------- 3 --------
      • Game Cache - Store (Current research level of Aura Of Fire (Curse Ability) for Player 1 (Red)) as TCO_Aura_Of_Fire of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Fire Attack (DISABLED CURRENTLY) for Player 1 (Red)) as TCO_Fire_Attack of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Summon Fire Element (Curse Ability) for Player 1 (Red)) as TCO_Summon_Fire_Element of TCO_Spells in (Last created game cache)
      • -------- 4 --------
      • Game Cache - Store (Current research level of Flame Explosion (AoE Ability) for Player 1 (Red)) as TCO_Flame_Explosion of TCO_Spells in (Last created game cache)
      • -------- 5 --------
      • Game Cache - Store (Current research level of Shield Of Fire (Heal Ability) for Player 1 (Red)) as TCO_Shield_Of_Fire of TCO_Spells in (Last created game cache)
      • -------- 6 --------
      • Game Cache - Store (Current research level of Chaotic Rift (Ultimate Ability) for Player 1 (Red)) as TCO_Chaotic_Rift of TCO_Spells in (Last created game cache)
      • -------- === FRADZ === --------
      • -------- 1 --------
      • Game Cache - Store (Level of Sword Dance (F, E, 2, US) for AAAFradz) as TCO_Sword_Dance of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Level of Illusory Double (F, Y, 2, US) for AAAFradz) as TCO_Illusory_Double of TCO_Spells in (Last created game cache)
      • -------- 2 --------
      • Game Cache - Store (Current research level of Thunder (Single Ability) for Player 1 (Red)) as TCO_Thunder of TCO_Spells in (Last created game cache)
      • -------- 3 --------
      • Game Cache - Store (Current research level of Invisible Strike (Curse Ability) for Player 1 (Red)) as TCO_Invisible_Strike of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Lightning Attack (Curse Ability) for Player 1 (Red)) as TCO_Lightning_Attack of TCO_Spells in (Last created game cache)
      • -------- 4 --------
      • Game Cache - Store (Current research level of Flash Strike (AoE Ability) for Player 1 (Red)) as TCO_Flash_Strike of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Lightning Storm (Aoe Ability) for Player 1 (Red)) as TCO_Lightning_Storm of TCO_Spells in (Last created game cache)
      • -------- 5 --------
      • Game Cache - Store (Current research level of Hydro Shell (Heal Ability) for Player 1 (Red)) as TCO_Hydro_Shield of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Blessing of Lightning (Heal Ability) for Player 1 (Red)) as TCO_Bless_Of_Lightning of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Speedy Boost (Heal Ability) for Player 1 (Red)) as TCO_Speedy_Boost of TCO_Spells in (Last created game cache)
      • -------- 6 --------
      • Game Cache - Store (Current research level of Lightning Orb (Ultimate Ability) for Player 1 (Red)) as TCO_Lightning_Orb of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Teleport Strike (Ultimate Ability) for Player 1 (Red)) as TCO_Teleport_Strike of TCO_Spells in (Last created game cache)
      • -------- === GALEOTH === --------
      • -------- 1 --------
      • Game Cache - Store (Level of Frozen (G, Z, 2, US) for AAAGaleoth) as TCO_Frozen of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Magical Hammer (Single Ability) for Player 1 (Red)) as TCO_Magical_Hammer of TCO_Spells in (Last created game cache)
      • -------- 2 --------
      • Game Cache - Store (Current research level of Ice Bolt (Single Ability) for Player 1 (Red)) as TCO_Ice_Bolt of TCO_Spells in (Last created game cache)
      • -------- 3 --------
      • Game Cache - Store (Current research level of Summon Ice Element (Curse Ability) for Player 1 (Red)) as TCO_Summon_Ice_Element of TCO_Spells in (Last created game cache)
      • -------- 4 --------
      • Game Cache - Store (Current research level of Frozen Cannon (NOT ANYMORE AVAIABLE) for Player 1 (Red)) as TCO_Frozen_Cannon of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Frozen Fang (AoE Ability) for Player 1 (Red)) as TCO_Frozen_Fang of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Glacial Ball (Aoe Ability) for Player 1 (Red)) as TCO_Glacial_Ball of TCO_Spells in (Last created game cache)
      • -------- 5 --------
      • Game Cache - Store (Current research level of Chain Heal (NOT ANYMORE AVAIABLE) for Player 1 (Red)) as TCO_Chain_Heal of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Bone Chiller (Basic Ability) for Player 1 (Red)) as TCO_Magic_Boost of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Glacial Armor (Heal Ability) for Player 1 (Red)) as TCO_Glacial_Armor of TCO_Spells in (Last created game cache)
      • -------- 6 --------
      • Game Cache - Store (Current research level of Frozen Paradise (Ultimate Ability) for Player 1 (Red)) as TCO_Frozen_Paradise of TCO_Spells in (Last created game cache)
      • Game Cache - Store (Current research level of Northrend Winds (Ultimate Ability) for Player 1 (Red)) as TCO_Northrend_Winds of TCO_Spells in (Last created game cache)
      • -------- === SAVE RESOURCES === --------
      • Game Cache - Store (Player 1 (Red) Current gold) as TCO_Gold of TCO_Resources in (Last created game cache)
      • Game Cache - Store (Player 1 (Red) Current lumber) as TCO_Wood of TCO_Resources in (Last created game cache)
      • -------- === SAVE LINK QUESTS === --------
      • -------- === SAVE SPELL BOOKS === --------
      • Game Cache - Store Spell_System_Active as SpellSystemActive of Spells in GameCache
      • -------- Save Game Cache --------
      • Save GameCache
      • Wait 2.00 seconds
      • Game - Set the next level to Test Map - The Chosen Ones.w3m
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Load Things
    • Events
      • Player - Player 1 (Red) types a chat message containing !L as An exact match
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_12.w3v
      • Set GameCache = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
      • -------- === Campaign Status Bar === --------
      • Set SB_Dies_C = (SB_Dies_C + (Load TCO_SB_Dies_C of TCO_Bar from (Last created game cache)))
      • Set SB_Optional_Q_C = (SB_Optional_Q_C + (Load TCO_SB_Optional_Q_C of TCO_Bar from (Last created game cache)))
      • Set SB_Elite_B_C = (SB_Elite_B_C + (Load TCO_SB_Elite_B_C of TCO_Bar from (Last created game cache)))
      • Set SB_Epic_B_C = (SB_Epic_B_C + (Load TCO_SB_Epic_B_C of TCO_Bar from (Last created game cache)))
      • Set SB_Digging_C = (SB_Digging_C + (Load TCO_SB_Digging_C of TCO_Bar from (Last created game cache)))
      • Set SB_GU_C = (SB_GU_C + (Load TCO_SB_GU_C of TCO_Bar from (Last created game cache)))
      • Set SB_Kill_C = (SB_Kill_C + (Load TCO_SB_Kill_C of TCO_Bar from (Last created game cache)))
      • Set SB_Dies_C = (SB_Dies_C + (Load TCO_SB_Dies_C of TCO_Bar from (Last created game cache)))
      • Set SB_Easy_C = (SB_Easy_C + (Load TCO_SB_Easy_C of TCO_Bar from (Last created game cache)))
      • Set SB_Normal_C = (SB_Normal_C + (Load TCO_SB_Normal_C of TCO_Bar from (Last created game cache)))
      • Set SB_Hard_C = (SB_Hard_C + (Load TCO_SB_Hard_C of TCO_Bar from (Last created game cache)))
      • Set SB_Extreme_C = (SB_Extreme_C + (Load TCO_SB_Extreme_C of TCO_Bar from (Last created game cache)))
      • Set SB_TPTC_C[1] = (SB_TPTC_C[1] + (Load TCO_SB_TPTC_C of TCO_Bar from (Last created game cache)))
      • -------- === LOAD HERO SPELLS === --------
      • -------- === PHODOM === --------
      • -------- 2 --------
      • Player - Set the current research level of Meltdown (Single Ability) to (Load TCO_Meltdown of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Impact Flare (Single Ability) to (Load TCO_Impact_Flare of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 3 --------
      • Player - Set the current research level of Aura Of Fire (Curse Ability) to (Load TCO_Aura_Of_Fire of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Fire Attack (DISABLED CURRENTLY) to (Load TCO_Fire_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Summon Fire Element (Curse Ability) to (Load TCO_Summon_Fire_Element of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 4 --------
      • Player - Set the current research level of Flame Explosion (AoE Ability) to (Load TCO_Flame_Explosion of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 5 --------
      • Player - Set the current research level of Shield Of Fire (Heal Ability) to (Load TCO_Shield_Of_Fire of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 6 --------
      • Player - Set the current research level of Chaotic Rift (Ultimate Ability) to (Load TCO_Chaotic_Rift of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- === FRADZ === --------
      • -------- 2 --------
      • Player - Set the current research level of Thunder (Single Ability) to (Load TCO_Thunder of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 3 --------
      • Player - Set the current research level of Invisible Strike (Curse Ability) to (Load TCO_Invisible_Strike of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Lightning Attack (Curse Ability) to (Load TCO_Lightning_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 4 --------
      • Player - Set the current research level of Flash Strike (AoE Ability) to (Load TCO_Flash_Strike of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Lightning Storm (Aoe Ability) to (Load TCO_Lightning_Storm of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 5 --------
      • Player - Set the current research level of Blessing of Lightning (Heal Ability) to (Load TCO_Bless_Of_Lightning of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Hydro Shell (Heal Ability) to (Load TCO_Hydro_Shield of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Speedy Boost (Heal Ability) to (Load TCO_Speedy_Boost of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 6 --------
      • Player - Set the current research level of Lightning Orb (Ultimate Ability) to (Load TCO_Lightning_Orb of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Teleport Strike (Ultimate Ability) to (Load TCO_Teleport_Strike of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- === GALEOTH === --------
      • -------- 2 --------
      • Player - Set the current research level of Ice Bolt (Single Ability) to (Load TCO_Ice_Bolt of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Magical Hammer (Single Ability) to (Load TCO_Magical_Hammer of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 3 --------
      • Player - Set the current research level of Summon Ice Element (Curse Ability) to (Load TCO_Summon_Ice_Element of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 4 --------
      • Player - Set the current research level of Frozen Cannon (NOT ANYMORE AVAIABLE) to (Load TCO_Frozen_Cannon of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Frozen Fang (AoE Ability) to (Load TCO_Frozen_Fang of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Glacial Ball (Aoe Ability) to (Load TCO_Glacial_Ball of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 5 --------
      • Player - Set the current research level of Chain Heal (NOT ANYMORE AVAIABLE) to (Load TCO_Chain_Heal of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Glacial Armor (Heal Ability) to (Load TCO_Glacial_Armor of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 6 --------
      • Player - Set the current research level of Frozen Paradise (Ultimate Ability) to (Load TCO_Frozen_Paradise of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Northrend Winds (Ultimate Ability) to (Load TCO_Northrend_Winds of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- === LOAD HEROES === --------
      • Set TempLoc = (Center of Phodom Load <gen>)
      • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom", Player(0), udg_TempLoc, 0.00 )
      • Set AAAPhodom = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Fradz Load <gen>)
      • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz", Player(0), udg_TempLoc, 0.00 )
      • Set AAAFradz = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Galeoth Load <gen>)
      • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth", Player(0), udg_TempLoc, 0.00 )
      • Set AAAGaleoth = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- === LOAD BOXES === --------
      • Set TempLoc = (Center of PhoB1 Load <gen>)
      • Game Cache - Restore TCO_Phodom_Box of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box = (Last restored unit)
      • Game Cache - Restore TCO_Phodom_Box2 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box2 = (Last restored unit)
      • Game Cache - Restore TCO_Phodom_Box3 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box3 = (Last restored unit)
      • Game Cache - Restore TCO_Phodom_Box4 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box4 = (Last restored unit)
      • Game Cache - Restore TCO_Fradz_Box of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box = (Last restored unit)
      • Game Cache - Restore TCO_Fradz_Box2 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box2 = (Last restored unit)
      • Game Cache - Restore TCO_Fradz_Box3 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box3 = (Last restored unit)
      • Game Cache - Restore TCO_Fradz_Box4 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box4 = (Last restored unit)
      • Game Cache - Restore TCO_Galeoth_Box of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAGaleoth_Box = (Last restored unit)
      • Game Cache - Restore TCO_Galeoth_Box2 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAGaleoth_Box2 = (Last restored unit)
      • Game Cache - Restore TCO_Galeoth_Box3 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAGaleoth_Box3 = (Last restored unit)
      • Game Cache - Restore TCO_Galeoth_Box4 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAGaleoth_Box4 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- === LOAD UNIT SPELLS === --------
      • -------- === PHODOM === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load TCO_Area_Attack of TCO_Spells from (Last created game cache)) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Area Attack (P, X, 2, US) to AAAPhodom
          • Unit - Set level of Area Attack (P, X, 2, US) for AAAPhodom to (Load TCO_Area_Attack of TCO_Spells from (Last created game cache))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load TCO_Avatar of TCO_Spells from (Last created game cache)) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Avatar (P, R, 2, US) to AAAPhodom
              • Unit - Set level of Avatar (P, R, 2, US) for AAAPhodom to (Load TCO_Avatar of TCO_Spells from (Last created game cache))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load TCO_Warcry of TCO_Spells from (Last created game cache)) Greater than or equal to 1
                • Then - Actions
                  • Unit - Add Warcry (P, R, 2, US) to AAAPhodom
                  • Unit - Set level of Warcry (P, R, 2, US) for AAAPhodom to (Load TCO_Warcry of TCO_Spells from (Last created game cache))
                • Else - Actions
      • -------- === FRADZ === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load TCO_Sword_Dance of TCO_Spells from (Last created game cache)) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Sword Dance (F, E, 2, US) to AAAFradz
          • Unit - Set level of Sword Dance (F, E, 2, US) for AAAFradz to (Load TCO_Sword_Dance of TCO_Spells from (Last created game cache))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load TCO_Illusory_Double of TCO_Spells from (Last created game cache)) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Illusory Double (F, Y, 2, US) to AAAFradz
              • Unit - Set level of Illusory Double (F, Y, 2, US) for AAAFradz to (Load TCO_Illusory_Double of TCO_Spells from (Last created game cache))
            • Else - Actions
      • -------- === GALEOTH === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load TCO_Frozen of TCO_Spells from (Last created game cache)) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Frozen (G, Z, 2, US) to AAAGaleoth
          • Unit - Set level of Frozen (G, Z, 2, US) for AAAGaleoth to (Load TCO_Frozen of TCO_Spells from (Last created game cache))
        • Else - Actions
      • -------- === LOAD RESOURCES === --------
      • Player - Set Player 1 (Red) Current gold to (Load TCO_Gold of TCO_Resources from (Last created game cache))
      • Player - Set Player 1 (Red) Current lumber to (Load TCO_Wood of TCO_Resources from (Last created game cache))
      • -------- === LOAD LINK QUESTS === --------
I'm at the moment testing saving and loading from chapter 2 to chapter 5. This doesn't work. Here are few pictures and triggers from these chapters:


Chapter%202.jpg
Chapter%205.jpg



  • Actions
    • -------- === CREATE GAME CACHE === --------
    • Game Cache - Create a game cache from TCOCache_2.w3v
    • Set GameCache = (Last created game cache)
    • -------- === SAVE HEROS === --------
    • Custom script: call StoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz", udg_AAAFradz )
    • -------- === SAVE BOXES === --------
    • Game Cache - Store AAFradz_Box as TCO_Fradz_Box of TCO_Heroes in (Last created game cache)
    • Game Cache - Store AAFradz_Box2 as TCO_Fradz_Box2 of TCO_Heroes in (Last created game cache)
    • Game Cache - Store AAFradz_Box3 as TCO_Fradz_Box3 of TCO_Heroes in (Last created game cache)
    • Game Cache - Store AAFradz_Box4 as TCO_Fradz_Box4 of TCO_Heroes in (Last created game cache)
    • Game Cache - Store AAFradz_Box5 as TCO_Fradz_Box5 of TCO_Heroes in (Last created game cache)
    • Game Cache - Store AAFradz_Box6 as TCO_Fradz_Box6 of TCO_Heroes in (Last created game cache)
    • -------- === SAVE SPELLS === --------
    • -------- === FRADZ === --------
    • -------- 1 --------
    • Game Cache - Store (Level of Sword Dance (F, E, 2, US) for AAAFradz) as TCO_Sword_Dance of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Level of Illusory Double (F, Y, 2, US) for AAAFradz) as TCO_Illusory_Double of TCO_Spells in (Last created game cache)
    • -------- 2 --------
    • Game Cache - Store (Current research level of Thunder (Single Ability) for Player 1 (Red)) as TCO_Thunder of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Discharge (Single Ability) for Player 1 (Red)) as TCO_Discharge of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Shock (Single Ability) for Player 1 (Red)) as TCO_Shock of TCO_Spells in (Last created game cache)
    • -------- 3 --------
    • Game Cache - Store (Current research level of Invisible Strike (Curse Ability) for Player 1 (Red)) as TCO_Invisible_Strike of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Lightning Attack (Curse Ability) for Player 1 (Red)) as TCO_Lightning_Attack of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Lightning Mastery (Curse Ability) for Player 1 (Red)) as TCO_Lightning_Mastery of TCO_Spells in (Last created game cache)
    • -------- 4 --------
    • Game Cache - Store (Current research level of Flash Strike (AoE Ability) for Player 1 (Red)) as TCO_Flash_Strike of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Lightning Storm (Aoe Ability) for Player 1 (Red)) as TCO_Lightning_Storm of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Energy Ball (Aoe Ability) for Player 1 (Red)) as TCO_Energy_Ball of TCO_Spells in (Last created game cache)
    • -------- 5 --------
    • Game Cache - Store (Current research level of Hydro Shell (Heal Ability) for Player 1 (Red)) as TCO_Hydro_Shield of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Blessing of Lightning (Heal Ability) for Player 1 (Red)) as TCO_Bless_Of_Lightning of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Speedy Boost (Heal Ability) for Player 1 (Red)) as TCO_Speedy_Boost of TCO_Spells in (Last created game cache)
    • -------- 6 --------
    • Game Cache - Store (Current research level of Lightning Orb (Ultimate Ability) for Player 1 (Red)) as TCO_Lightning_Orb of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Teleport Strike (Ultimate Ability) for Player 1 (Red)) as TCO_Teleport_Strike of TCO_Spells in (Last created game cache)
    • -------- === SAVE PROFESSIONS === --------
    • -------- === FRADZ === --------
    • -------- 1 --------
    • Game Cache - Store Resource__DIGTIMES_F as TCO_Digfradz of TCO_Profession in (Last created game cache)
    • Game Cache - Store (Current research level of Requires Bronze Shovel (BOTH) for Player 1 (Red)) as TCO_Digbronze of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Requires Silver Shovel (BOTH) for Player 1 (Red)) as TCO_Digsilver of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Requires Golden Shovel (BOTH) for Player 1 (Red)) as TCO_Diggold of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Requires Master's Instruction Teachings (BOTH) for Player 1 (Red)) as TCO_Digmaster of TCO_Professions in (Last created game cache)
    • -------- 2 --------
    • Game Cache - Store Resource__STEALLVL_F as TCO_StealF of TCO_Profession in (Last created game cache)
    • -------- 3 --------
    • Game Cache - Store (Current research level of Recipe of Potion Of Strength (BOTH) for Player 1 (Red)) as TCO_Potionstrength of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Recipe of Potion Of Agility (BOTH) for Player 1 (Red)) as TCO_Potionagility of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Recipe of Potion Of Intelligence (BOTH) for Player 1 (Red)) as TCO_Potionintelligence of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Recipe of Potion Of Health (BOTH) for Player 1 (Red)) as TCO_Potionhealth of TCO_Professions in (Last created game cache)
    • Game Cache - Store (Current research level of Recipe of Potion Of Mana (BOTH) for Player 1 (Red)) as TCO_Potionmana of TCO_Professions in (Last created game cache)
    • -------- === SAVE RESOURCES === --------
    • Game Cache - Store Resource__DIFFICULTY as TCO_Difficulty of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__SECONDS as TCO_Second of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__MINUTES as TCO_Minute of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__HOURS as TCO_Hour of TCO_Multiboard in (Last created game cache)
    • Set Resource__GAMEPOINT = (Resource__GAMEPOINT + Resource__GAMEPOINT_C)
    • Game Cache - Store Resource__GAMEPOINT as TCO_Gamepoint of TCO_Multiboard in (Last created game cache)
    • Set Resource__LIFE = (Player 1 (Red) Current lumber)
    • Game Cache - Store Resource__LIFE as TCO_Life of TCO_Multiboard in (Last created game cache)
    • Set Resource__GOLD = (Player 1 (Red) Current gold)
    • Game Cache - Store Resource__GOLD as TCO_Gold of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__HONORPOINT as TCO_Honorpoint of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__BOSSPOINT as TCO_Bosspoint of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__LUCK as TCO_Luck of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__KILLS as TCO_Kill of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__DEATHS as TCO_Death of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__GIVEUP as TCO_Giveup of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__EASY as TCO_Easy of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__NORMAL as TCO_Normal of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__HARD as TCO_Hard of TCO_Multiboard in (Last created game cache)
    • Game Cache - Store Resource__EXTREME as TCO_Extreme of TCO_Multiboard in (Last created game cache)
    • -------- === SAVE BOOLEANS === --------
    • -------- === SAVE SPELL BOOKS === --------
    • Game Cache - Store Spell_System_Active as SpellSystemActive of Spells in GameCache
    • -------- Save Game Cache --------
    • Save GameCache
  • Load Things
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_2.w3v
      • Set GameCache1 = (Last created game cache)
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_4.w3v
      • Set GameCache2 = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache2)
      • -------- === LOAD HERO SPELLS === --------
      • -------- === PHODOM === --------
      • -------- 2 --------
      • Player - Set the current research level of Meltdown (Single Ability) to (Load TCO_Meltdown of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Impact Flare (Single Ability) to (Load TCO_Impact_Flare of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 3 --------
      • Player - Set the current research level of Aura Of Fire (Curse Ability) to (Load TCO_Aura_Of_Fire of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Summon Fire Element (Curse Ability) to (Load TCO_Summon_Fire_Element of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Fire Mastery (Curse Ability) to (Load TCO_Fire_Mastery of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 4 --------
      • Player - Set the current research level of Flame Explosion (AoE Ability) to (Load TCO_Flame_Explosion of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Ground Zero (AoE Ability) to (Load TCO_Ground_Zero of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 5 --------
      • Player - Set the current research level of Shield Of Fire (Heal Ability) to (Load TCO_Shield_Of_Fire of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Heaven's Bless (Heal Ability) to (Load TCO_Warm_Light of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- 6 --------
      • Player - Set the current research level of Chaotic Rift (Ultimate Ability) to (Load TCO_Chaotic_Rift of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Phoenix Combo (Ultimate Ability) to (Load TCO_Phoenix_Combo of TCO_Spells from (Last created game cache)) for Player 1 (Red)
      • -------- === FRADZ === --------
      • -------- 2 --------
      • Player - Set the current research level of Thunder (Single Ability) to (Load TCO_Thunder of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Discharge (Single Ability) to (Load TCO_Discharge of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Shock (Single Ability) to (Load TCO_Shock of TCO_Spells from GameCache1) for Player 1 (Red)
      • -------- 3 --------
      • Player - Set the current research level of Invisible Strike (Curse Ability) to (Load TCO_Invisible_Strike of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Lightning Attack (Curse Ability) to (Load TCO_Lightning_Attack of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Lightning Mastery (Curse Ability) to (Load TCO_Lightning_Mastery of TCO_Spells from GameCache1) for Player 1 (Red)
      • -------- 4 --------
      • Player - Set the current research level of Flash Strike (AoE Ability) to (Load TCO_Flash_Strike of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Lightning Storm (Aoe Ability) to (Load TCO_Lightning_Storm of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Energy Ball (Aoe Ability) to (Load TCO_Energy_Ball of TCO_Spells from GameCache1) for Player 1 (Red)
      • -------- 5 --------
      • Player - Set the current research level of Blessing of Lightning (Heal Ability) to (Load TCO_Bless_Of_Lightning of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Hydro Shell (Heal Ability) to (Load TCO_Hydro_Shield of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Speedy Boost (Heal Ability) to (Load TCO_Speedy_Boost of TCO_Spells from GameCache1) for Player 1 (Red)
      • -------- 6 --------
      • Player - Set the current research level of Lightning Orb (Ultimate Ability) to (Load TCO_Lightning_Orb of TCO_Spells from GameCache1) for Player 1 (Red)
      • Player - Set the current research level of Teleport Strike (Ultimate Ability) to (Load TCO_Teleport_Strike of TCO_Spells from GameCache1) for Player 1 (Red)
      • -------- === LOAD HEROES === --------
      • Set TempLoc = (Center of Phodom Load <gen>)
      • Custom script: call RestoreHero ( udg_GameCache2, "TCO_Heroes", "TCO_Phodom", Player(0), udg_TempLoc, 0.00 )
      • Set AAAPhodom = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Fradz Load <gen>)
      • Custom script: call RestoreHero ( udg_GameCache1, "TCO_Heroes", "TCO_Fradz", Player(0), udg_TempLoc, 0.00 )
      • Set AAAFradz = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- === LOAD BOXES === --------
      • -------- 1 --------
      • Set TempLoc = (Center of PhoB1 Load <gen>)
      • Game Cache - Restore TCO_Phodom_Box of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 2 --------
      • Set TempLoc = (Center of PhoB2 Load <gen>)
      • Game Cache - Restore TCO_Phodom_Box2 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box2 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 3 --------
      • Set TempLoc = (Center of PhoB3 <gen>)
      • Game Cache - Restore TCO_Phodom_Box3 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box3 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 4 --------
      • Set TempLoc = (Center of PhoB4 <gen>)
      • Game Cache - Restore TCO_Phodom_Box4 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box4 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 5 --------
      • Set TempLoc = (Center of PhoB5 <gen>)
      • Game Cache - Restore TCO_Phodom_Box5 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box5 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 6 --------
      • Set TempLoc = (Center of PhoB6 <gen>)
      • Game Cache - Restore TCO_Phodom_Box6 of TCO_Heroes from (Last created game cache) for Player 1 (Red) at TempLoc facing 0.00
      • Set AAPhodom_Box6 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 1 --------
      • Set TempLoc = (Center of FraB1 <gen>)
      • Game Cache - Restore TCO_Fradz_Box of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 2 --------
      • Set TempLoc = (Center of FraB2 <gen>)
      • Game Cache - Restore TCO_Fradz_Box2 of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box2 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 3 --------
      • Set TempLoc = (Center of FraB3 <gen>)
      • Game Cache - Restore TCO_Fradz_Box3 of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box3 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 4 --------
      • Set TempLoc = (Center of FraB4 <gen>)
      • Game Cache - Restore TCO_Fradz_Box4 of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box4 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 5 --------
      • Set TempLoc = (Center of FraB5 <gen>)
      • Game Cache - Restore TCO_Fradz_Box5 of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box5 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- 6 --------
      • Set TempLoc = (Center of FraB6 <gen>)
      • Game Cache - Restore TCO_Fradz_Box6 of TCO_Heroes from GameCache1 for Player 1 (Red) at TempLoc facing 0.00
      • Set AAFradz_Box6 = (Last restored unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- === LOAD UNIT SPELLS === --------
      • -------- === PHODOM === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load TCO_Area_Attack of TCO_Spells from GameCache2) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Area Attack (P, X, 2, US) to AAAPhodom
          • Unit - Set level of Area Attack (P, X, 2, US) for AAAPhodom to (Load TCO_Area_Attack of TCO_Spells from GameCache2)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load TCO_Avatar of TCO_Spells from (Last created game cache)) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Avatar (P, R, 2, US) to AAAPhodom
              • Unit - Set level of Avatar (P, R, 2, US) for AAAPhodom to (Load TCO_Avatar of TCO_Spells from GameCache2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load TCO_Warcry of TCO_Spells from (Last created game cache)) Greater than or equal to 1
                • Then - Actions
                  • Unit - Add Warcry (P, R, 2, US) to AAAPhodom
                  • Unit - Set level of Warcry (P, R, 2, US) for AAAPhodom to (Load TCO_Warcry of TCO_Spells from GameCache2)
                • Else - Actions
      • -------- === FRADZ === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load TCO_Sword_Dance of TCO_Spells from GameCache1) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Sword Dance (F, E, 2, US) to AAAFradz
          • Unit - Set level of Sword Dance (F, E, 2, US) for AAAFradz to (Load TCO_Sword_Dance of TCO_Spells from GameCache1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load TCO_Illusory_Double of TCO_Spells from GameCache1) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Illusory Double (F, Y, 2, US) to AAAFradz
              • Unit - Set level of Illusory Double (F, Y, 2, US) for AAAFradz to (Load TCO_Illusory_Double of TCO_Spells from GameCache1)
            • Else - Actions
      • -------- === LOAD PROFESSIONS === --------
      • Set Resource__DIGTIMES_P = (Load TCO_Digphodom of TCO_Profession from (Last created game cache))
      • Set Resource__ALCLVL_P = (Load TCO_Potionlevel of TCO_Profession from (Last created game cache))
      • -------- === MULTIBOARD === --------
      • -------- Column: Player --------
      • Set Resource__DIFFICULTY = (Load TCO_Difficulty of TCO_Multiboard from (Last created game cache))
      • Set Resource__SECONDS = (Load TCO_Second of TCO_Multiboard from (Last created game cache))
      • Set Resource__MINUTES = (Load TCO_Minute of TCO_Multiboard from (Last created game cache))
      • Set Resource__HOURS = (Load TCO_Hour of TCO_Multiboard from (Last created game cache))
      • Set Resource__GAMEPOINT = (Load TCO_Gamepoint of TCO_Multiboard from (Last created game cache))
      • Set Resource__GOLD = (Load TCO_Gold of TCO_Multiboard from (Last created game cache))
      • Player - Set Player 1 (Red) Current gold to Resource__GOLD
      • Set Resource__LIFE = (Load TCO_Life of TCO_Multiboard from (Last created game cache))
      • Player - Set Player 1 (Red) Current lumber to Resource__LIFE
      • Set Resource__HONORPOINT = (Load TCO_Honorpoint of TCO_Multiboard from (Last created game cache))
      • Set Resource__BOSSPOINT = (Load TCO_Bosspoint of TCO_Multiboard from (Last created game cache))
      • Set Resource__LUCK = (Load TCO_Luck of TCO_Multiboard from (Last created game cache))
      • Set Resource__KILLS = (Load TCO_Kill of TCO_Multiboard from (Last created game cache))
      • Set Resource__DEATHS = (Load TCO_Death of TCO_Multiboard from (Last created game cache))
      • Set Resource__GIVEUP = (Load TCO_Giveup of TCO_Multiboard from (Last created game cache))
      • Set Resource__EASY = (Load TCO_Easy of TCO_Multiboard from (Last created game cache))
      • Set Resource__NORMAL = (Load TCO_Normal of TCO_Multiboard from (Last created game cache))
      • Set Resource__HARD = (Load TCO_Hard of TCO_Multiboard from (Last created game cache))
      • Set Resource__EXTREME = (Load TCO_Extreme of TCO_Multiboard from (Last created game cache))
      • -------- Column: Bosses Defeated --------
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Game Cache - Store Resource__ELITEBOSS[(Integer A)] as TCO_Eliteboss of TCO_Multiboard in (Last created game cache)
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set Resource__ELITEBOSS[(Integer A)] = (Load TCO_Eliteboss of TCO_Multiboard from (Last created game cache))
      • -------- === LOAD PROFESSIONS === --------
      • -------- Treasure Hunter --------
      • Player - Set the current research level of Requires Bronze Shovel (BOTH) to (Load TCO_Digbronze of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Requires Silver Shovel (BOTH) to (Load TCO_Digsilver of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Requires Golden Shovel (BOTH) to (Load TCO_Diggold of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Requires Master's Instruction Teachings (BOTH) to (Load TCO_Digmaster of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • -------- Alchemist --------
      • Player - Set the current research level of Recipe of Potion Of Strength (BOTH) to (Load TCO_Potionstrength of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Recipe of Potion Of Agility (BOTH) to (Load TCO_Potionagility of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Recipe of Potion Of Intelligence (BOTH) to (Load TCO_Potionintelligence of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Recipe of Potion Of Health (BOTH) to (Load TCO_Potionhealth of TCO_Professions from (Last created game cache)) for Player 1 (Red)
      • Player - Set the current research level of Recipe of Potion Of Mana (BOTH) to (Load TCO_Potionmana of TCO_Professions from (Last created game cache)) for Player 1 (Red)
I'm not here asking you to test the campaign and debugging anything but just tell me: what could be the possibilities why this system doesn't work? It worked before. What have I messed up this time?


The campaign is now standstill until this major bug is fixed. I don't want to create any new chapters if one of the major systems doesn't work properly.

Rep & credits to the ones who gives useful help.
 
Last edited:
Level 37
Joined
Aug 14, 2006
Messages
7,601
So the hero loads correctly otherwise, level, items, base abilities and so on. Only abilities in spellbook do not load. Is that correct?

Maybe the spell book raw code is wrong.

Habe you enabled the debug messages? What do they say about the ability levels?

Yeah, all other saving/loading works, but that system isn't working. This means all combat kings and spell book spells aren't load or saved correctly.

Raw code, do you mean abilities' ID codes? They should be alright because otherwise I wouldn't get any of them in my inventory.

Okay, I go enable "debug" messages and go test. I'll either update this post or post a new one if someone else have posted in this thread.

Sooo...

I delete from this sentence

JASS:
                    //call BJDebugMsg("Loading spell " + I2S(i) + ": " + I2S(GetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i])))
"//" and go test, am I correct? I don't much understand about JASS and this system.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Yes, delete the //.

JASS:
function GetSpellBook takes nothing returns integer
    return 'A6AU'
endfunction
This is the spell book raw code in your JASS system. Find the ability in your object editor, select view - display values as raw data from the menu. Check that the first four letters are A6AU. If not, chance the JASS system code to the correct raw code.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Yea, it's A6AU.

I go now test. I deleted that "//" from both chapter 2 and 5.


EDIT:

Chapter 2

I didn't see any texts and found zero bugs. I guess that was expected, because none spell needed to load into that chapter.

I had these items before going to next chapter:

3 different kind of spell book spells
Lvl 1 Combat King(don't remember what was it)
Lvl 2 Combat King(don't remember what was it)
Lvl 3 Combat King(don't remember what was it)

Chapter 5

Once again, not a single message about anything. All spells are gone. I have a baaaaad feeling about this!


This is the system I used:

JASS:
function GetSpellBook takes nothing returns integer
    return 'A6AU'
endfunction

function CreateSpell takes integer itemid, integer spellbookid, integer spellid returns nothing
local integer p = 0
    set udg_Spell_System_last = udg_Spell_System_last + 1
    set udg_Spell_System_item[udg_Spell_System_last] = itemid
    set udg_Spell_System_abil[udg_Spell_System_last] = spellbookid
    set udg_Spell_System_spell[udg_Spell_System_last] = spellid
    loop
        exitwhen p > 12
        call SetPlayerAbilityAvailable(Player(p), udg_Spell_System_abil[udg_Spell_System_last], false)
        set p = p + 1
    endloop
endfunction

function UnitAddSpell takes unit u, integer itemid returns boolean
    local integer i = 0
    set udg_Spell_System_success = false
    loop
        exitwhen i > udg_Spell_System_last
        if (udg_Spell_System_item[i] == itemid) then
            if GetUnitAbilityLevel(u, udg_Spell_System_abil[i]) <= 0 then
                call UnitAddAbility(u, udg_Spell_System_abil[i])
                set udg_Spell_System_success = true
return true
            else
                call SetUnitAbilityLevel(u, udg_Spell_System_spell[i], GetUnitAbilityLevel(u, udg_Spell_System_spell[i]) + 1)
                set udg_Spell_System_success = true
                return true
            endif
        endif
        set i = i + 1
    endloop
    return false
endfunction

function UnitRemoveSpell takes unit u, integer abilid returns boolean
    local integer i = 0
    loop
        exitwhen i > udg_Spell_System_last
        if udg_Spell_System_spell[i] == abilid then
            if GetUnitAbilityLevel(u, udg_Spell_System_abil[i]) <= 0 then
return false
            else
                call UnitRemoveAbility(u, udg_Spell_System_abil[i])
                set udg_Spell_System_success = true
                return true
            endif
        endif
        set i = i + 1
    endloop
    return false
endfunction

function StoreHeroSpells takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    local integer i = 0
    if udg_Spell_System_Active then
loop
            exitwhen i > udg_Spell_System_last
            if GetUnitAbilityLevel(whichunit, udg_Spell_System_abil[i]) > 0 then
                call StoreInteger(cache, missionkey, key + "spell" +  I2S(i), GetUnitAbilityLevel(whichunit, udg_Spell_System_spell[i]))
            else
                call StoreInteger(cache, missionkey, key + "spell" + I2S(i), 0)
endif
            set i = i + 1
        endloop
    endif
endfunction

function RestoreHeroSpells takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    local integer i = 0
    if udg_Spell_System_Active then
        loop
            exitwhen i > udg_Spell_System_last
if HaveStoredInteger(cache, missionkey, key + "spell" + I2S(i)) then
                if GetStoredInteger(cache, missionkey, key + "spell" + I2S(i)) > 0 then
                    call UnitAddAbility(whichunit, udg_Spell_System_abil[i])
                    call BJDebugMsg("Loading spell " + I2S(i) + ": " +  I2S(GetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i])))
                    call SetUnitAbilityLevel(whichunit,  udg_Spell_System_spell[i], GetStoredInteger(cache, missionkey, key +  "spell" + I2S(i)))
                endif
            endif
set i = i + 1
        endloop
    endif
endfunction

function StoreHero takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
    call StoreHeroSpells(cache, missionkey, key, whichunit)
    call UnitRemoveAbility(whichunit, GetSpellBook())
    //call TriggerSleepAction(0.0)
    call StoreUnit(cache, missionkey, key, whichunit)
endfunction

function RestoreHero takes gamecache cache, string missionkey, string  key, player whichplayer, location whichloc, real angle returns unit
    set bj_lastLoadedUnit = RestoreUnit(cache, missionkey, key,  whichplayer, GetLocationX(whichloc), GetLocationY(whichloc), angle)
    call UnitAddAbility(bj_lastLoadedUnit, GetSpellBook())
    call RestoreHeroSpells(cache, missionkey, key, bj_lastLoadedUnit)
    return bj_lastLoadedUnit
endfunction





//TESH.scrollpos=32
//TESH.alwaysfold=0

// tarttet nää 2 functioo, kopsaa nää

function FogIsChanging takes nothing returns nothing
     local real zend = udg_F_ZEndNow + udg_F_ZEndTic
     local real red = udg_F_RedNow + udg_F_RedTic
     local real green = udg_F_GreenNow + udg_F_GreenTic
     local real blue = udg_F_BlueNow + udg_F_BlueTic
     if zend < 0 then
         set zend = 0
     endif
     if red < 0 then
         set red = 0
     else
         if red > 100 then
             set red = 100
         endif
     endif
     if green < 0 then
         set green = 0
    else
         if green > 100 then
             set green = 100
         endif
     endif
     if blue < 0 then
         set blue = 0
    else
         if blue > 100 then
             set blue = 100
         endif
     endif
     call SetTerrainFogEx(0,0.0,zend,0.0,red,green,blue)
     set udg_F_ZEndNow = zend
     set udg_F_RedNow = red
     set udg_F_GreenNow = green
     set udg_F_BlueNow = blue
     set udg_F_Tics = udg_F_Tics - 1
     if udg_F_Tics <= 0 then
         call PauseTimer(udg_F_Timer)
         set udg_F_FogChange = false
     endif
endfunction

function Fog2Fog takes real ZEnd, real Red, real Green, real Blue, real Time returns nothing
     set udg_F_Tics = R2I(Time / 0.03)
     set udg_F_ZEndTic = ( ZEnd - udg_F_ZEndNow ) / udg_F_Tics
     set udg_F_RedTic = ( Red - udg_F_RedNow ) / udg_F_Tics
     set udg_F_GreenTic = ( Green - udg_F_GreenNow ) / udg_F_Tics
     set udg_F_BlueTic = ( Blue - udg_F_BlueNow ) / udg_F_Tics
     if udg_F_FogChange == false and udg_F_ZEndTic != 0 and udg_F_RedTic  != 0 and udg_F_GreenTic != 0 and udg_F_BlueTic != 0 then
         call TimerStart(udg_F_Timer,0.03,true,function FogIsChanging)
         set udg_F_FogChange = true
     endif
endfunction
 

Attachments

  • A6AU.jpg
    A6AU.jpg
    423.9 KB · Views: 122
Level 37
Joined
Aug 14, 2006
Messages
7,601
Actually that is bug from Hive. I have somehow messed up with copying that code. The correct code is in my second last post and I'll now copy it to the original post. Ah, I thought the bug was that simple. :(

(I have a feeling it's a simple bug I just cannot see it)

EDIT: I just checked variables and they are all in same way in all chapters:

Spell_System_Active = True
Spell_System_abil = 0(Default)
Spell_System_item = 0(Default)
Spell_System_last = -1
Spell_System_spell = 0(Default)
Spell_System_success = False(Default)
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
I didn't made that system and I don't understand the system at all so don't ask me. X_x

What that "StoreSpells functions" do?

Btw, does it matter if that variable is written "GameCache" in variables, but in that JASS code it's written:

JASS:
function StoreHeroSpells takes gamecache cache, string missionkey, string key, unit whichunit returns nothing
Also here are some changes between 3.2a and beta versions:

- New chapters.
- A lot of new stuff.
- I have rearranged whole spell books in object editor, but it still have that "A6AU". There are now more abilities.
- Don't remember what else... There are so many changes. I don't know if they effect to this system.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Btw, does it matter if that variable is written "GameCache" in variables, but in that JASS code it's written

No, the function takes the GameCache as a variable, and internally uses it as "cache".

I removed a lot of things from the campaign so it loads faster.

Could you add a spell setup for Fradz in object editor in the chapter 2 map. Normal abilities, spell book, some items.

I'll then test the save/load.

http://www.hiveworkshop.com/forums/pastebin.php?id=fupxvh
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
You mean this?

  • Once Settings
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- === VITALITY START === --------
      • Player - Set Player 1 (Red) Food used to 10
      • Player - Set Player 1 (Red) Food max to 10
      • -------- === DISABLE SPELLS === --------
      • Player - Disable Fake Ability 1 (Single Spell) for Player 1 (Red)
      • Player - Disable Fake Ability 2 (Curse Spell) for Player 1 (Red)
      • Player - Disable Fake Ability 3 (AoE Spell) for Player 1 (Red)
      • Player - Disable Fake Ability 4 (Heal Spell) for Player 1 (Red)
      • Player - Disable Fake Ability 5 (Ultimate Spell) for Player 1 (Red)
      • Player - Disable Dummy Book 1 (Phodom - Single Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 2 (Phodom - Curse Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 3 (Phodom - AoE Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 4 (Phodom - Heal Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 5 (Phodom - Ultimate Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 1 (Fradz - Single Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 2 (Fradz - Curse Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 3 (Fradz - AoE Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 4 (Fradz - Heal Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 5 (Fradz - Ultimate Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 1 (Galeoth - Single Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 2 (Galeoth - Curse Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 3 (Galeoth - AoE Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 4 (Galeoth - Heal Spells) for Player 1 (Red)
      • Player - Disable Dummy Book 5 (Galeoth - Ultimate Spells) for Player 1 (Red)
      • -------- ========= COMBAT KINGS ========= --------
      • -------- Force Blow --------
      • Custom script: call CreateSpell('I6B6', 'A6E7', 'A64F')
      • -------- Blind --------
      • Custom script: call CreateSpell('I6B1', 'A6E4', 'A64M')
      • -------- Magic Boost --------
      • Custom script: call CreateSpell('I654', 'A6AQ', 'A64T')
      • -------- Natural Armor --------
      • Custom script: call CreateSpell('I657', 'A6AS', 'A6B3')
      • -------- Disarm --------
      • Custom script: call CreateSpell('I6B3', 'A6AF', 'A6AO')
      • -------- Siphon Life --------
      • Custom script: call CreateSpell('I6B4', 'A6E8', 'A6E2')
      • -------- Counter Attack --------
      • Custom script: call CreateSpell('I656', 'A6AP', 'A6B2')
      • -------- Magic Resistance --------
      • Custom script: call CreateSpell('I6B2', 'A6E5', 'A6DZ')
      • -------- Lucky Strike --------
      • Custom script: call CreateSpell('I653', 'A6AR', 'A64S')
      • -------- Stunner --------
      • Custom script: call CreateSpell('I655', 'A6AT', 'A6B1')
      • -------- Mana Breaker --------
      • Custom script: call CreateSpell('I6B5', 'A6E6', 'A6EV')
      • -------- ========= FIRE SPELLS ============ --------
      • -------- Fire Spell 1: Flames of War --------
      • Custom script: call CreateSpell('I6AV', 'A658', 'A6DQ')
      • -------- Fire Spell 2: Firing Adrenaline --------
      • Custom script: call CreateSpell('I6AW', 'A659', 'A6DR')
      • -------- Fire Spell 3: Flames of the Phoenix --------
      • Custom script: call CreateSpell('I622', 'A64R', 'A6A9')
      • -------- Fire Spell 4: Globe Of Armageddon --------
      • Custom script: call CreateSpell('I6D1', 'A6GS', 'A6HF')
      • -------- ========= LIGHTNING SPELLS ========= --------
      • -------- Lightning Spell 1: Spiral Shield --------
      • Custom script: call CreateSpell('I64A', 'A6B8', 'A67H')
      • -------- Lightning Spell 2: Charged Prism --------
      • Custom script: call CreateSpell('I623', 'A6B5', 'A6IK')
      • -------- Lightning Spell 3: Invisiblity --------
      • Custom script: call CreateSpell('I6D2', 'A61J', 'A6HM')
      • -------- Lightning Spell 4: Chaotic Realm --------
      • Custom script: call CreateSpell('I6D3', 'A6GW', 'A6HN')
      • -------- ========= ICE SPELLS ========= --------
      • -------- Ice Spell 1: Frost Armature --------
      • Custom script: call CreateSpell('I64N', 'A6BD', 'A66Q')
      • -------- Ice Spell 2: Glacial Spikes --------
      • Custom script: call CreateSpell('I64G', 'A6H6', 'A67K')
      • -------- Light Spell 5: Magic Guard --------
      • Custom script: call CreateSpell('I6AZ', 'A65C', 'A656')
      • -------- Ice Spell 4: Ice 3 --------
      • Custom script: call CreateSpell('I6DB', 'A6H3', 'A6HV')
      • -------- ========= LIGHT SPELLS ========= --------
      • -------- Light Spell 1: Divine Seal --------
      • Custom script: call CreateSpell('I6DE', 'A65A', 'A6DS')
      • -------- Light Spell 1: Union Of Souls --------
      • Custom script: call CreateSpell('I64M', 'A6C6', 'A676')
      • -------- Light Spell 9: Heaven's Blessing --------
      • Custom script: call CreateSpell('I6DF', 'A6HD', 'A6HY')
      • -------- Light Spell 10: Healing Pentagram --------
      • Custom script: call CreateSpell('I6AX', 'A6HC', 'A6HX')
      • -------- ========= DARKNESS SPELLS ========= --------
      • -------- Darkness Spell 1: Destroy Soul --------
      • Custom script: call CreateSpell('I6DH', 'A6BH', 'A6HG')
      • -------- Darkness Spell 2: Grim Brazier --------
      • Custom script: call CreateSpell('I64R', 'A6BI', 'A65E')
      • -------- Darkness Spell 3: Impale --------
      • Custom script: call CreateSpell('I6AY', 'A65B', 'A6DV')
      • -------- Darkness Spell 4: Abaddon --------
      • Custom script: call CreateSpell('I64S', 'A6HB', 'A68O')
      • -------- ========= ESPERS ========= --------
      • -------- Esper - Anthanex --------
      • Custom script: call CreateSpell('I60I', 'A6B4', 'A6E9')
      • -------- Esper - Faerga --------
      • Custom script: call CreateSpell('I61O', 'A6BV', 'A6EA')
      • -------- Esper - Voartex --------
      • Custom script: call CreateSpell('I61P', 'A6BW', 'A6EC')
      • -------- Esper - Nyrzx --------
      • Custom script: call CreateSpell('I62R', 'A6BU', 'A6ED')
      • -------- Esper - Mryoxin --------
      • Custom script: call CreateSpell('I647', 'A6BT', 'A6EB')
      • -------- ========= TREASURE HUNTER - BOTH ========= --------
      • -------- BOTH - Treasure Hunter - DIG --------
      • Custom script: call CreateSpell('I6DI', 'A6I6', 'A6BN')
      • -------- BOTH - Treasure Hunter - BRONZE --------
      • Custom script: call CreateSpell('I6E7', 'A6I3', 'A64N')
      • -------- BOTH - Treasure Hunter - SILVER --------
      • Custom script: call CreateSpell('I6E6', 'A6I1', 'A64P')
      • -------- BOTH - Treasure Hunter - GOLD --------
      • Custom script: call CreateSpell('I6E5', 'A6I2', 'A64Q')
      • -------- BOTH - Treasure Hunter - MASTER --------
      • Custom script: call CreateSpell('I6DJ', 'A6I7', 'A65D')
      • -------- ========= BATTLE THIEF - BOTH ========= --------
      • -------- Fradz - Battle Thief - Steal --------
      • Custom script: call CreateSpell('I6DG', 'A6I0', 'A6CF')
      • -------- ========= ALCHEMIST - BOTH ========= --------
      • -------- Both - Alchemist - RANDOM --------
      • Custom script: call CreateSpell('I6EC', 'A6IA', 'A66J')
      • -------- Both - Alchemist - STRENGTH --------
      • Custom script: call CreateSpell('I6EB', 'A6I8', 'A667')
      • -------- Both - Alchemist - AGILITY --------
      • Custom script: call CreateSpell('I6EA', 'A6IB', 'A66B')
      • -------- Both - Alchemist - INTELLIGENCE --------
      • Custom script: call CreateSpell('I6E9', 'A6IC', 'A66H')
      • -------- Both - Alchemist - HEALTH --------
      • Custom script: call CreateSpell('I6E8', 'A6ID', 'A66F')
      • -------- Both - Alchemist - MANA --------
      • Custom script: call CreateSpell('I6ED', 'A6I9', 'A65G')
      • -------- ========= TREASURE HUNTER - PHODOM ========= --------
      • -------- Phodom - Treasure Hunter - MINOR --------
      • Custom script: call CreateSpell('I6AS', 'A6H4', 'A657')
      • -------- Phodom - Treasure Hunter - MODERATE --------
      • Custom script: call CreateSpell('I6AT', 'A6H2', 'A64Y')
      • -------- Phodom - Treasure Hunter - HUGE --------
      • Custom script: call CreateSpell('I6AU', 'A6H0', 'A648')
      • -------- Phodom - Treasure Hunter - NOVICE --------
      • Custom script: call CreateSpell('I6B0', 'A6H1', 'A649')
      • -------- Phodom - Treasure Hunter - MEDIOCORE --------
      • Custom script: call CreateSpell('I68K', 'A6H7', 'A64G')
      • -------- Phodom - Treasure Hunter - EXPERT --------
      • Custom script: call CreateSpell('I68H', 'A6H5', 'A64L')
      • -------- ========= BATTLE THIEF - FRADZ ========= --------
      • -------- Fradz - Battle Thief - Mug --------
      • Custom script: call CreateSpell('I64B', 'A60V', 'A6GT')
      • -------- Fradz - Battle Thief - Unlock --------
      • Custom script: call CreateSpell('I64E', 'A60W', 'A6GU')
      • -------- Fradz - Battle Thief - Feint --------
      • Custom script: call CreateSpell('I64D', 'A613', 'A6GV')
      • -------- Fradz - Battle Thief - First Bonus --------
      • Custom script: call CreateSpell('I64F', 'A61P', 'A6DL')
      • -------- Fradz - Battle Thief - Second Bonus --------
      • Custom script: call CreateSpell('I64K', 'A63U', 'A6DO')
      • -------- Fradz - Battle Thief - Third Bonus --------
      • Custom script: call CreateSpell('I64J', 'A6GX', 'A6GR')
      • -------- Fradz - Battle Thief - Fourth Bonus --------
      • Custom script: call CreateSpell('I64I', 'A63Y', 'A6DM')
      • -------- Fradz - Battle Thief - Fifth Bonus --------
      • Custom script: call CreateSpell('I64L', 'A643', 'A6DP')
      • -------- Fradz - Battle Thief - Sixth Bonus --------
      • Custom script: call CreateSpell('I66A', 'A6GY', 'A6GQ')
      • -------- Fradz - Battle Thief - Seventh Bonus --------
      • Custom script: call CreateSpell('I687', 'A6GZ', 'A6DN')
      • -------- ========= TREASURE HUNTER - FRADZ ========= --------
      • -------- Fradz - Treasure Hunter - MINOR --------
      • Custom script: call CreateSpell('I6D0', 'A6HL', 'A6HT')
      • -------- Fradz - Treasure Hunter - MODERATE --------
      • Custom script: call CreateSpell('I6D7', 'A6HI', 'A6HU')
      • -------- Fradz - Treasure Hunter - HUGE --------
      • Custom script: call CreateSpell('I6CZ', 'A6HJ', 'A6HR')
      • -------- Fradz - Treasure Hunter - NOVICE --------
      • Custom script: call CreateSpell('I6D6', 'A6HO', 'A6HW')
      • -------- Fradz - Treasure Hunter - MEDIOCORE --------
      • Custom script: call CreateSpell('I6D4', 'A6HQ', 'A6HS')
      • -------- Fradz - Treasure Hunter - EXPERT --------
      • Custom script: call CreateSpell('I6D5', 'A6HP', 'A6HZ')
      • -------- ========= ALCHEMIST - GALEOTH ========= --------
      • -------- Galeoth - Alchemist - EXPERIENCE --------
      • Custom script: call CreateSpell('I6D8', 'A6IE', 'A66A')
      • -------- Galeoth - Alchemist - LIFE --------
      • Custom script: call CreateSpell('I6DD', 'A6IF', 'A669')
      • -------- Galeoth - Alchemist - ABILITY --------
      • Custom script: call CreateSpell('I6DC', 'A6IG', 'A65N')
      • -------- Galeoth - Alchemist - MAGIC --------
      • Custom script: call CreateSpell('I6DA', 'A6IH', 'A66G')
      • -------- Galeoth - Alchemist - POWER --------
      • Custom script: call CreateSpell('I6D9', 'A6II', 'A65J')
      • -------- ========= BATTLE THIEF - GALEOTH ========= --------
      • -------- Galeoth - Battle Thief - MUG --------
      • Custom script: call CreateSpell('I6EJ', 'A6IJ', 'A6IU')
      • -------- Galeoth - Battle Thief - UNLOCK --------
      • Custom script: call CreateSpell('I6EN', 'A6IK', 'A6IV')
      • -------- Galeoth - Battle Thief - FEINT --------
      • Custom script: call CreateSpell('I6EF', 'A6IL', 'A6IT')
      • -------- Galeoth - Battle Thief - FIRST --------
      • Custom script: call CreateSpell('I6EG', 'A6IM', 'A6IW')
      • -------- Galeoth - Battle Thief - SECOND --------
      • Custom script: call CreateSpell('I6EI', 'A6IR', 'A6IC')
      • -------- Galeoth - Battle Thief - THIRD --------
      • Custom script: call CreateSpell('I6EK', 'A6IN', 'A6IY')
      • -------- Galeoth - Battle Thief - FOURTH --------
      • Custom script: call CreateSpell('I6EL', 'A6IQ', 'A6IZ')
      • -------- Galeoth - Battle Thief - FIFTH --------
      • Custom script: call CreateSpell('I6EH', 'A6IO', 'A6J0')
      • -------- Galeoth - Battle Thief - SIXTH --------
      • Custom script: call CreateSpell('I6EM', 'A6IP', 'A6J1')
      • -------- Galeoth - Battle Thief - SEVENTH --------
      • Custom script: call CreateSpell('I6EE', 'A6IS', 'A6J2')
      • -------- Shadow Orb --------
      • Set ShadowOrbs[1] = Magic Orb 1
      • Set ShadowOrbs[2] = Magic Orb 2
      • Set ShadowOrbs[3] = Magic Orb 3
      • Set ShadowOrbs[4] = Magic Orb 4
      • Set ShadowOrbs[5] = Magic Orb 5
      • Set ShadowOrbs[6] = Magic Orb 6
      • Set ShadowOrbs[7] = Magic Orb 7
      • Set ShadowOrbs[8] = Magic Orb 8
      • Set ShadowOrbs[9] = Magic Orb 9
      • Set ShadowOrbs[10] = Magic Orb 10
      • Set ShadowOrbs[11] = Ultimate Orb
      • -------- === MAGIC BALLS === --------
      • Set PickItem_stackItems[1] = Low Magic Ball
      • Set PickItem_stackItems[2] = Moderate Magic Ball
      • Set PickItem_stackItems[3] = High Magic Ball
      • -------- === POTIONS === --------
      • Set PickItem_stackItems[4] = Minor Heal Potion
      • Set PickItem_stackItems[5] = Small Heal Potion
      • Set PickItem_stackItems[6] = Moderate Heal Potion
      • Set PickItem_stackItems[7] = Big Heal Potion
      • Set PickItem_stackItems[8] = Huge Heal Potion
      • Set PickItem_stackItems[9] = Minor Mana Potion
      • Set PickItem_stackItems[10] = Small Mana Potion
      • Set PickItem_stackItems[11] = Moderate Mana Potion
      • Set PickItem_stackItems[12] = Big Mana Potion
      • Set PickItem_stackItems[13] = Huge Mana Potion
      • Set PickItem_stackItems[14] = Minor Restoration Potion
      • Set PickItem_stackItems[15] = Moderate Restoration Potion
      • Set PickItem_stackItems[16] = Huge Restoration Potion
      • Set PickItem_stackItems[17] = Elixir
      • -------- === SCROLLS === --------
      • Set PickItem_stackItems[18] = Weak Healing Scroll
      • Set PickItem_stackItems[19] = Healing Scroll
      • Set PickItem_stackItems[20] = Strong Healing Scroll
      • Set PickItem_stackItems[21] = Weak Mana Scroll
      • Set PickItem_stackItems[22] = Healing Scroll
      • Set PickItem_stackItems[23] = Strong Healing Scroll
      • Set PickItem_stackItems[24] = Weak Restoration Scroll
      • Set PickItem_stackItems[25] = Restoration Scroll
      • Set PickItem_stackItems[26] = Strong Restoration Scroll
      • -------- === FOOD === --------
      • Set PickItem_stackItems[27] = Banana
      • Set PickItem_stackItems[28] = Cheese
      • Set PickItem_stackItems[29] = Bread
      • Set PickItem_stackItems[30] = Piece Of Meat
      • Set PickItem_stackItems[31] = Berry Pie
      • Set PickItem_stackItems[32] = Full Meat
      • Set PickItem_stackItems[33] = Hero Drink
      • Set PickItem_stackItems[34] = Glass Of Sludge
      • -------- === OTHER ITEMS === --------
      • Set PickItem_stackItems[35] = Unbroken Otzi Teeth
      • -------- === ALCHEMIST === --------
      • Set PickItem_stackItems[36] = Anglalor
      • Set PickItem_stackItems[37] = Bahmn
      • Set PickItem_stackItems[38] = Firaza
      • Set PickItem_stackItems[39] = Lakhnos
      • Set PickItem_stackItems[40] = Monthana
      • Set PickItem_stackItems[41] = Posamanien
      • Set PickItem_stackItems[42] = Riflo
      • Set PickItem_stackItems[43] = Tharamis
      • Set PickItem_stackItems[44] = Potion Of Strength
      • Set PickItem_stackItems[45] = Potion Of Agility
      • Set PickItem_stackItems[46] = Potion Of Intelligence
      • Set PickItem_stackItems[47] = Potion Of Health
      • Set PickItem_stackItems[48] = Potion Of Mana
      • Set PickItem_stackItems[49] = Potion Of Experience
      • Set PickItem_stackItems[50] = Potion Of Life
      • Set PickItem_stackItems[51] = Potion Of Ability
      • Set PickItem_stackItems[52] = Potion Of Resistance
      • Set PickItem_stackItems[53] = Potion of Power
      • Set PickItem_stackItems[54] = Triangle Flask
      • Set PickItem_stackItems[55] = Round Flask
      • Set PickItem_stackItems[56] = Square Flask
      • -------- === END === --------
      • Set PickItem_itemCount = 56
      • For each (Integer PickItem_int_i) from 4 to 56, do (Actions)
        • Loop - Actions
          • Set PickItem_stackLimit[PickItem_int_i] = -1
      • Set PickItem_stackLimit[1] = 3
      • Set PickItem_stackLimit[2] = 3
      • Set PickItem_stackLimit[3] = 3
      • -------- === HASHTABLES === --------
      • Hashtable - Create a hashtable
      • Set Heavens_Bless_Hash = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Flower_Hash = (Last created hashtable)
      • -------- === MAX LVL === --------
      • Set HeroMaxLvl[1] = 10
      • Set HeroMaxLvl[2] = 20
      • Set HeroMaxLvl[3] = 40
      • Set HeroMaxLvl[4] = 20
      • Set HeroMaxLvl[5] = 30
      • Set HeroMaxLvl[6] = 40
      • Set HeroMaxLvl[7] = 50
      • Set HeroMaxLvl[8] = 60
      • Set HeroMaxLvl[9] = 70
      • Set HeroMaxLvl[10] = 80
      • Set HeroMaxLvl[11] = 100
      • Set HeroMaxLvl[12] = 100
      • -------- === ITEM SETTINGS === --------
      • Set Item_Life[1] = 10
      • Set Item_Life[2] = 10
      • Set Item_Life[3] = 10
      • -------- === ITEM CHARGE STACK === --------
      • Hashtable - Create a hashtable
      • Set Item_Stack_Hash = (Last created hashtable)
      • -------- -------------------------------------------------- --------
      • -------- How many times the buff stacks --------
      • -------- -------------------------------------------------- --------
      • Set FirstSon_CONSTANTS[0] = 5
      • Set SecondSon_CONSTANTS[0] = 5
      • Set ThirdSon_CONSTANTS[0] = 5
      • Set ThreeSon_CONSTANTS[0] = 5
      • Set AerialSword_CONSTANTS[0] = 5
      • Set AerialSet_CONSTANTS[0] = 5
      • -------- -------------------------------------------------- --------
      • -------- Duration of each buff --------
      • -------- -------------------------------------------------- --------
      • Set FirstSon_CONSTANTS[1] = 30
      • Set SecondSon_CONSTANTS[1] = 30
      • Set ThirdSon_CONSTANTS[1] = 30
      • Set ThreeSon_CONSTANTS[1] = 30
      • Set AerialSword_CONSTANTS[1] = 30
      • Set AerialSet_CONSTANTS[1] = 30
      • -------- -------------------------------------------------- --------
      • -------- Proc chance percentage --------
      • -------- -------------------------------------------------- --------
      • Set FirstSon_CONSTANTS[2] = 25
      • Set SecondSon_CONSTANTS[2] = 25
      • Set ThirdSon_CONSTANTS[2] = 25
      • Set ThreeSon_CONSTANTS[2] = 25
      • Set AerialSword_CONSTANTS[2] = 25
      • Set AerialSet_CONSTANTS[2] = 25
      • -------- -------------------------------------------------- --------
      • -------- The ability --------
      • -------- -------------------------------------------------- --------
      • Set FirstSon_ABILITY = First Son (Dummy Spell Book)
      • Set SecondSon_ABILITY = Second Son (Dummy Spell Book)
      • Set ThirdSon_ABILITY = Third Son (Dummy Spell Book)
      • Set ThreeSon_ABILITY = Three Sons (Dummy Spell Book)
      • Set AerialSword_ABILITY = Aerial Sword (Dummy Spell Book)
      • Set AerialSet_ABILITY = Aerial Set (Dummy Spell Book)
      • -------- -------------------------------------------------- --------
      • -------- The item --------
      • -------- -------------------------------------------------- --------
      • Set FirstSon_ITEM = First Son
      • Set SecondSon_ITEM = Second Son
      • Set ThirdSon_ITEM = Third Son
      • Set ThreeSon_ITEM = Three Sons
      • Set AerialSword_ITEM = Aerial Sword
      • Set AerialSet_ITEM = Aerial Set
      • -------- -------------------------------------------------- --------
      • -------- -------------------------------------------------- --------
      • For each (Integer ItemStackLoop) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable FirstSon_ABILITY for (Player(ItemStackLoop))
          • Player - Disable SecondSon_ABILITY for (Player(ItemStackLoop))
          • Player - Disable ThirdSon_ABILITY for (Player(ItemStackLoop))
          • Player - Disable ThreeSon_ABILITY for (Player(ItemStackLoop))
          • Player - Disable AerialSword_ABILITY for (Player(ItemStackLoop))
          • Player - Disable AerialSet_ABILITY for (Player(ItemStackLoop))
      • -------- === RESTORE PANEL === --------
      • Set TempLoc = (Center of Anti Cheat Damage <gen>)
      • Unit - Create 1 (Restore Panel) for Player 1 (Red) at TempLoc facing Default building facing degrees
      • Set Restore_Panel[1] = (Last created unit)
      • Unit - Create 1 Restore Panel for Player 1 (Red) at TempLoc facing Default building facing degrees
      • Set Restore_Panel[2] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLoc)
EDIT: Ooh, now I got it. Wait a sec.

EDIT 2: Okay, here it is. I opened chapter 5 and the campaign crashed. I wonder what's going on?

http://www.hiveworkshop.com/forums/pastebin.php?id=orv4db

EDIT 3: If you are having problems I could do a little version of the campaign where everything that is not linked to that system will be removed.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Yes please. Create a light version of the campaing, only two maps need to be in there and as little imports, object data and triggers as possible to reduce the loading time.

Add a hero in the first map with some ability setup. I'm unsure what abilities/combat kings etc. to add. You could do that part.

So all I need to do is to hit esc and it loads the next map.

Then it's easy to debug.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
The problem is that I don't see a fast way to remove thousands of imported files. If I delete them one by one it takes half year to finish. Also same for object data... I tried to do whole new campaign but that's not option either, because then I won't have the needed object editor data(and the bug can lie in there too).

So all I can do is to remove other maps and 99% of the trigger data. The saving / loading time will reduce a little. But at least it's easier and faster way to test...

Now perhaps you can understand the pain when I'm testing this campaign. :D

I'll edit the post when it's done, shortly I guess.

EDIT: Okay, here's the campaign:

http://www.hiveworkshop.com/forums/pastebin.php?id=ixmg6f

Also I left the test map coz' there the system works... Also some of the combat kings @ ch 5 doesn't work coz' I made some changes. It doesn't effect to the system however.
 
Last edited:
Status
Not open for further replies.
Top