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

Trigger help!

Status
Not open for further replies.
Level 9
Joined
Mar 31, 2012
Messages
205
Well i been trying to figure out what am I doing wrong and I dont get it, i bet it is something really dumb and easy to figure it out but I cant!

So it is a compaign trigger, everytime i go to his region it takes my hero and everything to the next map but when i tr to go back it just removed the unit and does not load the game/map i was on before? this is the triggers i am using, help please!

Map 1 triggers

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from PiggiesCache.w3v
      • Set PiggiesCache = (Last created game cache)
      • Set LoadingFrom[2] = From Map 2 <gen>
  • Subsequent Starts
    • Events
      • Game - A saved game is loaded
    • Conditions
    • Actions
      • Game Cache - Create a game cache from PiggiesCache.w3v
      • Set PiggiesCache = (Last created game cache)
      • Trigger - Run Load <gen> (ignoring conditions)
  • Load
    • Events
    • Conditions
    • Actions
      • Game Cache - Reload all game cache data from disk
      • Set LeftFromMap = (Load LeftFromMap of Variables from PiggiesCache)
      • Set Map2NewGame = (Load Map2NewGame of Variables from PiggiesCache)
      • Game Cache - Restore Hero of Units from PiggiesCache for Player 1 (Red) at (Center of LoadingFrom[LeftFromMap]) facing 0.00
      • Unit - Set life of (Last restored unit) to (Load HeroLife of Units from PiggiesCache)
      • Unit - Set mana of (Last restored unit) to (Load HeroMana of Units from PiggiesCache)
  • Go to Map 2
    • Events
      • Unit - A unit enters To Map 2 <gen>
    • Conditions
      • (Entering unit) Equal to David
    • Actions
      • Set LeftFromMap = 1
      • Game Cache - Clear all labels of Units in PiggiesCache
      • Game Cache - Store (Entering unit) as Hero of Units in PiggiesCache
      • Game Cache - Store (Life of (Entering unit)) as HeroLife of Units in PiggiesCache
      • Game Cache - Store (Mana of (Entering unit)) as HeroMana of Units in PiggiesCache
      • Game Cache - Store LeftFromMap as LeftFromMap of Variables in PiggiesCache
      • Game Cache - Store Map2NewGame as Map2NewGame of Variables in PiggiesCache
      • Game Cache - Save PiggiesCache
      • Unit - Remove (Entering unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Map2NewGame Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Cargando...
          • Game - Save game as TransPiggies1.w3z and change level to Mission One.w3x (Skip scores)
        • Else - Actions
          • Game - Display to (All players) the text: Iniciando...
          • Game - Save game as TransPiggies1.w3z and load TransPiggies2.w3z (Skip scores)
Map 2 triggers

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from PiggiesCache.w3v
      • Set PiggiesCache = (Last created game cache)
      • Set LoadingFrom[1] = From Map 1 <gen>
      • Set Map2NewGame = False
      • Trigger - Run Load <gen> (ignoring conditions)
  • Load
    • Events
    • Conditions
    • Actions
      • Game Cache - Reload all game cache data from disk
      • Set LeftFromMap = (Load LeftFromMap of Variables from PiggiesCache)
      • Game Cache - Restore Hero of Units from PiggiesCache for Player 1 (Red) at (Center of LoadingFrom[LeftFromMap]) facing 0.00
      • Set David = (Last restored unit)
      • Unit - Set life of David to (Load HeroLife of Units from PiggiesCache)
      • Unit - Set mana of David to (Load HeroMana of Units from PiggiesCache)
  • Subsequent Starts
    • Events
      • Game - A saved game is loaded
    • Conditions
    • Actions
      • Game Cache - Create a game cache from PiggiesCache.w3v
      • Set PiggiesCache = (Last created game cache)
      • Trigger - Run Load <gen> (ignoring conditions)
  • Go to Map 1
    • Events
      • Unit - A unit enters To Map 1 <gen>
    • Conditions
      • (Entering unit) Equal to David
    • Actions
      • Set LeftFromMap = 2
      • Game Cache - Clear all labels of Units in PiggiesCache
      • Game Cache - Store (Entering unit) as Hero of Units in PiggiesCache
      • Game Cache - Store (Life of (Entering unit)) as HeroLife of Units in PiggiesCache
      • Game Cache - Store (Mana of (Entering unit)) as HeroMana of Units in PiggiesCache
      • Game Cache - Store LeftFromMap as LeftFromMap of Variables in PiggiesCache
      • Game Cache - Store Map2NewGame as Map2NewGame of Variables in PiggiesCache
      • Game Cache - Save PiggiesCache
      • Unit - Remove (Entering unit) from the game
      • Game - Save game as TransPiggies2.w3z and load TransPiggies1.w3z (Skip scores)
What am i doin' wrong? it loads the map 2 but then when i try to go back to map 1 it just doesnt?

If it maks it easier for you I will post the campaign file.

One love
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
never use entering unit use triggering unit instead.

also anything used twice or more should be stored into a variable.

u leak locations. Anything with center of / position of / offset / player start location / random point leaks.

see which trigger are running and what variables say what by using game messages so you can better see what's going on.
 
Level 9
Joined
Mar 31, 2012
Messages
205
Well, i already figure it out, the campaign name was too long, nothing wrong with them triggers ahaha yeah kinda dumb i know. One more thing though, does anybody know how to place a marker on the minimap like on the rexxar campaign that displays like a gate to another map? the icon thingy?
 
Status
Not open for further replies.
Top