• 🏆 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] Store/load Exp Cap in Transition Maps

Status
Not open for further replies.
Level 28
Joined
Feb 18, 2014
Messages
3,580
I been trying to find a way to correct this bug caused when saving a hero exp cap and reload it in sub-maps (Using a Transition System). However, the Hero is still getting exp after the map is loaded? Let me explain :

  • Experience Cap Thealen
    • Events
      • Unit - A unit owned by Player 1 (Red) Gain a level
    • Conditions
      • (Leveling Hero) Equal to Hero[1]
      • (Hero level of (Leveling Hero)) Superior or Equal to 8
    • Actions
      • Hero - Disable experience gain for Hero[1]
      • Set ExpDisabledForThealen = TRUE
Note : Hero [1] = Thealen

Now when I save the booleen like this ;

  • Game Cache - Store ExpDisabledForThealen as ExpDisabledForThealen of TransitionKey in (Last created game cache)
Now after the map is loaded the trigger should be like this :
  • Set ExpDisabledForThealen = (Load ExpDisabledForThealen of TransitionKey from (Last created game cache))
But as I said, the Hero is still getting exp after he reach level 8 once the map is loaded...

Can someone help me with this? Thanks!
 
Level 13
Joined
Nov 7, 2014
Messages
571
Are you calling
empty.gif
join.gif
hero.gif
Hero - Disable experience gain for Hero[1]
after loading/restoring the hero from the gamecache?
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
I am using hashtable and this is how the map perform after the Transition :

  • Export All
    • Events
    • Conditions
    • Actions
      • Cache du jeu - Create a game cache from CacheName
      • Cache du jeu - Clear all labels of TransitionKey in (Last created game cache)
      • -------- Export Area Saves (Saved-game filenames) --------
      • For each (Integer A) from 1 to AreaCount, do (Actions)
        • Boucle - Actions
          • Cache du jeu - Store AreaSave[(Integer A)] as (AreaSave + (String((Integer A)))) of TransitionKey in (Last created game cache)
      • -------- Export Transition Data --------
      • Cache du jeu - Store SourceAreaIndex as SourceAreaIndex of TransitionKey in (Last created game cache)
      • Cache du jeu - Store RestorePointIndex as RestorePointIndex of TransitionKey in (Last created game cache)
      • -------- Export Campaign Data and Heroes --------
      • Trigger - Run Export Mission Data <gen> (checking conditions)
      • Trigger - Run Export Hero <gen> (checking conditions)
      • Cache du jeu - Save (Last created game cache)
  • Export Hero
    • Events
    • Conditions
    • Actions
      • Cache du jeu - Store NHeroes as NHeroes of TransitionKey in (Last created game cache)
      • For each (Integer A) from 1 to NHeroes, do (Actions)
        • Boucle - Actions
          • Set TransitionHero = Hero[(Integer A)]
          • Cache du jeu - Store TransitionHero as (Hero + (String((Integer A)))) of TransitionKey in (Last created game cache)
          • Cache du jeu - Store (Vie of TransitionHero) as (HeroLife + (String((Integer A)))) of TransitionKey in (Last created game cache)
          • Cache du jeu - Store (Mana of TransitionHero) as (HeroMana + (String((Integer A)))) of TransitionKey in (Last created game cache)
          • Unit - Remove TransitionHero from the game
  • Import All
    • Events
    • Conditions
    • Actions
      • Cache du jeu - Reload all game cache data from disk
      • Cache du jeu - Create a game cache from CacheName
      • -------- Import Zone Saves --------
      • For each (Integer A) from 1 to AreaCount, do (Actions)
        • Boucle - Actions
          • Set AreaSave[(Integer A)] = (Load (AreaSave + (String((Integer A)))) of TransitionKey from (Last created game cache))
      • -------- Import Transition Data --------
      • Set SourceAreaIndex = (Load SourceAreaIndex of TransitionKey from (Last created game cache))
      • Set RestorePointIndex = (Load RestorePointIndex of TransitionKey from (Last created game cache))
      • Trigger - Run Import Mission Data <gen> (checking conditions)
      • Trigger - Run Import Heroes <gen> (checking conditions)
  • Import Hero
    • Events
    • Conditions
    • Actions
      • Set NHeroes = (Load NHeroes of TransitionKey from (Last created game cache))
      • For each (Integer A) from 1 to NHeroes, do (Actions)
        • Boucle - Actions
          • Cache du jeu - Restore (Hero + (String((Integer A)))) of TransitionKey from (Last created game cache) for Controller at RestorePoint facing Facing
          • Set Hero[(Integer A)] = (Last restored unit)
          • Set TransitionHero = (Last restored unit)
          • Unit - Set life of TransitionHero to (Load (HeroLife + (String((Integer A)))) of TransitionKey from (Last created game cache))
          • Unit - Set mana of TransitionHero to (Load (HeroMana + (String((Integer A)))) of TransitionKey from (Last created game cache))
I hope thats helpful ^^
 
Level 9
Joined
Oct 14, 2013
Messages
238
First of all, that ExpDisabledForThealen boolean which you mentioned in the first comment is not present in these codes. Anyway if you saved the boolean somewhere else, still you are not disabling the cap in the new map after the Hero restoration.

Take a look here:

  • Import Hero
    • Events
    • Conditions
    • Actions
      • -------- --- --------
        • Set TransitionHero = (Last restored unit)
        • Unit - Set life of TransitionHero to (Load (HeroLife + (String((Integer A)))) of TransitionKey from (Last created game cache))
        • Unit - Set mana of TransitionHero to (Load (HeroMana + (String((Integer A)))) of TransitionKey from (Last created game cache))
      • ---- Here, there should be a boolean check and the exp cap should get disabled for the hero if it is true ----
      • ----- The boolean itself needs to be saved in the cache and transfered into this map and be restored -----


You are not disabling the xp cap for the hero. The new map has to know if it has to disable the cap or not based on the boolean you mentioned in your first comment.

I've dealt with these transfers before and I can tell that there is nothing wrong about it except the issue I mentioned.
 
Status
Not open for further replies.
Top