- Joined
- Mar 21, 2008
- Messages
- 177
How do you switch one map to another, like Blizzard did in the Frozen Throne bonus campaign?
ok and for the Maps\MyMap.w3m do i just type the name of the map?
If you want to switch between maps, you need to use this action:
Save all data with a game cache before doing so and load it at the start of your next map.
- Game - End game, load the map Maps\MyMap.w3m and Skip scores
well i gotta take a look at it later since i think u used WEU or how u say it.
I only use normal World Editor and i get errors while trying to open it thx for help thou, but i got now bunch of more problems: all my sound files on the Chapter 1 are somehow invalid... it shows their length as 00:00:00 and when i try to play "This Sound does not appear to be valid file." w/e.
they were normal .mp3, i just recorder my own voice, was going to use them in Unit Transmission.
And no probs with game cache only thing is that the campaign is not working at all. Can't even start the first map... >_>
Triggers first map
Right, this was a little test to be honest, I don't use game cache a lot
- Init
- Events
- Time - Elapsed game time is 0.10 seconds
- Conditions
- Actions
- Game Cache - Create a game cache from Test.w3v
- Set GameCache = (Last created game cache)
- Game Cache - Reload all game cache data from disk
- Quest - Display to (All players) the Quest Discovered message: |c00ffcc00Quest Dis...
- Quest - Create a Required quest titled The Mountain King with the description The mountain king, ..., using icon path ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
- Set Quest[1] = (Last created quest)
- Quest - Create a quest requirement for Quest[1] with the description Kill the Mountain K...
- Set QuestReq[1] = (Last created quest requirement)
- Wait 2.00 seconds
- Quest - Display to (All players) the Quest Discovered message: |c00ffcc00Quest Dis...
- Quest - Create a Optional quest titled Opposing Forces with the description The mountain king, ..., using icon path ReplaceableTextures\CommandButtons\BTNFootman.blp
- Set Quest[2] = (Last created quest)
- Quest - Create a quest requirement for Quest[2] with the description Kill all opposing f...
- Set QuestReq[2] = (Last created quest requirement)
- Wait 2.00 seconds
- Quest - Display to (All players) the Quest Discovered message: |c00ffcc00Quest Dis...
- Quest - Create a Optional quest titled Hidden Path with the description There is an ancient..., using icon path ReplaceableTextures\CommandButtons\BTNDemonGate.blp
- Set Quest[3] = (Last created quest)
- Quest - Create a quest requirement for Quest[3] with the description Find the hidden pat...
- Set QuestReq[3] = (Last created quest requirement)
- For each (Integer A) from 1 to 3, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- QuestCompleted[(Integer A)] Equal to True
- Then - Actions
- Quest - Mark Quest[(Integer A)] as Completed
- Quest - Mark QuestReq[(Integer A)] as Completed
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Integer A) Equal to 1
- Then - Actions
- Unit - Remove Mountain King 0004 <gen> from the game
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Integer A) Equal to 2
- Then - Actions
- Set UnitGroup = (Units of type Footman)
- Unit Group - Pick every unit in UnitGroup and do (Unit - Remove (Picked unit) from the game)
- Custom script: call DestroyGroup(udg_UnitGroup)
- Else - Actions
- Else - Actions
The first 3 actions are to set up the game cache, I named it "Test.w3v", since the name doesn't really matter, as long as you can remember it.
Then it just sets up the quests, so skip those things
The loop checks if the quests were finished or not (when switching maps, I have saved it as a boolean, so I can keep record of it).
Now, this stores the game cache, as you can see.
- Hidden Path
- Events
- Unit - A unit enters Hidden Path <gen>
- Conditions
- ((Entering unit) is A Hero) Equal to True
- Actions
- Quest - Display to (All players) the Quest Completed message: |c00ffcc00Quest Com...
- Quest - Mark Quest[3] as Completed
- Quest - Mark QuestReq[3] as Completed
- Set QuestCompleted[3] = True
- Game Cache - Store Paladin 0000 <gen> as Hero of Hero in GameCache
- For each (Integer A) from 1 to 3, do (Actions)
- Loop - Actions
- Game Cache - Store QuestCompleted[(Integer A)] as (QC + (String((Integer A)))) of Quest in GameCache
- Game Cache - Save GameCache
- Wait 1.00 seconds
- Game - End game, load the map Hidden Level.w3x and Skip scores
First I have stored the hero with an easy to remember name (label "hero", category "hero").
Then I have stored the booleans with a little loop, which is easier than copying the action multiple times.
After that, I have saved the game cache and loaded the next level (I didn't use any path for the next level, since it is in a campaign).
Important Note:
Reloading the hero doesn't work on this map, because I did not load the hero, at that point I was getting bored.
If you want me to add the actions for it, I will though.
Triggers second map
This is a little bit easier, since it doesn't have any quests...
I have used the exact same name for the game cache here, otherwise it won't work! ("Test.w3v").
- Init
- Events
- Time - Elapsed game time is 0.10 seconds
- Conditions
- Actions
- Game Cache - Create a game cache from Test.w3v
- Set GameCache = (Last created game cache)
- Set TempLoc[1] = (Player 1 (Red) start location)
- Game Cache - Restore Hero of Hero from GameCache for Player 1 (Red) at TempLoc[1] facing 0.00
- Game Cache - Reload all game cache data from disk
- Set Hero = (Last created unit)
- Custom script: call RemoveLocation(udg_TempLoc[1])
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Enter Equal to True
- Then - Actions
- Item - Remove Apocalyptic Tome 0002 <gen>
- Else - Actions
- Set Enter = True
If the hero has already entered once before, the tome will be gone (otherwise it would be a little bit overpowered).
Use "Reload all data" to load booleans/integers/reals/... that have been stored.
This is an easy trigger... it's the same as the other trigger in the first map, but I only need to store 1 boolean here.
- Return
- Events
- Unit - A unit enters Return <gen>
- Conditions
- Actions
- Game Cache - Store Hero as Hero of Hero in GameCache
- Game Cache - Store Enter as Enter of Enter in GameCache
- Game Cache - Save GameCache
- Wait 1.00 seconds
- Game - End game, load the map Level 1.w3x and Skip scores