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

Campaign: Map Hopping (Within Maps)

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
How do i get it so when a unit enters a region it loads another one of my campaign maps (like a submap). I have this, i have no idea if its right, was just messing around seeing if i could get it.
Trigger 1
  • To C2
    • Events
      • Unit - A unit enters Cave Exit 2 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Leader of the Light 0019 <gen>
        • Then - Actions
          • Dialog - Change the title of DialogBox to Go to Xaoliq's lair...
          • Dialog - Create a dialog button for DialogBox labelled Yes
          • Set DialogButton[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for DialogBox labelled Not yet
          • Set DialogButton[2] = (Last created dialog Button)
          • Dialog - Show DialogBox for Player 1 (Red)
        • Else - Actions
Trigger 2
  • Dialog C2
    • Events
      • Dialog - A dialog button is clicked for DialogBox
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[1]
        • Then - Actions
          • Dialog - Hide DialogBox for Player 1 (Red)
          • Game Cache - Create a game cache from TheHeartOfTheIsland.w3v
          • Game Cache - Store Leader of the Light 0019 <gen> as Quintin of Hero in Cache[1]
          • Game Cache - Save Cache[1]
          • Game Cache - Store (Player 1 (Red) Current gold) as Gold of Property in Cache[2]
          • Game Cache - Save Cache[2]
          • Game Cache - Store (Player 1 (Red) Current lumber) as Lumber of Property in Cache[3]
          • Game Cache - Save Cache[3]
          • Game - Load sub - cave.w3z (Skip scores)
        • Else - Actions
Then in the loaded map i have this:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Restore Quintin of Hero from Cache for Player 1 (Red) at (Center of Enter Exit <gen>) facing 0.00
      • Player - Set Player 1 (Red) Current gold to (Load Gold of Property from Cache)
      • Player - Set Player 1 (Red) Current lumber to (Load Lumber of Property from Cache)
 
Level 5
Joined
Jun 23, 2004
Messages
126
If you really want to know how this is done professionally, I suggest you use WinMPQ to open up the War3xlocal.mpq in the WCIII folder and take a look at one or more of the Orc Campaign maps (OrcX01 for starters). Here's a snippet of them actually changing levels, although there's many other triggers where they set the variables and such called in this one.

  • Perform Map Transition
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ZoneSaves[TransitionTarget] Not equal to <Empty String>
          • (The ((ZoneFolder + \) + ZoneSaves[TransitionTarget]) saved-game exists) Equal to True
        • Then - Actions
          • -------- We've visited this map before, so load the last saved-game --------
          • Game - Save game as ((ZoneFolder + \) + ZoneSaves[TransitionSource]) and load ((ZoneFolder + \) + ZoneSaves[TransitionTarget]) (Skip scores)
        • Else - Actions
          • -------- We haven't visited this map yet, so load the map from scratch --------
          • Game - Save game as ((ZoneFolder + \) + ZoneSaves[TransitionSource]) and change level to (ZoneMapPath + (ZoneMaps[TransitionTarget] + ZoneMapExt)) (Skip scores)
 
Level 10
Joined
Jan 21, 2007
Messages
576
@Hossomi: Not sure what you mean but...; Basicaly i have a map i want when a unit enters region a dialog box comes up asking if Yes/No you want to leave, if yes then it will load a map (noticabley smaller (ie submap)) that your hero will be in. But i cant get it to switch levels.
I tried Save game and load map but it didnt work (im doing it wrong?).

(If i had a Base map named 1 and a submap named 1b)
Can you right the trigger that would change to that lvl, (meanwhile il open up the mpq, cant right now though got 60 pages of notes to right for school ><)

EDIT: Can seem to get WinMpq running, it cant find a file.
Also, do you know why when at ay custom campaign screen when i click a button to load a map the screen goes black for like 3-4 seconds the returns to the campaign screen?
 
Last edited:
Status
Not open for further replies.
Top