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

[Trigger] Hero unit doesn't load from GameCache.. Please help!!

Status
Not open for further replies.
Level 5
Joined
Jul 13, 2008
Messages
109
Hi, i have this HUGE problem with my GameCache.. currently my campaign has Prologue, CHapter 1, Bonus stage, and chapter 2... so far my GameCache has worked for Prologue to Chapter 1, and Chapter 1 to Bonus. But for some reason bonus to chapter 2, the hero doesnt load at all, EVERYTHING else does, resources and boxes for holding extra items, but the hero himself doesnt load..

Here's the trigger i have been using for all maps so far. only difference is the save file name...

  • Save Things
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Wait 1.00 seconds
      • -------- === CREATE GAME CACHE === --------
      • Game Cache - Create a game cache from Kratos_B1.w3v
      • Set GameCache = (Last created game cache)
      • -------- Save Heroes --------
      • Game Cache - Store AAAKratos as Kratos_Unit_B1 of Kratos_Save_B1 in GameCache
      • -------- Save Boxes --------
      • Game Cache - Store AAABox1 as Kratos_Box1_B1 of Kratos_Save_B1 in GameCache
      • Game Cache - Store AAABox2 as Kratos_Box2_B1 of Kratos_Save_B1 in GameCache
      • -------- Save Gold/Wood --------
      • Set Kratos_Gold = (Player 1 (Red) Current gold)
      • Game Cache - Store Kratos_Gold as Kratos_Gald_B1 of Kratos_Resources_B1 in GameCache
      • Set Kratos_Wood = (Player 1 (Red) Current lumber)
      • Game Cache - Store Kratos_Wood as Kratos_Wood_B1 of Kratos_Resources_B1 in GameCache
      • Set Kratos_Food = (Player 1 (Red) Food used)
      • Game Cache - Store Kratos_Food as Kratos_Food_B1 of Kratos_Resources_B1 in GameCache
      • -------- Save Game Cache --------
      • Game Cache - Save GameCache
      • Wait 1.00 seconds
      • Game - Show custom campaign button 4
      • Game - Set the next level to Kratos' Campaign Chapter Two.w3m
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Load Things
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- === LOAD GAME CACHE === --------
      • Game Cache - Create a game cache from Kratos_B1.w3v
      • Set GameCache = (Last created game cache)
      • -------- LOAD HEROES --------
      • Game Cache - Restore Kratos_Unit_B1 of Kratos_Save_B1 from GameCache for Player 1 (Red) at (Center of Kratos Begin <gen>) facing (Center of Kratos Begin <gen>)
      • Set AAAKratos = (Last created unit)
      • -------- LOAD BOXES --------
      • Game Cache - Restore Kratos_Box1_B1 of Kratos_Save_B1 from GameCache for Player 1 (Red) at (Center of Box 2 <gen>) facing (Center of Box 2 <gen>)
      • Set AAABox1 = (Last restored unit)
      • Game Cache - Restore Kratos_Box2_B1 of Kratos_Save_B1 from GameCache for Player 1 (Red) at (Center of Box 1 <gen>) facing (Center of Box 1 <gen>)
      • Set AAABox2 = (Last restored unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Hero level of AAAKratos) Equal to 11
              • (Hero level of AAAKratos) Equal to 12
              • (Hero level of AAAKratos) Equal to 13
              • (Hero level of AAAKratos) Equal to 14
              • (Hero level of AAAKratos) Equal to 15
              • (Hero level of AAAKratos) Equal to 16
              • (Hero level of AAAKratos) Equal to 17
              • (Hero level of AAAKratos) Equal to 18
              • (Hero level of AAAKratos) Equal to 19
              • (Hero level of AAAKratos) Equal to 20
        • Then - Actions
          • Unit - Set level of Spell Revenge for AAAKratos to 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Hero level of AAAKratos) Equal to 21
                  • (Hero level of AAAKratos) Equal to 22
                  • (Hero level of AAAKratos) Equal to 23
                  • (Hero level of AAAKratos) Equal to 24
                  • (Hero level of AAAKratos) Equal to 25
                  • (Hero level of AAAKratos) Equal to 26
                  • (Hero level of AAAKratos) Equal to 27
                  • (Hero level of AAAKratos) Equal to 28
                  • (Hero level of AAAKratos) Equal to 29
                  • (Hero level of AAAKratos) Equal to 30
            • Then - Actions
              • Unit - Set level of Spell Revenge for AAAKratos to 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Hero level of (Last restored unit)) Equal to 31
                      • (Hero level of (Last restored unit)) Equal to 32
                      • (Hero level of (Last restored unit)) Equal to 33
                      • (Hero level of (Last restored unit)) Equal to 34
                      • (Hero level of (Last restored unit)) Equal to 35
                      • (Hero level of (Last restored unit)) Equal to 36
                      • (Hero level of (Last restored unit)) Equal to 37
                      • (Hero level of (Last restored unit)) Equal to 38
                      • (Hero level of (Last restored unit)) Equal to 39
                      • (Hero level of (Last restored unit)) Equal to 40
                • Then - Actions
                  • Unit - Set level of Spell Revenge for (Last restored unit) to 4
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Hero level of (Last restored unit)) Equal to 41
                          • (Hero level of (Last restored unit)) Equal to 42
                          • (Hero level of (Last restored unit)) Equal to 43
                          • (Hero level of (Last restored unit)) Equal to 44
                          • (Hero level of (Last restored unit)) Equal to 45
                          • (Hero level of (Last restored unit)) Equal to 46
                          • (Hero level of (Last restored unit)) Equal to 47
                          • (Hero level of (Last restored unit)) Equal to 48
                          • (Hero level of (Last restored unit)) Equal to 49
                          • (Hero level of (Last restored unit)) Equal to 50
                    • Then - Actions
                      • Unit - Set level of Spell Revenge for (Last restored unit) to 5
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Hero level of (Last restored unit)) Equal to 51
                              • (Hero level of (Last restored unit)) Equal to 52
                              • (Hero level of (Last restored unit)) Equal to 53
                              • (Hero level of (Last restored unit)) Equal to 54
                              • (Hero level of (Last restored unit)) Equal to 55
                              • (Hero level of (Last restored unit)) Equal to 56
                              • (Hero level of (Last restored unit)) Equal to 57
                              • (Hero level of (Last restored unit)) Equal to 58
                              • (Hero level of (Last restored unit)) Equal to 59
                              • (Hero level of (Last restored unit)) Equal to 60
                        • Then - Actions
                          • Unit - Set level of Spell Revenge for (Last restored unit) to 6
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Hero level of (Last restored unit)) Equal to 61
                                  • (Hero level of (Last restored unit)) Equal to 62
                                  • (Hero level of (Last restored unit)) Equal to 63
                                  • (Hero level of (Last restored unit)) Equal to 64
                                  • (Hero level of (Last restored unit)) Equal to 65
                                  • (Hero level of (Last restored unit)) Equal to 66
                                  • (Hero level of (Last restored unit)) Equal to 67
                                  • (Hero level of (Last restored unit)) Equal to 68
                                  • (Hero level of (Last restored unit)) Equal to 69
                                  • (Hero level of (Last restored unit)) Equal to 70
                            • Then - Actions
                              • Unit - Set level of Spell Revenge for (Last restored unit) to 7
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Hero level of (Last restored unit)) Equal to 71
                                      • (Hero level of (Last restored unit)) Equal to 72
                                      • (Hero level of (Last restored unit)) Equal to 73
                                      • (Hero level of (Last restored unit)) Equal to 74
                                      • (Hero level of (Last restored unit)) Equal to 75
                                      • (Hero level of (Last restored unit)) Equal to 76
                                      • (Hero level of (Last restored unit)) Equal to 77
                                      • (Hero level of (Last restored unit)) Equal to 78
                                      • (Hero level of (Last restored unit)) Equal to 79
                                      • (Hero level of (Last restored unit)) Equal to 80
                                • Then - Actions
                                  • Unit - Set level of Spell Revenge for (Last restored unit) to 8
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Or - Any (Conditions) are true
                                        • Conditions
                                          • (Hero level of (Last restored unit)) Equal to 81
                                          • (Hero level of (Last restored unit)) Equal to 82
                                          • (Hero level of (Last restored unit)) Equal to 83
                                          • (Hero level of (Last restored unit)) Equal to 84
                                          • (Hero level of (Last restored unit)) Equal to 85
                                          • (Hero level of (Last restored unit)) Equal to 86
                                          • (Hero level of (Last restored unit)) Equal to 87
                                          • (Hero level of (Last restored unit)) Equal to 88
                                          • (Hero level of (Last restored unit)) Equal to 89
                                          • (Hero level of (Last restored unit)) Equal to 90
                                    • Then - Actions
                                      • Unit - Set level of Spell Revenge for (Last restored unit) to 9
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Or - Any (Conditions) are true
                                            • Conditions
                                              • (Hero level of (Last restored unit)) Equal to 91
                                              • (Hero level of (Last restored unit)) Equal to 92
                                              • (Hero level of (Last restored unit)) Equal to 93
                                              • (Hero level of (Last restored unit)) Equal to 94
                                              • (Hero level of (Last restored unit)) Equal to 95
                                              • (Hero level of (Last restored unit)) Equal to 96
                                              • (Hero level of (Last restored unit)) Equal to 97
                                              • (Hero level of (Last restored unit)) Equal to 98
                                              • (Hero level of (Last restored unit)) Equal to 99
                                              • (Hero level of (Last restored unit)) Equal to 100
                                        • Then - Actions
                                          • Unit - Set level of Spell Revenge for (Last restored unit) to 10
                                        • Else - Actions
      • -------- === LOAD RESOURCES === --------
      • Player - Set Player 1 (Red) Current gold to (Load Kratos_Gald_B1 of Kratos_Resources_B1 from GameCache)
      • Player - Set Player 1 (Red) Current lumber to (Load Kratos_Wood_B1 of Kratos_Resources_B1 from GameCache)
      • Player - Set Player 1 (Red) Food used to (Load Kratos_Food_B1 of Kratos_Resources_B1 from GameCache)
      • Set Kratos_Food = (Player 1 (Red) Food used)
