• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] A Jass Trigger Problem

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Hey!

This JASS trigger is made by Eleandor. But he have not been online for ages and that is why I put the problem to here so it will be fixed soon as possible. The one who can help me will get some REP and credits at the campaign.

This is a campaign. The problem is, that Eleandor made for me a spell book system, where spells are saved in spell books that will be SAVE/LOAD(STORE/RESTORE). The system is working almost perfectly(let's forget one problem for now). But the actually problem is, that chapter 5 and chapter 6 is like "crossroad" chapters where there will be two load trigger(all other chapters have only 1 load triggers). I mean:
  • Hero 1 can be played in chapter 1, 4, 5, 6, ...
  • Hero 2 can be played in chapter 2, 5, 6 ...
  • Hero 3 can be played in chapter 3, 6 ..
  • So, the problem is in chapter 5 and 6. Because there will be two times load trigger. Chapter 5 have to load Hero 1 and 2. And chapter 6 have to load Hero 1, 2 and 3. So, in chapter 5 and 6 there's 2 load trigger that mixes up everything.

So, what I want from you actually? I want you to repair this load trigger somehow and make everything to work clearly.


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 StoreHero takes gamecache cache, string missionkey, string key, unit whichunit, boolean loadspells returns nothing
    local integer i = 0
    call StoreBoolean(cache, missionkey, key + "loadspells", loadspells)
    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]))
                if not UnitRemoveAbility(whichunit, udg_Spell_System_abil[i]) then
                    call BJDebugMsg("could not remove the ability")
                endif
                //call BJDebugMsg("Level of spell " + I2S(i) + " = " + I2S(GetUnitAbilityLevel(whichunit, udg_Spell_System_spell[i])))
            else
                call StoreInteger(cache, missionkey, key + "spell" + I2S(i), 0)
            endif
            set i = i + 1
        endloop
    endif
    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
    local integer i = 0
    set bj_lastLoadedUnit = RestoreUnit(cache, missionkey, key, whichplayer, GetLocationX(whichloc), GetLocationY(whichloc), angle)
    call TriggerSleepAction(0.0)
    if GetStoredBoolean(cache, missionkey, key + "loadspells") == true then
        call UnitAddAbility(bj_lastLoadedUnit, GetSpellBook())
        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(bj_lastLoadedUnit, udg_Spell_System_abil[i])
                        //call BJDebugMsg("Loading spell " + I2S(i) + ": " + I2S(GetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i])))
                        call SetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i], GetStoredInteger(cache, missionkey, key + "spell" + I2S(i)))
                    endif
                else
                    call BJDebugMsg("")
                endif
                set i = i + 1
            endloop
        endif
    endif
    return bj_lastLoadedUnit
endfunction



  • Load From Chapter 4
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_4.w3v
      • Set GameCache = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
      • -------- === LOAD HERO SPELLS === --------
      • -------- === PHODOM === --------
      • -------- === 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)
      • -------- === 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 From Chapter 2
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_2.w3v
      • Set GameCache = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
      • -------- === LOAD HERO SPELLS === --------
      • -------- === FRADZ === --------
      • -------- === LOAD HEROES === --------
      • 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)


So, as you can see, I use in both load triggers this action:
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
But I don't see how else I should do. Now only one hero will have this spell book, and other hero won't have any spell book.

Currently, when I load the map. Hero 1 have hero 2's all abilities, but hero 2 doens't have anything(even the spell book).

If you need to have more information or anything, ask freely. I will happily answer to you. This have been bothering for me quite a long time. I don't understand anything about JASS and I do everything by GUI.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
I never used game caches so I don't really know about them, but wasn't all the point of the restore function that it restores the abilities? Why are you setting them after loading the hero.
Now if the answer was no, it looks like your if/else's for the abilities are wrong.
You are saying "if hero should have ability give him ability else check the other ability".

