• 🏆 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!

Can't get game cache to work

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
So can anybody see what is wrong with my triggers please?

The first trigger runs when a unit enters a region. This begins the next map. It works, the current map ends and a new map is loaded. The second trigger is what stores all the game cache.

  • Cave Gate Entrance
    • Events
      • Unit - A unit enters Cave Entrance Gate <gen>
    • Conditions
      • (Triggering unit) Equal to Party_Order[1]
    • Actions
      • Unit Group - Pick every unit in Party_Group and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Set MusicVolume = 100.00
      • Trigger - Run Store Game Cache <gen> (ignoring conditions)
      • Trigger - Turn off Count Distance <gen>
      • Trigger - Turn on Sound Fade out <gen>
      • Cinematic - Fade out over 2.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait until (MusicVolume Equal to 0.00), checking every 0.10 seconds
      • Game - Set the next level to Gate's Cave.w3x
      • Game - Victory Player 1 (Red) (Skip dialogs, Skip scores)
  • Store Game Cache
    • Events
    • Conditions
    • Actions
      • -------- ------------- --------
      • -------- Resources --------
      • -------- ------------- --------
      • Set Cache_Gold = (Player 1 (Red) Current gold)
      • Game Cache - Store Cache_Gold as Gold of Resources in Cache
      • Set Cache_Lumber = (Player 1 (Red) Current lumber)
      • Game Cache - Store Cache_Lumber as Lumber of Resources in Cache
      • -------- ------------- --------
      • -------- Party --------
      • -------- ------------- --------
      • Game Cache - Store Party_Order[1] as 1 of Party in Cache
      • Game Cache - Store Party_Order[2] as 2 of Party in Cache
      • Game Cache - Store Party_Order[3] as 3 of Party in Cache
      • Game Cache - Store Party_Order[4] as 4 of Party in Cache
      • Game Cache - Save Cache
This next trigger is inside the second map. I originally had "Map Initialization" and changed it to elapsed time because it wasn't working. For some reason, my heroes arn't being created. Also, the first time I played the map, I get a "waiting for Host" error message. Some kind of desync? Btw, this is a single player campaign, how did I manage a desync???

  • Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set BabarukusTail[1] = Babaruku Tail 0007 <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • -------- ---------- --------
      • -------- Game Cache Recall --------
      • -------- ---------- --------
      • Game Cache - Create a game cache from Cache.w3v
      • Set Cache = (Last created game cache)
      • Set Cache_Gold = (Load Gold of Resources from Cache)
      • Player - Set Player 1 (Red) Current gold to Cache_Gold
      • Set Cache_Lumber = (Load Lumber of Resources from Cache)
      • Player - Set Player 1 (Red) Current lumber to Cache_Gold
      • Trigger - Turn off Cave Gate Entrance <gen>
      • Game Cache - Restore 1 of Party from Cache for Player 1 (Red) at (Center of Cave Gate Exit <gen>) facing 90.00
      • Set Party_Order[1] = (Last created unit)
      • Game Cache - Restore 2 of Party from Cache for Player 1 (Red) at (Center of Cave Gate Exit <gen>) facing 90.00
      • Set Party_Order[2] = (Last created unit)
      • Game Cache - Restore 3 of Party from Cache for Player 1 (Red) at (Center of Cave Gate Exit <gen>) facing 90.00
      • Set Party_Order[3] = (Last created unit)
      • Game Cache - Restore 4 of Party from Cache for Player 1 (Red) at (Center of Cave Gate Exit <gen>) facing 90.00
      • Set Party_Order[4] = (Last created unit)
      • Trigger - Run Follow The Leader <gen> (checking conditions)
      • Wait 0.01 seconds
      • Trigger - Turn on Cave Gate Entrance <gen>
PartyOrder[2], PartyOrder[3] and PartyOrder[4] all return null because I haven't set them yet, however PartyOrder[1] has been assigned a unit.
 
Last edited:
Radicool said:
For some reason, my heroes are being created.

Do you mean aren't?

Radicool said:
]PartyOrder[2], PartyOrder[3] and PartyOrder[4] all return null because I haven't set them yet, however PartyOrder[1] has been assigned a unit.

