• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Game Cache, Loading Help

Status
Not open for further replies.
Level 20
Joined
Jan 6, 2008
Messages
2,627
Title says it all, my triggers:

  • Game Cache - Create a game cache from Map1.w3m
  • Set GameCache = (Last created game cache)
  • Trigger - Turn off (This trigger)
  • Set Point = (Center of UnitSpawn <gen>)
  • Unit - Create 1 Hero for Player 1 (Red) at Point facing Default building facing degrees
  • Set Unit = (Last created unit)
  • Custom script: call RemoveLocation(udg_Point)
  • Game Cache - Store Unit as Hero of Hero in GameCache
  • Game - Set the next level to Maps\Invulion\Map2.w3m
  • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)


Trying to Load, i dont know what to fill in Unit_Type

  • Load
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Map1.w3m
      • Set GameCache = (Last created game cache)
      • Game Cache - Reload all game cache data from disk
      • Set Point = (Player 1 (Red) start location)
      • Unit - Create 1 Unit_Type for Player 1 (Red) at Point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point)
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
If I get you right you want to load the saved unit.

So you use the function: GameCache - Restore unit!!

Or did I get you wrong?


Btw do not forgot to save the gamecache :)
In the new WE patch the gui function "save" is removed.
You have to use custom code "call SaveGameCache("YourCacheVariable")"
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
Thanks so much


EDIT:


Wont load him.

  • Load
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game Cache - Reload all game cache data from disk
      • Game Cache - Create a game cache from Map1.w3m
      • Set GameCache = (Last created game cache)
      • Set Point = (Player 1 (Red) start location)
      • Game Cache - Restore Hero of Hero from GameCache for Player 1 (Red) at Point facing 0.00
      • Set Unit = (Last created unit)
      • Custom script: call RemoveLocation(udg_Point)
      • Custom script: call SaveGameCache(udg_GameCache)
i saved the gamecache after every actions before setting the next level, right after storing him
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
yes, i did,
  • Then - Actions
    • Trigger - Turn off (This trigger)
    • Set Point = (Center of UnitSpawn <gen>)
    • Unit - Create 1 Hero for Player 1 (Red) at Point facing Default building facing degrees
    • Set Unit = (Last created unit)
    • Set Unitinteger = 1
    • Custom script: call RemoveLocation(udg_Point)
    • Game Cache - Store Unit as Hero of Hero in GameCache
    • Game Cache - Store Unitinteger as HeroInt of Hero in GameCache
    • Custom script: call SaveGameCache(udg_GameCache)
    • Game - Set the next level to Maps\Invulion\Map2.w3m
    • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Initalization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Disable ally color button and Disable creep camp button
      • Game - Enable selection and deselection functionality (Disable selection circles)
      • Game - Disable drag-selection functionality (Disable drag-selection box)
      • Game - Disable pre-selection functionality (Disable pre-selection circles, life bars, and object info)
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • Set Point = (Center of Dummy <gen>)
      • Unit - Create 1 HeroPreview for Neutral Passive at Point facing 360.00 degrees
      • Custom script: call RemoveLocation(udg_Point)
      • Set Dummy = (Last created unit)
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • -------- - --------
          • Set StatString[1] = Removed, reason: Too long
          • -------- - --------
          • Set DummyTypes[1] = HeroPreview
          • Set Unit_Types[1] = Hero
          • Set InfoStrings[1] = |c00C0C0C0Human Male: |r
      • -------- - --------
      • Set Point = (Center of Stats <gen>)
      • Floating Text - Create floating text that reads StatString[1] at Point with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set StatText[1] = (Last created floating text)
      • Custom script: call RemoveLocation(udg_Point)
      • Set Point = (Center of Info <gen>)
      • Floating Text - Create floating text that reads InfoStrings[1] at Point with Z offset 0.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set InfoFloatingText[1] = (Last created floating text)
      • Custom script: call RemoveLocation(udg_Point)
      • Game Cache - Create a game cache from Map1.w3m
      • Set GameCache = (Last created game cache)
      • Game Cache - Create a game cache from Map1.w3m
      • Custom script: call SaveGameCache(udg_GameCache)
Dont mind the other trigs, its a system
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I used these triggers in a campaign to save/load units:

  • Save Cache
    • Events
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Map1.w3v
      • Game Cache - Unit_1 as Hero1 of Heroes in (Last created game cache)
      • Game Cache - Save (Last created game cache)
  • Restore
    • Events
    • Conditions
    • Actions
      • Game Cache - Create a game cache from Map1.w3v
      • Game Cache - Restore Hero1 of Heroes from (Last created game cache) for Player 1 (Red) at (location) facing 270.00
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
You made a small mistake :)

I found it :/

You created the GameCaches as "GameCache.w3m"
But the gamecache ending is ".w3v" :D

w3m are the wc3 maps but a gamecache is not a map.


I fixed that and I changed the map change :/ because the old one did not work for me.


PS: I removed the "reload all..." and it works fine :)
 

Attachments

  • Invulion Campaign.w3n
    244.3 KB · Views: 37
Status
Not open for further replies.
Top