• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Game Cache doesn't load hero

Status
Not open for further replies.
Level 9
Joined
Dec 25, 2008
Messages
110
I have the following load hero trigger which is called on the initialization trigger of my campaign chapters (from chapter 2 onwards).


  • LoadData
    • Events
    • Conditions
    • Actions
      • Game Cache - Reload all game cache data from disk
      • Game Cache - Create a game cache from Campaign.w3v
      • Game Cache - Restore CHero of Heroes from (Last created Game Cache) for Player 2 (Blue) at (Center of HeroAppears<gen>) facing 0.00
      • Set CHero = (Last restored unit)
      • Trigger - Turn off (This trigger)


And this trigger,which performs the save action in all chapters (except for the final chapter of course).


  • SaveData
    • Events
    • Conditions
    • Actions
      • ------- Storage is the game cache used -------
      • Game Cache - Store CHero as Heroes of Campaign.w3v in Storage
      • Game Cache - Save Storage
      • Trigger - Turn off (This trigger)


Problem is, when I load the data, the hero does not get restored... any one know why?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
@SaveData you picked "Heroes" as childLabel and "Campaign.w3v" as parentLabel instead of "CHero" as childLabel and "Heroes" as parentLabel.

You have to initialize the game cache to a path like you did it @LoadData but afterwards the game cache is an object, you are not to state the path in other game cache actions. So make sure Storage @SaveData is initialized too.
 
Level 9
Joined
Dec 25, 2008
Messages
110
..ok so I fixed that, but it still isn't loading the hero.


  • SaveData
    • Events
    • Conditions
    • Actions
      • -------- Game cache is created at initialization --------
      • Game Cache - Store Hero as CHero of Heroes in Storage
      • Game Cache - Save Storage
      • Trigger - Turn off (This trigger)



  • LoadData
    • Events
    • Conditions
    • Actions
      • Game Cache - Reload all game cache data from disk
      • Game Cache - Create a game cache from Campaign.w3v
      • Set Storage = (Last created game cache)
      • Game Cache - Restore CHero of Heroes from Storage for Player 2 (Blue) at (Center of (HeroAppears<gen>))
      • Set CCHero = (Last restored unit)
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top