The issue could maybe be that you're storing null units or using waits.

Does it work if you remove

  • Trigger - Run Follow The Leader <gen> (checking conditions)
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Do you mean aren't?

Lol, yes I meant they "aren't" being created :)

Does it work if you remove

I'll check.

Edit: No, I still get a desync thing (desync appears random. Only happens sometimes.) and my hero does not appear on the map.

Edit 2: Perhaps I could remove the party order 2, 3 and 4 for now and see if 1 works. This eliminates the null possibility.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
  • Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set BabarukusTail[1] = Babaruku Tail 0007 <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • -------- ---------- --------
      • -------- Game Cache Recall --------
      • -------- ---------- --------
      • Game Cache - Create a game cache from Cache.w3v
      • Set Cache = (Last created game cache)
      • Set Cache_Gold = (Load Gold of Resources from Cache)
      • Player - Set Player 1 (Red) Current gold to Cache_Gold
      • Set Cache_Lumber = (Load Lumber of Resources from Cache)
      • Player - Set Player 1 (Red) Current lumber to Cache_Gold
      • Game Cache - Restore 1 of Party from Cache for Player 1 (Red) at (Center of Cave Gate Exit <gen>) facing 90.00
      • Set Party_Order[1] = (Last created unit)
Here. I have removed most unnecessary things. Still doesn't work.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Does the cache saving get executed multiple times?

