Maps, Areas and Quests
Today's tutorial addresses some issues with maps: which maps belong to which game.areas, which map has which quests associated with it, that sort of thing.
GAME AREAS
The following little example from dear old Zert will demonstrate what 'game area' refers to.
{120}{Yes, lad?}{Yes, lass?}{}{120}{}{}
{121}{I think you should leave the group.}{}{8}{npc.area != 1 and npc.area != 3}{130}{}
{122}{You leave group!}{}{-7}{npc.area != 1 and npc.area != 3}{130}{}
{123}{I think you should leave the group.}{}{8}{npc.area == 1 or npc.area == 3}{140}{}
{124}{You leave group!}{}{-7}{npc.area == 1 or npc.area == 3}{140}{}
{130}{What? Leave here? No, lad, that won't do. I'll only go my way in a village.}{What? Leave here? No, lass, that won't do. I'll only go my way in a village.}{}{130}{}{}
{131}{[exit]}{}{1}{}{0}{}
{140}{Okay lad, I'll take my leave. Watch your back, though. It's a dangerous world.}{Okay lass, I'll take my leave. Watch your back, though. It's a dangerous world.}{}{140}{}{pc.follower_remove(npc)}
{141}{E:}{}{1}{}{0}{}
Soooooo... Zert can tell whether or not he is in a village based on the game area: 1 or 3 are apparently villages. 1 of course is Hommlet, so naturally 3 is Nulb.
There are in fact some 15 different game areas, corresponding to places on the worldmap. Lets consider the worldmap for a moment: here are the names you will see displayed on the worldmap, as recorded in data / mes / worldmap_location_names_text.mes:
{010} {Emridy Meadows} ; WORLDMAP_MEADOWS_LOC
{020} {Moat house} ; WORLDMAP_MOATHOUSE_LOC
{030} {Moat house cave exit} ; WORLDMAP_MOATHOUSE_CAVE_LOC
{040} {Nulb} ; WORLDMAP_NULB_LOC
{050} {Imeryds Run} ; WORLDMAP_NULB_RIVER_POOL_LOC
{060} {Cave Lair} ; WORLDMAP_CAVELAIR_LOC
{070} {Temple of Elemental Evil} ; WORLDMAP_TEMPLE_LOC
{080} {Burnt Farmhouse} ; WORLDMAP_TEMPLE_WELL_LOC
{085} {Deklo Grove} ; WORLDMAP_DEKLO_GROVE_LOC
{090} {Hommlet - North} ; WORLDMAP_HOMMLET_LOC_NORTH
{100} {Hommlet - South} ; WORLDMAP_HOMMLET_LOC_SOUTH
{110} {Hommlet - East} ; WORLDMAP_HOMMLET_LOC_EAST
{120} {Temple Ruined House} ; WORLDMAP_TEMPLE_HOUSE_LOC
{130} {Temple Broken Tower} ; WORLDMAP_TEMPLE_TOWER_LOC
{140} {Verbobonc} ; WORLDMAP_VERBOBONC_LOC
{150} {Hickory}
{160} {Placeholder}
{170} {Placeholder}
{180} {Placeholder}
{190} {Placeholder}
{200} {Placeholder}
This is how it looks since Co8 had a hack at it and added Verbobonc, Hickory Branch and a bunch of placeholders for future expansion (clever Spellslinger). These are the little name boxes that appear when you hover over a spot on the worldmap, and which appear in the list on the right. But what about the numbers of the game areas themselves? They look something like this:
1 _____ Hommlet
2 _____ Moathouse
3 _____ Nulb
4 _____ The Temple
5 _____ Emridy Meadows
6 _____ Imeryds Run
7 _____ Temple Well
8 _____ Moathouse Back Door
9 _____ Ogre Cave
10 ____ Deklo Grove
11 ____ Temple Tower
12 ____ Temple House
Thats only 12: I thought we would get up to 14 on the Worldmap when we remember that Hommlet has 3 Worldmap locations, but 14 is Verbobonc. Whats 13? It took me forever to figure out that in the list above (that has the 2 Hommlet maps) the Deklo Grove comes in at 85, so there is in fact 16 names there: the 12 areas, Verbobonc and Hickory, and the 2 extra Hommlet worldmap spots. Heh. The fact Deklo Grove seems to have been sorta jemmyed in there may explain why there is no 13 - I can't think what else there is.
So how do we use this connection? Well, if we want to have a new area on the worldmap open up to the players, we activate the pertinent game area. For instance, lets have a look at Spugnoir, who will mark both Emridy Meadows and the Moathouse on your map. (Note this starts mid-conversation with the PC asking about locations)
{33}{Where is this moathouse?}{}{8}{game.areas[2] == 0}{70}{game.areas[2] = 1}
{34}{Me want to go to this moaty place.}{}{-7}{game.areas[2] == 0}{70}{game.areas[2] = 1}
{37}{Do you know where Emridy Meadows are?}{}{8}{game.areas[5] == 0}{130}{}
{38}{Where be Emridy Meadows?}{}{-7}{game.areas[5] == 0}{130}{}
{70}{Here, I will show you where the moathouse is located on your map.}{Here, I will show you where the moathouse is located on your map.}{}{70}{}{}
{75}{Thank you. I will head there now. [travel immediately to the moat house]}{}{8}{}{0}{game.worldmap_travel_by_dialog(2)}
{130}{Here, I will show you where Emridy Meadows is located on your map.}{Here, I will show you where Emridy Meadows is located on your map.}{}{130}{}{game.areas[5] = 1}
{135}{Thank you. I will head there now. [travel immediately to Emridy Meadows]}{}{8}{}{0}{game.worldmap_travel_by_dialog(5)}
Notice a couple of things there, compared to Zert's:
- the command game.worldmap_travel_by_dialog(#) where # corresponds to the game area
- that you check for whether a PC does or doesn't know the area (ie already have it available on their map) using the comparatives game.areas[#] == 0 and game.areas[#] == 1
- that you set the game area as known (ie mark it on the map) with game.areas[#] = 1
- that you check whether you are in this or that game area with npc.area == # or attachee.area == # (as we saw Zert do above). I can tell you from tragic experience, game.area == 1 does NOT work!
Another thing to mention, though you will have to take my word on this, is that if you make your way to an area some other way, it will still automatically mark on your map. For instance, the 3 'satellite' maps to the Temple - the broken tower, the ruined house and the well (which is your back door when coming out from the area where Smigmal is) can all be accessed map-to-map by just going through doors / ladders, but will then show up on your worldmap. Note also that as with the 3 locations in Hommlet, there are no 'red dot' paths between these areas, or random encounters: so if you are making a new module with a new worldmap, you place these next to each other.
So, lets say you use game.worldmap_travel_by_dialog(5) to get to Emridy Meadows - where do you turn up? Which is to say, why turn up at that exact spot? In the past we have seen teleport commands such as game.fade_and_teleport(0,0,0,5008,465,481) which will teleport you to the top of the Welcome Wench, to the exact coordinates scripted. But where does game.worldmap_travel_by_dialog(5) (or clicking on the worldmap in general) get its coordinates from?
The answer to that is found way away from the various map names, in the modules/rules folder. Inside you will find the maplist.mes file. It contains all the map names, plus their starting coordinates and whether they are to be regarded as outdoors or not, or whether they are to be fogged. I'll give you a few examples: go look at this file for yourself, its a very important one.
{5066}{Map12-temple-dungeon-level-1, 548, 589, Flag: DAYNIGHT_XFER}
{5067}{Map13-dungeon-level-02, 488, 569, Flag: DAYNIGHT_XFER}
{5068}{Map-Area-6-Imeryds-Run, 478, 483, Flag: DAYNIGHT_XFER, Flag: OUTDOOR}
{5069}{Map-Area-10-Decklo-Grove, 485, 487, Flag: DAYNIGHT_XFER, Flag: OUTDOOR}
{5070}{Random-Scrub, 480, 480, Flag: OUTDOOR}
{5071}{Random-Forest, 480, 480, Flag: OUTDOOR, Flag: UNFOGGED}
{5072}{Random-Swamp, 480, 480, Flag: OUTDOOR, Flag: UNFOGGED}
{5073}{Random-Riverside, 490, 475, Flag: OUTDOOR, Flag: UNFOGGED}
Note how the maps are named. Those are not idle descriptions, like those for the worldmap names we saw above that turn up on your worldmap (which could be just as easily changed), or the map names in map_names.mes that are at the side of your worldmap and could likewise be changed quite easily and have no impact on the game. The map names in the maplist.mes are the names of the folders that the game looks for when it goes to that map. So when you execute the aforementioned
game.fade_and_teleport(0,0,0,5008,465,481)
it is to this file that the game looks, to line 5008, to see which folder to look at in the modules / Co8 5 / maps folder. Then, inside that are the mobs, the sectoring, and the map.php which in turn points to the background map number etc. About the only thing that doesn't come from this folder is the townmaps - they are arranged by map number (5001ff) no matter what the map is called or what folder is used for it.
To answer the previous question, this is also where the game gets coordinates from if you just do a game.worldmap_travel_by_dialog(#) command to this or that area, or if you add a new area to the Worldmap like Verbobonc or HB: those co-ordinates in the maplist.mes map reference are where the game looks (and can be changed accordingly). Otherwise, if you go via a script or a door, then you get the coordinates from jumppoint.tab or written into the script or whatever (and they over-ride these ones, of course).
We've probably been through all that before. What is worth mentioning in this context is that some maps CALL themselves Area 9 or Area 12 or whatever - well, those ARE just names, an area doesn't become 'Area 6' because you name the folder that, its controlled in the .dll which has already assigned specific areas to the maps. So our next question is, which maps correspond to which areas? Which is to say, if you add a new map (such as Frank's house) will it still be in area 1?
After much slavish effort, here are all the maps in ToEE and their areas.
{5000}{}
Area 1 {5001}{Hommlet}
Area 2 {5002}{The Ruins of the Moathouse}
Area 2 {5003}{The Moathouse Tower}
Area 2 {5004}{Upper Level of the Moathouse Ruins}
Area 2 {5005}{Dungeon Level of the Moathouse Ruins}
Area 1 {5006}{Inn - Cellar}
Area 1 {5007}{Inn - First Floor}
Area 1 {5008}{Inn - Upper Floor}
Area 1 {5009}{Trader's Barn}
Area 1 {5010}{Trader's Store}
Area 1 {5011}{Church of St. Cuthbert - Upper Floor}
Area 1 {5012}{Church of St. Cuthbert - Main Floor}
Area 1 {5013}{Church of St. Cuthbert - Lower Floor}
Area 1 {5014}{Guard Tower - Cellar}
Area 1 {5015}{Guard Tower - Lower Level}
Area 1 {5016}{Guard Tower - Main Hall}
Area 1 {5017}{Guard Tower - Parapet Level}
Area 1 {5018}{Guard Tower - Upper Hall}
Area 1 {5019}{Guard Tower - Parapet Interior}
Area 1 {5020}{Prosperous Farm Cottage}
Area 1 {5021}{Prosperous Farm Cottage - Upstairs}
Area 1 {5022}{Woodcutter's Cottage}
Area 1 {5023}{Well-Kept Farm}
Area 1 {5024}{Well-Kept Farm - Upstairs}
Area 1 {5025}{Prosperous Farmhouse}
Area 1 {5026}{Leatherworker's House}
Area 1 {5027}{Blacksmith's Shed}
Area 1 {5028}{Weaver's House}
Area 1 {5029}{Weaver's House - Upstairs}
Area 1 {5030}{Tailor's Cottage}
Area 1 {5031}{Average Farm Building}
Area 1 {5032}{Weatherbeaten Building}
Area 1 {5033}{Moneychanger's Establishment}
Area 1 {5034}{Small House}
Area 1 {5035}{Small House - Upstairs}
Area 1 {5036}{Potter's Cottage}
Area 1 {5037}{Brewhouse}
Area 1 {5038}{Modest Cottage}
Area 1 {5039}{Cheesemaker's Cottage}
Area 1 {5040}{Mill}
Area 1 {5041}{Reclusive Cottage}
Area 1 {5042}{The Grove}
Area 1 {5043}{Herdsman's Barn}
Area 1 {5044}{Wheel and Wainwright's Shop}
Area 1 {5045}{Walled Manor House}
Area 1 {5046}{Walled Manor House - Upstairs}
Area 1 {5047}{Carpenter's House}
Area 1 {5048}{Town Hall}
Area 1 {5049}{Stone House}
Area 0 {5050}{MileStone 10 Map}
Area 3 {5051}{Nulb}
Area 3 {5052}{Boatmans' Tavern and Nulb Market}
Area 3 {5053}{Mother Screng's Herb Shop}
Area 3 {5054}{Mother Screng's Herb Shop - Second Floor}
Area 3 {5055}{Mother Screng's Herb Shop - Third Floor}
Area 3 {5056}{Smithy}
Area 3 {5057}{Snake Pit - Main Floor}
Area 3 {5058}{Snake Pit - Second Floor}
Area 3 {5059}{Snake Pit - Top Floor}
Area 3 {5060}{The Waterside Hostel}
Area 3 {5061}{The Waterside Hostel - Upper Floor}
Area 4 {5062}{The Temple of Elemental Evil}
Area 1 {5063}{Modest Farmhouse}
Area 4 {5064}{The Temple of Elemental Evil - Main Floor}
Area 4 {5065}{Tower Ruins}
Area 4 {5066}{Temple - Dungeon Level One}
Area 4 {5067}{Temple - Dungeon Level Two}
Area 6 {5068}{Imeryds Run}
Area 10 {5069}{Deklo Grove}
Area 0 {5070}{} // Random
Area 0 {5071}{} // Random
Area 0 {5072}{} // Random
Area 0 {5073}{} // Random
Area 0 {5074}{} // Random
Area 0 {5075}{} // Random
Area 0 {5076}{} // Random
Area 0 {5077}{} // Random
Area 4 {5078}{Slaughtered Caravan}
Area 4 {5079}{Temple - Locked Level}
Area 4 {5080}{Temple - Dungeon Level Four}
Area 4 {5081}{Air Node}
Area 4 {5082}{Earth Node}
Area 4 {5083}{Fire Node}
Area 4 {5084}{Water Node}
Area 3 {5085}{Nulb Building}
Area 3 {5086}{Nulb Building - Second Floor}
Area 3 {5087}{Nulb Building - Third Floor}
Area 3 {5088}{Nulb Building - Fourth Floor}
Area 0 {5089}{} // Moathouse Demo
CTD {5090}{} // Menagerie Demo
Area 8 {5091}{Moathouse Hidden Exit}
Area 7 {5092}{Temple - Escape Tunnel}
Area 7 {5093}{Ramshackle Farm}
Area 5 {5094}{Emridy Meadows}
Area 9 {5095}{Ogre Cave}
Area 1 {5096}{} // Opening Vignette
Area 1 {5097}{} // Opening Vignette
Area 1 {5098}{} // Opening Vignette
Area 1 {5099}{} // Opening Vignette
Area 1 {5100}{} // Opening Vignette
Area 1 {5101}{} // Opening Vignette
Area 1 {5102}{} // Opening Vignette
Area 1 {5103}{} // Opening Vignette
Area 1 {5104}{} // Opening Vignette
Area 0 {5105}{} // Temple Screenshot
Area 4 {5106}{Circular Shaft}
Area 0 {5107}{} // Temple Demo
Area 0 {5108}{} // Temple Demo
Area 0 {5109}{} // Air Node
Area 0 {5110}{} // Demo Hommlet
Area 0 {5111}{} // clipping test
Area 11 {5112}{Temple House}
Area 12 {5113}{Temple Tower}
Area 9 {5114}{Ogre Cave Interior}
Area 1 {5115}{Herdsman House}
Area 0 {5116}{} // Tutorial map 1
Area 0 {5117}{} // Tutorial map 2
Area 0 {5118}{} // Tutorial map 3
Area 0 {5119}{} // Arena of Heroes
Area 0 {5120}{Frank's House}
Area 14 {5121}{Verbobonc}
Area 0 {5122}{Lord Viscount's Office}
Area 0 {5123}{Caravan}
Area 0 {5124}{Inn - First Floor}
Area 0 {5125}{Inn - Second Floor}
Area 0 {5126}{Gnome Living Quarters}
Area 0 {5127}{Temple Antechamber}
Area 0 {5128}{Temple}
Area 0 {5129}{Drow Tunnel}
Area 0 {5130}{Dragon Cave}
Area 0 {5131}{Dragon Cave Exit}
Area 0 {5132}{Lord Viscount's House - First Floor}
Area 0 {5133}{Lord Viscount's House - Second Floor}
Area 0 {5134}{Chapel}
Area 0 {5135}{Church of Hextor}
Area 0 {5136}{Bazaar of the Bizarre}
Area 0 {5137}{Gnarley Forest}
Area 15 {5138}{Hickory Branch}
Area 0 {5139}{Hickory Branch Crypt}
Area 0 {5140}{Temple - Dungeon Level Three}
It won't come as a shock to anyone that the new bits we have added - Frank's House, the Caravan, Verbobonc, Huckleberry Branch etc - all come in as Area 0: the game wasn't designed to finesse those places so just gives them a zero. But look at the Verbobonc and HB main maps - they are areas 14 and 15! That comes from Spellslinger's efforts to hack them into the .dll so they could be accessed from the World Map.
Next are the quests.
QUESTS BY AREA
You will have noticed there are different tabs in your logbook's quest page for different areas: for Hommlet, Nulb and the Temple. As you get quests, they show up in relevant parts of the logbook accordingly: quests received in Hommlet turn up under the Hommlet tab, quests received in Nulb... well, you get the picture. Those names are from logbook_ui_quests_text.mes, which looks like this:
--- logbook_ui_main_tab_window text---
{11} {Hommlet & Verbobonc}
{12} {Nulb}
{13} {Temple}
--- text above acquired window ---
{15} {Quest Location}
--- text above detail window ---
{20} {Quest Information}
--- label text in detail window ---
{30} {Status:}
--- text used in the acquired text buttons
{31} {Month: }
{32} {Day: }
--- Text of quest states ---
{40} {Mentioned}
{50} {Accepted}
{60} {Completed}
{70} {Botched}
--- No Quest text ---
{100}{No Quests Available}
The canny will already have figured out that area 0 quests default to Hommlet, which is why all the Verbo-mod ones turn up there, and Allyx then added '& Verbobonc' after attempts to get a 4th tab going didn't work.
In KotB, the logbook tabs look like this:
--- logbook_ui_main_tab_window text---
{11} {Keep}
{12} {Caves}
{13} {Wilderness}
The Caves of Chaos ravine will be based on the Nulb worldmap location (game area 3), and the Caves themselves will be the various houses and places of Nulb. Everything else is the wilderness, where-in you actually get very few quests atm: just the bonus quest, actually :-).
Of course, all this means we can change all the other stuff in the logbook if we wanted. We could change 'botched' to 'screwed up', or 'completed' to 'you go girl!' But I should like to think we won't.
Now, precisely which 'quest locations' tabs are associated with which map areas? Here they are:
0 _____ Hommlet
1 _____ Hommlet
2 _____ Hommlet
3 _____ Nulb
4 _____ The Temple
5 _____ Hommlet
6 _____ Hommlet
7 _____ Hommlet
8 _____ Hommlet
9 _____ Hommlet
10 ____ Hommlet
11 ____ Hommlet
12 ____ Hommlet
14 ____ Hommlet
15 ____ Hommlet
Which is a fancy way of saying that everything that isn't set to Area 3 (Nulb quests) or Area 4 (Temple quests) are set for the Hommlet tab: they default there, same as area 0. Note that the other areas around the Temple on the World Map - the Well, Burnt Farmhouse and Tower - will NOT show their quests as being for the Temple (not that they have any quests - indeed, only the Tower has any mobs, they are tragically empty maps) because they have seperate game areas to put them on the World Map: interesting side effect, as it were.
Also note that it has nothing to do with the quest number: if you consoled the Temple Hight Priests into the middle of Hommlet and got all the Temple quests off them there, they would appear as Hommlet quests. Likewise if you had a quest from a recruitable NPC (and we probably should have a few of those) then any quest they gave you would appear in the logbook depending on where you happened to be when they gave it to you. Hope that makes sense - I think I've laboured the point enough that it should ;-) But just to prove it, here are some screenies where I ended up with the Nulb and Temple quests in the first tab because I consoled them on other maps:
And thats that! Any questions, comment below, but I think that covers everything.