Please if anyone may know what the cause is i'll be SOOOOO grateful!!
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I don't know if that would be a problem, but is the dying unit that triggers the "Save Things" trigger perhaps the AAAKratos unit?

Is AAAKratos a unit anyway?

In the "Load things" trigger you must replace "Set AAAKratos = (Last created unit)" by "Set AAAKratos = (Last restored unit)"

Oh, and in the "Load Things" trigger you might simply replace that loooong if/then/else statement with an action in function of your hero's level...
  • Unit - Set level of Spell Revenge for AAAKratos to ((Hero level of (Last restored unit)) + 9) / 10
 
Level 5
Joined
Jul 13, 2008
Messages
109
AAAKratos is the dying unit, and yes he is a unit.

oops, ok i changed last created unit to last restored unit, and it's still not working :(

you think that bcuz he dies it stops it from working,,, well before i made it one trigger there was another,,, the other save triggered from a timer ending. and this still didnt work :(
 
Level 5
Joined
Jul 13, 2008
Messages
109
Level 5
Joined
Jul 13, 2008
Messages
109
The problem is the hero doesn't load from the last map (bonus stage), i have noticed that the next map (chapter 2) doesn't display on the campaign page, only the first 3 maps are displayed. maybe this could be the problem? bcuz all the save/load triggers are identical too all maps

Also, i looked at another persons campaign and after each save (hero and storage boxes) there is a custom script. And the text in the script is similar to coding, and i don't understand it at all :S
 
Level 5
Joined
Jul 13, 2008
Messages
109
Here are some pictures of the triggers and campaign editor...

Campaign%20editor.jpg


Save%20trigger.jpg


Load%20Trigger.jpg


Hope this helps!
 
Level 5
Joined
Oct 17, 2006
Messages
151
the debug message would be like this:

Show unit type of (loaded unit) so that way you can find out whether you are loading the unit or not. If you are then its something else. If your not you know where to look and its in your saving.
 
Level 37
Joined
Aug 14, 2006
Messages
7,603
I think the problem is with the event. You must resurrect your hero before saving it to game cache. Also use some waits, they are sexy.

Try this. If not working, slap me in the ass.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to (Last created unit)
    • Actions
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 2.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Hide revival graphics
      • Unit - Make (Last created unit) Invulnerable
      • Wait 2.00 seconds
      • -------- GAME CACHE --------
      • Wait 2.00 seconds
      • Game - Display to (All players) the text: NEXT CHAPTER
 
Status
Not open for further replies.
Top