In future I may make multiple saves, however at this stage no. However, I do create the game cache in my map initialization trigger of the first map.

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ------------------ --------
      • -------- Game Cache --------
      • -------- ------------------ --------
      • Game Cache - Create a game cache from Cache.w3v
      • Set Cache = (Last created game cache)
      • -------- ------------------ --------
      • -------- Misc --------
      • -------- ------------------ --------
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Entire map)
      • Player - For Player 1 (Red), turn Alliance (non-aggression) On toward Player 12 (Brown)
      • Player - For Player 9 (Gray), turn Alliance (non-aggression) On toward Player 12 (Brown)
      • Player - For Player 12 (Brown), turn Alliance (non-aggression) On toward Player 1 (Red)
      • Player - For Player 12 (Brown), turn Alliance (non-aggression) On toward Player 9 (Gray)
      • Game - Turn the day/night cycle Off
      • Game - Set the time of day to 8.00
      • Unit Group - Add Ryu (Child) 0002 <gen> to Party_Group
      • Sound - Set Ambient Sounds to 0.00%
      • Sound - Set Animation and Spell Sounds to 0.00%
      • Sound - Set Fire Sounds to 0.00%
      • Sound - Set Combat Sounds to 0.00%
      • Sound - Set Unit Movement Sounds to 0.00%
      • Sound - Set Unit Response Sounds to 0.00%
      • Animation - Change Mountain Dragon 0018 <gen>'s animation speed to 0.00% of its original speed
      • Unit - Make Grass 0017 <gen> Invulnerable
      • Unit - Change color of Hulk (Gate) 0021 <gen> to Orange
      • Quest - Create a Required quest titled Testing Commands with the description -start game (starts..., using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
      • Quest - Create a Optional quest titled Credits with the description Music and some icon..., using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
      • -------- ------------------ --------
      • -------- Talk System --------
      • -------- ------------------ --------
      • -------- Talk System Group. Used for resetting facing angle. --------
      • Set Talk_System_Group = (Units in (Playable map area) owned by Player 9 (Gray))
      • -------- 1: Ryu --------
      • -------- 2: Bow --------
      • -------- 3: Rand --------
      • -------- 4: Katt --------
      • -------- 5: Nina --------
      • -------- 6: Sten --------
      • -------- 7: Jean --------
      • -------- 8: Spar --------
      • -------- 9: Bleu --------
      • -------- 11: Ganer (Gate) --------
      • Set Talk_System_String[11] = |cffffcc00Ganer:|r Hurry and find Yua.
      • Set Talk_System_Angle[11] = 360.00
      • -------- 15: Mary (Gate) --------
      • Set Talk_System_String[15] = |cffffcc00Mary:|r Doesn't Yua like to play at the back of the mountain?
      • Set Talk_System_Angle[15] = 360.00
      • -------- 16: Rose (Gate) --------
      • Set Talk_System_String[16] = |cffffcc00Rose:|r Yua? I think I last saw her running to the back of the village.
      • Set Talk_System_Angle[16] = 180.00
      • -------- 17: Jack (Gate) --------
      • Set Talk_System_String[17] = |cffffcc00Jack:|r Lately kids have been acting like orphans to get into the church and stealing whatever they can find!
      • Set Talk_System_Angle[17] = 270.00
      • -------- 18: Bob (Gate) --------
      • Set Talk_System_String[18] = |cffffcc00Bob:|r 3 Years ago the village was attacked by Demons. We were outnumbered but then a Dragon came and saved us. The Dragon sleeps in the mountains behind the village.
      • Set Talk_System_Angle[18] = 90.00
      • -------- 19: Tom (Gate) --------
      • Set Talk_System_String[19] = |cffffcc00Tom:|r You cannot leave the village without an adult.
      • Set Talk_System_Angle[19] = 270.00
      • -------- ------------------ --------
      • -------- Variables --------
      • -------- ------------------ --------
      • Set Party_Order[1] = Ryu (Child) 0002 <gen>
      • Set BabarukusTail[1] = Babaruku Tail 0028 <gen>
      • Set BabarukusTail[2] = Babaruku Tail 0027 <gen>
      • Set BabarukusTail[3] = Babaruku Tail 0026 <gen>
      • Set BabarukusTail[4] = Babaruku Tail 0025 <gen>
      • Set WalkPoint2 = (Position of Party_Order[1])
      • Set WalkAmountRandomReal = (Random real number between 900.00 and 2000.00)
      • Set CurrentlyPlayingMusic[1] = 14_Please_God <gen>
      • Set CurrentlyPlayingMusic[2] = 35_Cross_Counter <gen>
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Ok, so I added wait commands in between each storage of data into cache. It did not fix the waiting for host problem. Here is my new code:

  • Store Game Cache
    • Events
    • Conditions
    • Actions
      • -------- ------------- --------
      • -------- Resources --------
      • -------- ------------- --------
      • Set Cache_Gold = (Player 1 (Red) Current gold)
      • Game Cache - Store Cache_Gold as Gold of Resources in Cache
      • Wait 0.10 seconds
      • Set Cache_Lumber = (Player 1 (Red) Current lumber)
      • Game Cache - Store Cache_Lumber as Lumber of Resources in Cache
      • Wait 0.10 seconds
      • -------- ------------- --------
      • -------- Party --------
      • -------- ------------- --------
      • Game Cache - Store Party_Order[1] as 1 of Party in Cache
      • Game Cache - Save Cache
Here is the error message:

attachment.php
 

Attachments

  • Waiting for Host....jpg
    Waiting for Host....jpg
    99.1 KB · Views: 142
  • Quest - Create a Required quest titled Testing Commands with the description -start game (starts..., using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
  • Wait - 0.01
  • Quest - Create a Optional quest titled Credits with the description Music and some icon..., using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
and others like it
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
•I don't see the variable Party set anywhere.

When you say Party variable, do you mean the one used in game cache? I'm new to game cache and didn't realise you had to create a variable for it. I followed this tutorial and he didn't make a variable for it.

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/game-caches-6273/

•Is Cache.w3v used by another map that could conflict?

The cache file is being used by both maps. To my understanding, you need to use the same cache file for all maps to recall the cache properly. The same cache file is not being used in any other campaign to my understanding. Unless a map I played on BNET a year ago could still have stored cache on my computer with the same name? What are the odds but. lol. Maybe I should pick a more unique name for my cache.

•Make sure whatever triggers that use GC aren't being ran twice without finishing (disable it and enable it again when over).

Nope. They only run once.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Ok here we go. The map wont work properly by itself. you need to type in commands to set the map to start. Type "-cave" without the quotes to simulate the changing of maps. If your name is not "worldEdit", change the condition or delete it. There are commands in the quest menu. And don't mention leaks. Only started the map, everything is mainly in an alpha stage.
 
Last edited:
Status
Not open for further replies.
Top