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

[Solved] Game Caches not working

Status
Not open for further replies.
Level 7
Joined
Feb 10, 2011
Messages
133
Hello,
I'm currently working on a custom campaign and I use game caches to store heroes between maps. I did so and everything worked perfectly fine.
Then I did some updates, I expanded the missions but it didn't work anymore. When I order to restore the hero, no unit is created. I checked the triggers and they are the same like the ones that worked.
Any idea what might have caused that?
 
Perhaps the game cache called is not exactly the same.

One:
JASS:
    call InitGameCache("someFile.w3v")

Two:
JASS:
    call InitGameCache("otherFile.w3v")

Or if that's not the case, you could try checking if the strings present are generated globally, so that there would be no locally-generated string to StringHash with...

Maybe they are not saved in the same indices...
 
Level 7
Joined
Feb 10, 2011
Messages
133
Well, they are both called the same and the Labels and Cathegories and the same too, I spell-checked them like 5 times
also, when I try to save the hero, I tried doing it various ways, saving in between, at the end only, never, vurnulable, invurnulable, as a variable or as a <gen>, every time I load the value, it goes out as "No Unit" and I have no idea what more to change

EDIT: Ok, so I did a test, where at the end of the mission I save the hero and then restore it and it DID restore him, so it must be becouse of transition between two maps
 
EDIT: Ok, so I did a test, where at the end of the mission I save the hero and then restore it and it DID restore him, so it must be becouse of transition between two maps

When you restore the hero, is it in the same map? If not, it might be possible that the object data is not exactly the same with the starting map, in the sense that you have essential data that does not exist.
 
Level 7
Joined
Feb 10, 2011
Messages
133
Yeah, I stored it in the one map and then set a trigger to restore him a few seconds later just to see whether he gets stored or not and he did
I also copied the hero from one map to the other to ensure the units were the same, still not working

EDIT: The campaign has so far 4 mission, the GC between 1 and 2 doesnt work, between 2 and 3, 3 and 4 works normally and the game cache triggers are EXACTLY the same, wtf is happening?
 
Last edited:
I studied your campaign and here are my results: Your object data is not correctly matched with the rest.
That is what caused the failure of the restoration of the hero.

Suggested Fix: Import all object data from the most-complete map object data wise to your campaign object data.
 

Attachments

  • Delara's Expedition to Kalimdor.w3n
    5.1 MB · Views: 59
That explains the disparity between the data. Try to check the rawcode of Manorok in chapters two and three, and so on and so forth, and see if they match. If they do, then make sure that the second map has the same rawcode.

With that being said, you can just copy and paste the hero until you get the desired rawcode. :)


Extra:
Want me to review your map?
 
Level 7
Joined
Feb 10, 2011
Messages
133
OMG! It works! HOLY CRAP! Thank you so much for your efford! I would have never made it without your help!

This, what I uploaded here, isn't the final version, the campaign is still in development and I'll be updating it over time here and I'll gladly accept any review and feedback :)
 
Status
Not open for further replies.
Top