[Trigger] Game Cache Problems

Status
Not open for further replies.
Level 26
Joined
Oct 2, 2011
Messages
2,490
Hi!
In my project, I have attempted to create map transitions, something alike the ones in the rexxar campaign. However, some saved data is sometimes not transferred for some reason, and I can't tell why.

Someone with Cache knowledge that can check it out? :)
In that case, here is the campaign: https://www.hiveworkshop.com/pastebin/f4428e353b8aeb9439ba5be45cd37a4d10343/

I will specify my problems more in detail as soon as I have more detail to write down.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
I guess I have to turn all GOTOXX on and all GOTOXX NO off to enable transitions?

I think it would be a good idea to use a trigger for storing the data in the game cache, so you don't have to copy this in every transistion trigger.
  • Transition Store Data
    • Events
    • Conditions
    • Actions
      • Game Cache - Store (Player 1 (Red) Current gold) as G of Integer in GameCache
      • Game Cache - Store (Player 1 (Red) Current lumber) as L of Integer in GameCache
      • Game Cache - Store CharHealthLevel as CHL of Integer in GameCache
      • Game Cache - Store CharRegeneration as CR of Real in GameCache
      • Game Cache - Store CharDamage as CD of Real in GameCache
      • Game Cache - Store CharDamageX as CDX of Real in GameCache
      • Game Cache - Save GameCache
      • Trigger - Turn off (This trigger)
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
Alright, makes sense. But that does not change the functionality itself?
No, but you should always try to have as few code several times as possible. If you want to change something in the code you always need to change it everywhere, so having it in one trigger reduces duration of editing things and ensures that you do not miss a part when you change something.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
In the main map (WardenC1), trigger INITIATION Load: remove the action clear game cache
Apparently after clearing a game cache you need to create a new one using the create function, before you can store data in it. (clear should be replaiced by destroy imo)
I hope this fixes the transition bugs.
I did only test it with gold and lumber in transitions between C1 and SS, but after removing the clear game cache action the resources were correct.
I have also a few other suggestions, but I think I better post them in the map development thread. :)
 
Status
Not open for further replies.
Top