From 3f790191dfe62e31ef3dda54a6583e2a43c7a633 Mon Sep 17 00:00:00 2001 From: NathanMArgenti Date: Sat, 13 May 2023 16:44:59 +1000 Subject: [PATCH 1/4] added astaria to script added astaria to script - todo: convert room id to allow for hash --- mudlet-mapper.xml | 167 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 3 deletions(-) diff --git a/mudlet-mapper.xml b/mudlet-mapper.xml index e0c35af..822f3dc 100644 --- a/mudlet-mapper.xml +++ b/mudlet-mapper.xml @@ -4243,6 +4243,44 @@ end + + Astaria + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + + + Login + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + Don't forget to check the message board in StarKeep's + + + 0 + + + @@ -4411,7 +4449,7 @@ mmp.settings:setOption(matches[3], val) ^area list$ - + mm Mapping @@ -10632,7 +10670,7 @@ end - + Game-specific - @@ -11821,6 +11859,129 @@ end + + + + + gmcp.Room.WrongDir + + + + + mmp logged in + + + + + mmp logged in + + + Test / one-time things From 66657f82e5598eabb5d9abfd43e0a612c5280a18 Mon Sep 17 00:00:00 2001 From: NathanMArgenti Date: Wed, 17 May 2023 08:30:27 +1000 Subject: [PATCH 2/4] vadi updating hash --- mudlet-mapper.xml | 355 +++++++++++++++++++++++++--------------------- 1 file changed, 194 insertions(+), 161 deletions(-) diff --git a/mudlet-mapper.xml b/mudlet-mapper.xml index 822f3dc..78a56aa 100644 --- a/mudlet-mapper.xml +++ b/mudlet-mapper.xml @@ -2004,6 +2004,43 @@ raiseEvent("mmapper updated pdb") + + Astaria + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + + + Login + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + The Kingdom of Astaria + + + 3 + + + Asteria @@ -4243,44 +4280,6 @@ end - - Astaria - - 0 - 0 - 0 - - - #ff0000 - #ffff00 - - #000000 - #000000 - - - - Login - - 0 - 0 - 0 - - - #ff0000 - #ffff00 - - #000000 - #000000 - - Don't forget to check the message board in StarKeep's - - - 0 - - - @@ -4617,6 +4616,7 @@ local function set(newid) setRoomEnv(rid, getRoomEnv(mmp.currentroom)) end mmp.setExit(mmp.currentroom, rid, m) + clearRoomUserDataItem(newid, "hashonly") mmp.echo(string.format("Created new room (%d) at %dx, %dy, %dz.\n", rid, x, y, z)) centerview(mmp.roomexists(mmp.currentroom) and mmp.currentroom or rid) if not mmp.roomexists(mmp.currentroom) then @@ -6571,9 +6571,15 @@ local oldnum function mmp.speedwalking(event, num) local num = tonumber(num) or tonumber(gmcp.Room.Info.num) + + if num == nil and gmcp.Room.Info.roomhash then + num = mmp.roomidFromHash(gmcp.Room.Info.roomhash) + end + if num ~= mmp.currentroom then mmp.previousroom = mmp.currentroom end + mmp.currentroom = num mmp.currentroomname = getRoomName(num) -- Try to track if we're flying or not, for Imperian wings @@ -9508,7 +9514,16 @@ end function mmp.roomexists(num) if not num then return false end - if roomExists then return roomExists(num) end + if roomExists then + -- in case we are in a hash-based game and the room ID got created to store a hash + -- and hasn't been created properly, say it doesn't exist + if getRoomUserData(num, "hashonly") == "true" then + mmp.echo("roomexists: returning false for "..num) + return false + else + return roomExists(num) + end + end local s,m = pcall(getRoomArea, tonumber(num)) return (s and true or false) @@ -9678,7 +9693,7 @@ end -- generate a report mmp.echo( string.format( - "Room: %s #: %d area: %s (%d)", name, num, tostring(mmp.areatabler[areanum]), areanum + "Room: %s #: %d%s area: %s (%d)", name, num, (getRoomHashByID(num) and (" hash: ".. getRoomHashByID(num)) or ''), tostring(mmp.areatabler[areanum]), areanum ) ) mmp.echo( @@ -9703,7 +9718,7 @@ end for exit, leadsto in pairs(exits) do echo( string.format( - " %s -> %s (%d)%s%s\n", + " %s -> %s (%d)%s%s%s\n", exit, getRoomName(leadsto), leadsto, @@ -9720,7 +9735,8 @@ end " (weight: " .. exitweights[mmp.anytoshort(exit)] .. ")" - ) + ), + (getRoomHashByID(num) and (" hash: ".. getRoomHashByID(leadsto)) or '') ) ) end @@ -10262,7 +10278,14 @@ end gmcp.Room @@ -10285,10 +10308,14 @@ end - + Game-specific - @@ -11864,118 +11922,93 @@ end - - - gmcp.Room.WrongDir - - - - mmp logged in - - - mmp logged in @@ -12739,4 +12772,4 @@ end - + \ No newline at end of file From 91bfa74db3bf9cbae9e8e7738b695048daf62fbd Mon Sep 17 00:00:00 2001 From: Araska Pseumonium Date: Fri, 21 Jun 2024 01:06:31 +1000 Subject: [PATCH 3/4] Added support for Astaria's game env and colorisation --- mudlet-mapper.xml | 201 +++++++++++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 81 deletions(-) diff --git a/mudlet-mapper.xml b/mudlet-mapper.xml index 844d4be..7aabe1a 100644 --- a/mudlet-mapper.xml +++ b/mudlet-mapper.xml @@ -2023,6 +2023,7 @@ raiseEvent("mmapper updated pdb") Login 0 0 0 @@ -2103,6 +2104,43 @@ end + + Astaria + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + + + Login + + 0 + 0 + 0 + + + #ff0000 + #ffff00 + + #000000 + #000000 + + The Kingdom of Astaria + + + 3 + + + Asteria @@ -7094,7 +7132,7 @@ function mmp.gotoFeature(partialFeatureName, dashtype) return end raiseEvent("mmp clear externals") - mmp.gotoRoom(closestFeature, dashtype, "room") + mmp.gotoRoom(closestFeature, dashtype, "area") end RoomNum @@ -10379,6 +10417,7 @@ end if gmcp.Room.Info.num then centerview(gmcp.Room.Info.num) elseif gmcp.Room.Info.roomhash then + print(tostring(mmp.roomidFromHash(gmcp.Room.Info.roomhash))) centerview(mmp.roomidFromHash(gmcp.Room.Info.roomhash)) end end @@ -10479,13 +10518,28 @@ local function getshiftedcoords(original, ox, oy, oz) y = (y or oy) z = (z or oz) + 1 else + -- Astaria has a lot of non-standard exits that the mapper doesn't like in hash based games + -- so I have sent them into the sky, they can be manually moved by the person mapping. + if game ~= "Astaria" then mmp.echo( "Don't know where to shift the coordinates for a " .. tostring(w) .. " (" .. tostring(original) .. + ") exit. Setting to z+40" + ) + x = (x or ox) + y = (y or oy) + z = (z or oz) + 40 + else + mmp.echo( + "Don't know where to shift the coordinates for a " .. + tostring(w) .. + " (" .. + tostring(original) .. ") exit." ) + end end return x, y, z end @@ -12148,85 +12202,70 @@ end if game ~= "Astaria" then return end mmp.envids = { - ["field"] = 3, - -- old ones below - ["a sheltered dell"] = 68, - ["Arcane Temple"] = 66, - ["Blackened Lands"] = 58, - ["Blackstone Dungeon"] = 65, - ["Blackstone Keep"] = 62, - ["Constructed underground"] = 2, - ["Dark Forest"] = 1, - ["Deep Ocean"] = 24, - ["Desert Ruins"] = 38, - ["Dwarven city"] = 18, - ["Forestal Council"] = 44, - ["Frozen Bog"] = 76, - ["Lake of Fire"] = 56, - ["Natural underground"] = 3, - ["Noble Bar"] = 53, - ["Noble Chambers"] = 51, - ["Rocky Shore"] = 77, - ["Sylayan city"] = 19, - ["Tainted Underground"] = 35, - ["Tainted Water"] = 39, - ["Underground Lake"] = 36, - ["Vast Ocean"] = 26, - ["Wetlands Village"] = 64, - ["within a tent"] = 69, - Academia = 42, - Acropolis = 33, - Beach = 5, - Blighted = 74, - bog = 73, - Catacombs = 63, - Church = 54, - Cliffs = 67, - Crags = 32, - Desert = 6, - Docks = 30, - Farmland = 41, - Forest = 4, - Freshwater = 22, - Garden = 21, - garrison = 71, - Grasslands = 7, - Graveyard = 46, - Hills = 9, - Jungle = 17, - Mountains = 14, - Nobility = 50, - Ocean = 20, - Path = 11, - Polar = 27, - Pond = 49, - pyramid = 72, - quarry = 70, - River = 10, - Road = 12, - Ruins = 37, - Scrublands = 78, - Sewer = 23, - Swamp = 15, - Temple = 57, - Tower = 79, - transportation = 48, - Tundra = 16, - Underworld = 28, - Urban = 8, - Valley = 13, - Villa = 75, - Village = 47, - Volcano = 59, - Warrens = 31, - } - + indoors = 272, + road = 259, + shallow = 262, + lake = 268, + river = 268, + deepriver = 260, + sea = 260, + waterline = 268, + swells = 268, + shallows = 268, + surf = 268, + undertoe = 268, + waves = 268, + seaswell = 268, + breakers = 268, + deepswells = 268, + reef = 268, + channel = 268, + shelf = 268, + opensea = 268, + bridge = 259, + sewer = 272, + desert = 267, + field = 258, + rocky = 259, + highlands = 259, + plain = 259, + shore = 262, + valley = 258, + forest = 258, + hills = 259, + moor = 258, + cave = 259, + badlands = 259, + deepforest = 258, + beach = 267, + jungle = 258, + swamp = 258, + mountain = 259, + peak = 259, + volcano = 257, + ud_street = 263, + ud_path = 272, + ud_rough = 272, + ud_indoors = 272, + ud_tough = 272, + dunes = 267, + sands = 267, + } mmp.waterenvs = {} - local waterids = { "River", "Ocean", "Deep Ocean", "Vast Ocean", "Underground Lake", "Tainted Water", "Lake of Fire" } - for i = 1, #waterids do mmp.waterenvs[mmp.envids[waterids[i]]] = true end + mmp.envidsr = {} + for name, id in pairs(mmp.envids) do + mmp.envidsr[id] = name + end + +mmp.colorcodes = {} +mmp.colorcodes[258] = {176, 224, 230, 255} +mmp.colorcodes[259] = {160, 82, 45, 255} - mmp.envidsr = {}; - for name, id in pairs(mmp.envids) do mmp.envidsr[id] = name end +function mmp.setAstariaColorcodes() + for id, rgba in pairs(mmp.colorcodes) do + setCustomEnvColor(id, rgba[1], rgba[2], rgba[3], rgba[4]) + end + end end mmp logged in @@ -13002,7 +13041,7 @@ end - - - + + + From 40b99dfe5ae0902a29f915297a7ba1a9d4553af5 Mon Sep 17 00:00:00 2001 From: Nathan Murphy Date: Sun, 3 Aug 2025 11:27:57 +1000 Subject: [PATCH 4/4] cylis's changes to the mapper --- mudlet-mapper.xml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mudlet-mapper.xml b/mudlet-mapper.xml index 7aabe1a..7018703 100644 --- a/mudlet-mapper.xml +++ b/mudlet-mapper.xml @@ -10454,7 +10454,7 @@ local function makeroom(oldid, newid, x, y, z) local fgr, fgg, fgb = unpack(color_table.red) local bgr, bgg, bgb = unpack(color_table.blue) highlightRoom(newid, fgr, fgg, fgb, bgr, bgg, bgb, 1, 100, 100) - if mmp.envids[gmcp.Room.Info.environment] then + if mmp.game ~= "astaria" and mmp.envids[gmcp.Room.Info.environment] then setRoomEnv(newid, mmp.envids[gmcp.Room.Info.environment]) else setRoomEnv(newid, getRoomEnv(oldid)) @@ -10768,9 +10768,14 @@ function mmp.mappingNewroom(_, num) gmcp.Room.Info.environment .. "." end - -- check indoors status + + -- check indoors status if mmp.game ~= "asteria" or mmp.game ~= "ashyria" then - local indoors = table.contains(gmcp.Room.Info.details, "indoors") + local indoors + if mmp.game ~= "astaria" then + indoors = table.contains(gmcp.Room.Info.details, "indoors") + else indoors = (gmcp.Room.Info.environment == "indoors") + end if indoors and (getRoomUserData(num, "indoors") == '' or getRoomUserData(num,"outdoors") ~= '') then setRoomUserData(num, "indoors", "y") clearRoomUserDataItem(num, "outdoors") @@ -10782,8 +10787,8 @@ function mmp.mappingNewroom(_, num) end end - -- check server area name (Achaea only for now) - if mmp.game == "achaea" then + -- check server area name (Achaea only for now, and Astaria now too) + if mmp.game == "astaria" or mmp.game == achaea then local serverArea = gmcp.Room.Info.area if serverArea ~= getRoomUserData(num, "Game Area") then setRoomUserData(num, "Game Area", serverArea)