And anyways, say what's wrong. what doesn't work?
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
GhostWolf said:
I never used game caches so I don't really know about them, but wasn't all the point of the restore function that it restores the abilities?
Yes, the problem is saving/loading spell book and it's abilities. It work, but not in chapter 5 and 6 because of 2x load trigger.

GhostWolf said:
Why are you setting them after loading the hero.
Because if I would put them before hero loading, they wouldn't have the abilities.

GhostWolf said:
Now if the answer was no, it looks like your if/else's for the abilities are wrong.
So this is about that JASS trigger, huh? Then I don't ask me.

Ohh... maybe now you are confused. Forget about those HERO SPELLS. (Upgrade stuff, it's another system) ... I delete those triggers so people won't get confused.

GhostWolf said:
And anyways, say what's wrong. what doesn't work?
Currently, when I load the map. Hero 1 have hero 2's all abilities spell book abilities, but hero 2 doens't have anything(even the spell book).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I fear you didn't understand me.

I never used game caches so I don't really know about them, but wasn't all the point of the restore function that it restores the abilities?

As in, why are you even adding and setting abilities from the first point?
All the point of this lines
JASS:
if GetStoredBoolean(cache, missionkey, key + "loadspells") == true then
        call UnitAddAbility(bj_lastLoadedUnit, GetSpellBook())
        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(bj_lastLoadedUnit, udg_Spell_System_abil[i])
                        //call BJDebugMsg("Loading spell " + I2S(i) + ": " + I2S(GetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i])))
                        call SetUnitAbilityLevel(bj_lastLoadedUnit, udg_Spell_System_spell[i], GetStoredInteger(cache, missionkey, key + "spell" + I2S(i)))
                    endif
                else
                    call BJDebugMsg("")
                endif
                set i = i + 1
            endloop
        endif
    endif
is to add and set your abilities if you saved with a "true" boolean.

Why are you setting them after loading the hero.

This was a continuation to the first part.

Now if the answer was no, it looks like your if/else's for the abilities are wrong.
You are saying "if hero should have ability give him ability else check the other ability".

I meant that if the script isn't adding abilities for some reason, YOUR conditions for adding the skills seem wrong.

Code:
if hero should have skill 1 give and set skill one
else if hero should have skill 2 give and set skill two
else if hero should have skill 3 give and set skill 3

This is what you currently have. Shouldn't it be without the else's, unless you are supposed to only have one skill, which by what you said isn't true.

Code:
if hero should have skill 1 give and set skill one
if hero should have skill 2 give and set skill two
if hero should have skill 3 give and set skill 3

Now fix this and check if it works. If not, please post also your saving triggers.

Must go to sleep now because I'm ill, but I'll check this thread tomorrow.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
GhostWolf said:
As in, why are you even adding and setting abilities from the first point?
Like I said, I have not made the jass so I don't have a clue.

GhostWolf said:
is to add and set your abilities if you saved with a "true" boolean.
Because otherwise it would load abilities also for "boxes"(don't care about this).

Hmm... I'm not sure about the rest, but... IT WORKS PERFECTLY IN ALL OTHER CHAPTERS! Which means the problem is with these two load trigger. Don't care about other things, thank you.

And, the thing is, I don't understand anything about jass... So it would be better, to that you fix the jass trigger(just send whole text line with all fixed things)... So I can just import to the campaign and then try. Thanks for your comment + effort already. +rep.

EDIT: I just tried that I put this trigger:
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
after all triggers... but it seems like it didn't work. :<
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Okay, I post a load trigger from test chapter(here everything works perfectly, because there's only 1 save & load trigger). By the way, don't be scared, it's a bit long. But I wonder why you need this... because the problem is 2x this trigger when in loading triggers...
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)

  • 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, true )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz", udg_AAAFradz, true )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth", udg_AAAGaleoth, true )
    • -------- === SAVE BOXES === --------
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box", udg_AAPhodom_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box2", udg_AAPhodom_Box2, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box", udg_AAFradz_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box2", udg_AAFradz_Box2, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box", udg_AAGaleoth_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box2", udg_AAGaleoth_Box2, false )
    • -------- === SAVE SPELLS === --------
    • -------- === PHODOM === --------
    • -------- === Unit Spells === --------
    • 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)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Meltdown for Player 1 (Red)) as TCO_Meltdown of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Impact Flare for Player 1 (Red)) as TCO_Impact_Flare of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Aura Of Fire 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 for Player 1 (Red)) as TCO_Fire_Attack of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Flame Explosion for Player 1 (Red)) as TCO_Flame_Explosion of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Shield Of Fire for Player 1 (Red)) as TCO_Shield_Of_Fire of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Chaotic Rift for Player 1 (Red)) as TCO_Chaotic_Rift of TCO_Spells in (Last created game cache)
    • -------- === FRADZ === --------
    • -------- === Unit Spells === --------
    • 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)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Thunder for Player 1 (Red)) as TCO_Thunder of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Invisible Strike 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 for Player 1 (Red)) as TCO_Lightning_Attack of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Flash Strike 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 for Player 1 (Red)) as TCO_Lightning_Storm of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Bless Of Lightning for Player 1 (Red)) as TCO_Bless_Of_Lightning of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Lightning Orb 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 for Player 1 (Red)) as TCO_Teleport_Strike of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Hydro Shell for Player 1 (Red)) as TCO_Hydro_Shield of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Speedy Boost for Player 1 (Red)) as TCO_Speedy_Boost of TCO_Spells in (Last created game cache)
    • -------- === GALEOTH === --------
    • -------- === Unit Spells === --------
    • Game Cache - Store (Level of Summon Ice Element (G, T, 2, US) for AAAGaleoth) as TCO_Summon_Ice_Element of TCO_Spells in (Last created game cache)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Ice Bolt for Player 1 (Red)) as TCO_Ice_Bolt of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen for Player 1 (Red)) as TCO_Frozen of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen Cannon for Player 1 (Red)) as TCO_Frozen_Cannon of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Chain Heal for Player 1 (Red)) as TCO_Chain_Heal of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Magic Boost for Player 1 (Red)) as TCO_Magic_Boost of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen Paradise for Player 1 (Red)) as TCO_Frozen_Paradise 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 SPELL BOOKS === --------
    • Game Cache - Store Spell_System_Active as SpellSystemActive of Spells in GameCache
    • -------- Save Game Cache --------
    • Game Cache - Save GameCache



  • 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)
    • -------- === LOAD HERO SPELLS === --------
    • -------- === PHODOM === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Meltdown 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 to (Load TCO_Impact_Flare of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Aura Of Fire 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 to (Load TCO_Fire_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Flame Explosion to (Load TCO_Flame_Explosion of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Shield Of Fire 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 Chaotic Rift to (Load TCO_Chaotic_Rift of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • -------- === FRADZ === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Thunder to (Load TCO_Thunder of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Invisible Strike 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 to (Load TCO_Lightning_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Flash Strike 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 to (Load TCO_Lightning_Storm of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Bless Of Lightning 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 Lightning Orb 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 to (Load TCO_Teleport_Strike of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Hydro Shell 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 to (Load TCO_Speedy_Boost of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • -------- === GALEOTH === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Ice Bolt to (Load TCO_Ice_Bolt of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen to (Load TCO_Frozen of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen Cannon to (Load TCO_Frozen_Cannon of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Chain Heal to (Load TCO_Chain_Heal of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Magic Boost to (Load TCO_Magic_Boost of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen Paradise to (Load TCO_Frozen_Paradise 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>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAPhodom_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of PhoB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAPhodom_Box2 = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of FraB1 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAFradz_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of FraB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAFradz_Box2 = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of GalB1 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAGaleoth_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of GalB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAGaleoth_Box2 = (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)) Not equal to 0
      • 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)) Not equal to 0
          • 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)) Not equal to 0
              • 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)) Not equal to 0
      • 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
    • -------- === GALEOTH === --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Load TCO_Summon_Ice_Element of TCO_Spells from (Last created game cache)) Not equal to 0
      • Then - Actions
        • Unit - Add Summon Ice Element (G, T, 2, US) to AAAGaleoth
        • Unit - Set level of Summon Ice Element (G, T, 2, US) for AAAGaleoth to (Load TCO_Summon_Ice_Element 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))


EDIT: Okay, I have been thinking about the problem. I think everything could be fixed, if there would be a trigger that loads all spell book spells after few seconds(so all other stuff are loaded normaly)... Is this possible?

Well, time is already 1:43, I go sleep now, I hope everything will be fixed for tomorrow so I can upload campaign 2.6 version. Good night all.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I'm sorry, I can't really spot any problem.

But, again you missed all the point of those Jass functions.
They are storing and restoring all the abilities alone (if it works, of course). The way you are doing it now you could just do with the normal StoreUnit.

And if you think the problem is the game cache (which I don't think is but whatever), you could just use two game caches.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
The problem is because I use in chapter 5 and chapter 6 two loading triggers. Both of them use this trigger:
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
And because I use it two times, things go messy. But if I use it once only, spell books will be loaded only for 1 hero. So, triggers work perfectly, but it never made to work when there is 2 load triggers, this is the problem.

So, I want someone to edit that JASS trigger little to make it work with 2 loading trigger. Or something like that(or make it work that after 10 second of game, it puts the spell for heroes(after all stuff are loaded)).

I really hope someone can do this, because I can't release next version untill it's done.

EDIT: One guy told me that it bugs because it have "same label". So it overwrites the old one. And I agree, how this can be fixed? It would be excellent if you can post whole JASS trigger to here so I can just put it to the camapaign and test.
 
Last edited:
Level 37
Joined
Aug 14, 2006
Messages
7,602
-bumb-

So, the problem is too hard even for the hive to be fixed? Oh, what a shame...

EDIT: I put chapter 5 from the campaign to here. There's that save/load trigger that bugs... and everything you need to fix this damn bug.
 

Attachments

  • Chapter 5 - The Chones Ones Campaign.w3x
    2.1 MB · Views: 81
Last edited:
If Ghost Wolf couldn't help you tan this must be bad.
Try asking PP or some one else 2.

From what I understand from your explanation is that the system Eleanor made is not MUI, this means, it will conflict when multiple units use it.
I am not sure of this yet, I will see what I can do.
In the best case, is just some function you have wrong (again), in the worst case (and more probable in my opinion) it means I am correct about the system not being MUI and then you will have to fully remake it from zero or to find another solution to make it work.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Flame_Phoenix said:
From what I understand from your explanation is that the system Eleanor made is not MUI, this means, it will conflict when multiple units use it.
Something like that... but he fixed the code little... before the code loaded spells for boxed also, but then he put those true/false things now it loads spells for heroes only.

Flame_Phoenix said:
I am not sure of this yet, I will see what I can do.
Okay... actually I'm just waiting for a guy who makes this kind of comment: "Hey Aero, put this code "..." and everything start to work. Tell if not and I check it again."

Flame_Phoenix said:
In the best case, is just some function you have wrong (again), in the worst case (and more probable in my opinion) it means I am correct about the system not being MUI and then you will have to fully remake it from zero or to find another solution to make it work.
I hope I don't need to wait someone to remake it. The newest version is already late few weeks.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Dude.... I know why... because you use "Last Created Game Cache", but you already set the game cache... so it wont respond... instead of "Last Created Game Cache" use GameCache, the GameCache used to store the created one... (the variable GameCache you used at the start of the script to store the "Last Created Game Cache")

And ghostwolf is a really noobish if he didnt see that... such a easy mistake.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Dude.... I know why... because you use "Last Created Game Cache", but you already set the game cache... so it wont respond... instead of "Last Created Game Cache" use GameCache, the GameCache used to store the created one...

And ghostwolf is a really noobish if he didnt see that... such a easy mistake.
Use in where GameCache? I think you are now underestimating whole problem. :p
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
You are stupid as it seems.

Check the first two triggers in the script(the GUI scripts), there you store the Game Cache in a variable, but if you look at the stuff where you load from the Game Cache, you used Last Created Game Cache, but you cant use that, use instead the VARIABLE, which you used at the start of the trigger, the variable "GameCache"....

You do that in the save and the load trigger, fix that, and it seems that you have no idea about triggers at all..
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
redscores said:
You are stupid as it seems.
Thank you, and yes I am.

redscores said:
Check the first two triggers in the script(the GUI scripts), there you store the Game Cache in a variable, but if you look at the stuff where you load from the Game Cache, you used Last Created Game Cache, but you cant use that, use instead the VARIABLE, which you used at the start of the trigger, the variable "GameCache"....
Hmm.... Are you talking about this GUI trigger?


  • Load From Chapter 4
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_4.w3v
      • Set GameCache = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
      • -------- === LOAD HERO SPELLS === --------
      • -------- === PHODOM === --------
      • -------- === 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)
      • -------- === 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 From Chapter 2
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from TCOCache_2.w3v
      • Set GameCache = (Last created game cache)
      • -------- === LOAD SPELL BOOK === --------
      • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
      • -------- === LOAD HERO SPELLS === --------
      • -------- === FRADZ === --------
      • -------- === LOAD HEROES === --------
      • 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)


Or perhaps this?


  • 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, true )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz", udg_AAAFradz, true )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth", udg_AAAGaleoth, true )
    • -------- === SAVE BOXES === --------
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box", udg_AAPhodom_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box2", udg_AAPhodom_Box2, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box", udg_AAFradz_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box2", udg_AAFradz_Box2, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box", udg_AAGaleoth_Box, false )
    • Custom script: call StoreHero( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box2", udg_AAGaleoth_Box2, false )
    • -------- === SAVE SPELLS === --------
    • -------- === PHODOM === --------
    • -------- === Unit Spells === --------
    • 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)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Meltdown for Player 1 (Red)) as TCO_Meltdown of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Impact Flare for Player 1 (Red)) as TCO_Impact_Flare of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Aura Of Fire 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 for Player 1 (Red)) as TCO_Fire_Attack of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Flame Explosion for Player 1 (Red)) as TCO_Flame_Explosion of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Shield Of Fire for Player 1 (Red)) as TCO_Shield_Of_Fire of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Chaotic Rift for Player 1 (Red)) as TCO_Chaotic_Rift of TCO_Spells in (Last created game cache)
    • -------- === FRADZ === --------
    • -------- === Unit Spells === --------
    • 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)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Thunder for Player 1 (Red)) as TCO_Thunder of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Invisible Strike 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 for Player 1 (Red)) as TCO_Lightning_Attack of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Flash Strike 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 for Player 1 (Red)) as TCO_Lightning_Storm of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Bless Of Lightning for Player 1 (Red)) as TCO_Bless_Of_Lightning of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Lightning Orb 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 for Player 1 (Red)) as TCO_Teleport_Strike of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Hydro Shell for Player 1 (Red)) as TCO_Hydro_Shield of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Speedy Boost for Player 1 (Red)) as TCO_Speedy_Boost of TCO_Spells in (Last created game cache)
    • -------- === GALEOTH === --------
    • -------- === Unit Spells === --------
    • Game Cache - Store (Level of Summon Ice Element (G, T, 2, US) for AAAGaleoth) as TCO_Summon_Ice_Element of TCO_Spells in (Last created game cache)
    • -------- === Hero Spells === --------
    • Game Cache - Store (Current research level of Ice Bolt for Player 1 (Red)) as TCO_Ice_Bolt of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen for Player 1 (Red)) as TCO_Frozen of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen Cannon for Player 1 (Red)) as TCO_Frozen_Cannon of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Chain Heal for Player 1 (Red)) as TCO_Chain_Heal of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Magic Boost for Player 1 (Red)) as TCO_Magic_Boost of TCO_Spells in (Last created game cache)
    • Game Cache - Store (Current research level of Frozen Paradise for Player 1 (Red)) as TCO_Frozen_Paradise 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 SPELL BOOKS === --------
    • Game Cache - Store Spell_System_Active as SpellSystemActive of Spells in GameCache
    • -------- Save Game Cache --------
    • Game Cache - Save GameCache



  • 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)
    • -------- === LOAD HERO SPELLS === --------
    • -------- === PHODOM === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Meltdown 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 to (Load TCO_Impact_Flare of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Aura Of Fire 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 to (Load TCO_Fire_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Flame Explosion to (Load TCO_Flame_Explosion of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Shield Of Fire 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 Chaotic Rift to (Load TCO_Chaotic_Rift of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • -------- === FRADZ === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Thunder to (Load TCO_Thunder of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Invisible Strike 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 to (Load TCO_Lightning_Attack of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Flash Strike 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 to (Load TCO_Lightning_Storm of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Bless Of Lightning 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 Lightning Orb 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 to (Load TCO_Teleport_Strike of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Hydro Shell 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 to (Load TCO_Speedy_Boost of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • -------- === GALEOTH === --------
    • -------- === Hero Spells === --------
    • Player - Set the current research level of Ice Bolt to (Load TCO_Ice_Bolt of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen to (Load TCO_Frozen of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen Cannon to (Load TCO_Frozen_Cannon of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Chain Heal to (Load TCO_Chain_Heal of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Magic Boost to (Load TCO_Magic_Boost of TCO_Spells from (Last created game cache)) for Player 1 (Red)
    • Player - Set the current research level of Frozen Paradise to (Load TCO_Frozen_Paradise 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>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAPhodom_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of PhoB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Phodom_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAPhodom_Box2 = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of FraB1 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAFradz_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of FraB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Fradz_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAFradz_Box2 = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of GalB1 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box", Player(0), udg_TempLoc, 0.00 )
    • Set AAGaleoth_Box = (Last restored unit)
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Set TempLoc = (Center of GalB2 Load <gen>)
    • Custom script: call RestoreHero ( udg_GameCache, "TCO_Heroes", "TCO_Galeoth_Box2", Player(0), udg_TempLoc, 0.00 )
    • Set AAGaleoth_Box2 = (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)) Not equal to 0
      • 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)) Not equal to 0
          • 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)) Not equal to 0
              • 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)) Not equal to 0
      • 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
    • -------- === GALEOTH === --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Load TCO_Summon_Ice_Element of TCO_Spells from (Last created game cache)) Not equal to 0
      • Then - Actions
        • Unit - Add Summon Ice Element (G, T, 2, US) to AAAGaleoth
        • Unit - Set level of Summon Ice Element (G, T, 2, US) for AAAGaleoth to (Load TCO_Summon_Ice_Element 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))
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
About those last two, there you used Last Created Game Cache, for the store and load, but you need to use the variable you used, if you dont do that with the variable the heroes wont be stored at all. Because Last Created Game Cache responds to nothing (because the game cache is already stored in a variable).

Should I even MORE easy explain!?

Replace the "Last Created Game Cache" in the Load and Save with the variable (beside of course the variable set) easy going?

YOU SHOULD NEVER USE LAST CREATED GAME CACHE IF YOU ALREADY STORED THE GAME CACHE IN A VARIABLE!!!!!!!!!!!!!! JUST USE THE VARIABLE INSTEAD, IS THAT SO HARD TO UNDERSTAND!?
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Well, those last two triggers works perfectly. And by the way, save/load heroes works also perfectly. Actually all save/load works perfectly in both those save/load triggers. The only problem is that save/load spell book that doens't work perfectly(and it isn't that upgrade thing), it's that JASS trigger +
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
I think you are in wrong tracks, sorry. It's more complicated than this. Heheh... maybe your skills have reached their maximum point. :D
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
heheh, no, and there is a easy solution, create 2 game caches with the equal stuff saved, use 1 for the first and 1 for the second, the problem is maybe that stuff is deleted if you load from the game cache, so more save is better..

(actually i code since like a half year JASS...but only idiots use game caches, just btw, beside if you make a campaign, so i never used Game Cache)
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
redscores said:
heheh, no, and there is a easy solution, create 2 game caches with the equal stuff saved, use 1 for the first and 1 for the second, the problem is maybe that stuff is deleted if you load from the game cache, so more save is better..
Okay... As you told me before I'm a little stupid, so perhaps, you could help me a little with this case? I promise to give you even greater credits than now(you created for me that excellent circle system and thanks for that).
So, click this link, to download "chapter 5 from the campaign". Open it, change save/load trigger so they won't bug anymore. Then put a text to here and I will put it as you have put. Then I go test, and let's see if the bug is fixed.
 
Actually, when he uses LastCreatedGameCache is is referring to GameCache variable, although with a lower process, afaik.

That would only bug if he created 2 gamecaches, and then tried to use "lastCreatedGameCache" to access the first created one.

1- Create Cache
2- GameCache = LastCreatedGameCache
3- Create Cache again
4- use LastCreadtedGameCache now will always refer to 3 and not 2.

However I don't see this happening, so I don't think the bug is with that.

It will be hard to find people to help you Aero, I doubt many JAssers would want to understand a whole bunch of code that is not even commented, searching for a bug they have no idea what it is.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Yes, okay I understand. Eleandor visits everyday here at the hive and he won't help me. This is very odd, he made this whole mess. He made this system. Now he won't even care about this. He promised to do everything and now he don't even answer to me. This is his fault. His is behind all this mess. What a guy he is? He's ruining his own reputation here currently.

I'm going to contact him with everything I got then. He made this mess. And he's going to end what he started. Now, all my friends, let's start to spam him!
 
Yes, okay I understand. Eleandor visits everyday here at the hive and he won't help me.
How do you know that really happens ? ...

Anyway, I tried to see the code, he uses massive game cache to do everything, it is a mess for me to understand.
My bet, the code is not MUI, but there is no way I can be sure.
Try testing it this way:
1 - You restore Phodom in 1 trigger
2 - You wait 5 seconds, and then you restore Fradz, with a separate trigger.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Flame_Phoenix said:
How do you know that really happens ? ...
I just watched when he have logged last time. Today. And same have happened everyday.

Flame_Phoenix said:
Anyway, I tried to see the code, he uses massive game cache to do everything, it is a mess for me to understand.
My bet, the code is not MUI.
Try testing it this way:
1 - You restore Phodom in 1 trigger
2 - You wait 5 seconds, and then you restore Fradz, with a separate trigger.
This is how it actually currently works. And it don't work. :D

I think the code should be splitted to three.
1) One for hero 1.
1) One for hero 2.
1) One for hero 3.
I think that would be easy...

Then I just example load spells book spells in chapter 5 for hero 1 & 2. And in chapter 6 I load spell book spells for all heroes.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
You didnt beat me, It is just because campaigns need awful stuff, game caches are the biggest shit ever, period, and dont be proud, its not a problem for my maps, but for yours, and if you think like that, I hope your save system wont ever work, so you have to kick the Campaign, the last one who laughs is me. Not you.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Ok, mister negative. I was all the time joking, but it seems like you have taken all seriously. I wouldn't say this, because you have helped me alot, but you got wrong attitude currently.

EDIT: Okay, everything went forward when I combined 2 load trigger to one. However, spells I gathered in last chapters were not saved. The problem is this now.

  • Game Cache - Create a game cache from TCOCache_2.w3v
  • Set GameCache1 = (Last created game cache)
  • Game Cache - Create a game cache from TCOCache_4.w3v
  • Set GameCache2 = (Last created game cache)
  • Set Spell_System_Active = (Load SpellSystemActive of Spells from GameCache)
As you can see, that "Spell_System..." trigger have now that GameCache... Is it somehow possible to combine those two game cache to one so I can load all spells............................
 
Last edited:
Status
Not open for further replies.
Top