• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

[Suggestion] Priest of Mondain & Wandering Healder Locations

LowdownandShifty

Journeyman
Stratics Veteran
I want to be able to modify the map so that it distinguishes between Priests of Mondain and Wandering Healders. Currently it displays a blue icon for both. I would like it to show a blue icon if the NPC is a wandering Healer and a red icon if it is a Priest of Mondain.

Any thoughts on how to easily accomplish this? Example:
Map-Mod.jpg
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
I want to be able to modify the map so that it distinguishes between Priests of Mondain and Wandering Healders. Currently it displays a blue icon for both. I would like it to show a blue icon if the NPC is a wandering Healer and a red icon if it is a Priest of Mondain.

Any thoughts on how to easily accomplish this? Example:
View attachment 21917
you can't do that, the server won't send that info unless you are dead.
 

LowdownandShifty

Journeyman
Stratics Veteran
you can't do that, the server won't send that info unless you are dead.
I love you Pinco. :D

I'm not interested in the NPC locations when I'm alive. However, when dead, I'm interested in both their locations and types. Those icons show up when dead, but they do not distinguish between the two types of healers.
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
I love you Pinco. :D

I'm not interested in the NPC locations when I'm alive. However, when dead, I'm interested in both their locations and types. Those icons show up when dead, but they do not distinguish between the two types of healers.
mmm yes, I'll take a look on that, I have few ideas :p
 

Great DC

Lore Master
Stratics Veteran
Stratics Legend
UNLEASHED
Cant you just make friends that will come res you!! This is not what needs to be fixed. Toooooo many whiners.
 

LowdownandShifty

Journeyman
Stratics Veteran
Soo... I've been working on some code for this, and I find the waypoint system for UO to be convoluted. I tackled the problem by trying to add a User-generated waypoint at each location that a priest of mondain appears; whenever the map is updated, these PoM waypoints would be deleted and replaced with the updated versions. Each PoM waypoint is associated with the original system-generated waypointId in a table called MapCommon.PomList

My approach was to add this to the MapCommon.UpdateWaypoints() function
Code:
      if MapCommon.isPOM(waypointId) then
          MapCommon.handleOldPOM(waypointId) 
          local pomData = MapCommon.buildPOMWaypointData(waypointId)
          local pomId = MapCommon.CreateNewPOMWaypoint(pomData)
          MapCommon.addToPOMList(waypointId,pomId)
      end
For some reason, the UI goes completely haywire when I try to run the code. Specifically, the debugwindow says there's errors in BuffDebuffWindow.lua line 602 whenever I try to run it. The function descriptions are below. Any thoughts @Pinco?

Code:
--- Determines whether a given waypoint is a priest of Mondain. 
--- @param waypointId is the waypointId in the UO database. valid values are 1 through WindowData.WaypointList.waypointCount
--- @return true if the waypointId is associated with a Priest of Mondain. false otherwise
function MapCommon.isPOM(waypointId) 
  local wptype, wpflags, wpname = UOGetWaypointInfo(waypointId)  
  return (string.find(tostring(wpname), "priest of Mondain") and (wptype == 6)) and true or false 
end

--- Deletes a PoMwaypoint and removes the associated field from the waypoint-to-POMwaypoint List (MapCommon.POMList)
-- @param wayPointId is the waypointId in the UO database. valid values are 1 through WindowData.WaypointList.waypointCount
-- @return no return
function MapCommon.handleOldPOM(waypointId)
  local pomid = MapCommon.POMList[waypointId] --Get the associated POMwaypointId (if it exists) 
  if pomid ~= nil then -- if the POMwaypointId exists, the two waypoints are associated, and the POM one needs to be deleted
    UODeleteUserWaypoint(pomid) -- delete the waypoint  
    MapCommon.POMList[waypointId] = nil --remove the waypoint's entry from the POMList
  end
end

--- Creates a data table to hold the information for a new POM waypoint
-- @param data is the data table of the system-generated waypoint. It will be parsed to build a new waypoint for the priest of Mondain
-- @return pomdata is a table containing the necessar information to create a UserWaypoint for the priest of Mondain.  pomdata = {"type","flags","name","facet","x","y","z","icon","scale"}
function MapCommon.buildPOMWaypointData(waypointId)

  --begin data fetching
  local pomtype, pomflags, pomname, pomfacet, pomx, pomy, pomz = UOGetWaypointInfo(waypointId)
  local facet = UOGetRadarFacet()
  local area = UOGetRadarArea()
  local data = MapCommon.GetWPDataFromString(pomname, pomtype, pomfacet, facet, area) --needed to get the icon and scale
  local pomicon = data.icon
  local pomiconScale = data.scale
  pomtype = MapCommon.WaypointCustomType --this will be a User waypoint (i.e. type 15)
  pomdata = {}
  pomdata.type = pomtype --number
  pomdata.flags = pomflags --number
  pomdata.name = pomname --wstring
  pomdata.facet = pomfacet --number
  pomdata.x = pomx --number
  pomdata.y = pomy --number
  pomdata.z = pomz --number
  pomdata.icon = pomicon --string
  pomdata.scale = pomiconScale --number
  return pomdata
end

--- Creates a UserWaypoint containing the pom data and then returns the newly created waypointId
-- @param pomData contains the following information: {"type","flags","name","facet","x","y","z","icon","scale"} it is built by MapCommon.buildPOMWaypointData()
-- @return the waypointId for the newly created UserWaypoint representing the priest of Mondain
function MapCommon.CreateNewPOMWaypoint(pomData)
  --/script Debug.Print ( PackBytes ( type(pomData.name), type(L"_ICON_"), type(pomData.icon), type(L"_SCALE_"), type(pomData.scale)))
  --create the waypoint
  UOCreateUserWaypoint( pomData.type, pomData.x, pomData.y, pomData.facet, pomData.name .. L"_ICON_" .. towstring(pomData.icon) .. L"_SCALE_" .. pomData.scale)
  -get the waypointId
  for i = WindowData.WaypointList.waypointCount, 1 do
    if wstring.find(PackBytes(UOGetWaypointInfo(i))[3],  pomData.name) ~= nil then --if the first part of the waypoint matches the POMname it's the one we're looking for 
      return i
    end
  end
end

--- Updates the PomList to include the new pom waypoint. These must be associate for the pom waypoints to work
-- @param waypointId is the systemgenerated waypoint Id for the priest of Mondain
-- @param pomId is the Usercreated waypoint for the priest of Mondain associated with the waypointId
function MapCommon.addToPOMList(waypointId,pomId)
      MapCommon.PomList[waypointId] = pomId
end
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
Soo... I've been working on some code for this, and I find the waypoint system for UO to be convoluted. I tackled the problem by trying to add a User-generated waypoint at each location that a priest of mondain appears; whenever the map is updated, these PoM waypoints would be deleted and replaced with the updated versions. Each PoM waypoint is associated with the original system-generated waypointId in a table called MapCommon.PomList

My approach was to add this to the MapCommon.UpdateWaypoints() function
Code:
      if MapCommon.isPOM(waypointId) then
          MapCommon.handleOldPOM(waypointId)
          local pomData = MapCommon.buildPOMWaypointData(waypointId)
          local pomId = MapCommon.CreateNewPOMWaypoint(pomData)
          MapCommon.addToPOMList(waypointId,pomId)
      end
For some reason, the UI goes completely haywire when I try to run the code. Specifically, the debugwindow says there's errors in BuffDebuffWindow.lua line 602 whenever I try to run it. The function descriptions are below. Any thoughts @Pinco?

Code:
--- Determines whether a given waypoint is a priest of Mondain.
--- @param waypointId is the waypointId in the UO database. valid values are 1 through WindowData.WaypointList.waypointCount
--- @return true if the waypointId is associated with a Priest of Mondain. false otherwise
function MapCommon.isPOM(waypointId)
  local wptype, wpflags, wpname = UOGetWaypointInfo(waypointId) 
  return (string.find(tostring(wpname), "priest of Mondain") and (wptype == 6)) and true or false
end

--- Deletes a PoMwaypoint and removes the associated field from the waypoint-to-POMwaypoint List (MapCommon.POMList)
-- @param wayPointId is the waypointId in the UO database. valid values are 1 through WindowData.WaypointList.waypointCount
-- @return no return
function MapCommon.handleOldPOM(waypointId)
  local pomid = MapCommon.POMList[waypointId] --Get the associated POMwaypointId (if it exists)
  if pomid ~= nil then -- if the POMwaypointId exists, the two waypoints are associated, and the POM one needs to be deleted
    UODeleteUserWaypoint(pomid) -- delete the waypoint 
    MapCommon.POMList[waypointId] = nil --remove the waypoint's entry from the POMList
  end
end

--- Creates a data table to hold the information for a new POM waypoint
-- @param data is the data table of the system-generated waypoint. It will be parsed to build a new waypoint for the priest of Mondain
-- @return pomdata is a table containing the necessar information to create a UserWaypoint for the priest of Mondain.  pomdata = {"type","flags","name","facet","x","y","z","icon","scale"}
function MapCommon.buildPOMWaypointData(waypointId)

  --begin data fetching
  local pomtype, pomflags, pomname, pomfacet, pomx, pomy, pomz = UOGetWaypointInfo(waypointId)
  local facet = UOGetRadarFacet()
  local area = UOGetRadarArea()
  local data = MapCommon.GetWPDataFromString(pomname, pomtype, pomfacet, facet, area) --needed to get the icon and scale
  local pomicon = data.icon
  local pomiconScale = data.scale
  pomtype = MapCommon.WaypointCustomType --this will be a User waypoint (i.e. type 15)
  pomdata = {}
  pomdata.type = pomtype --number
  pomdata.flags = pomflags --number
  pomdata.name = pomname --wstring
  pomdata.facet = pomfacet --number
  pomdata.x = pomx --number
  pomdata.y = pomy --number
  pomdata.z = pomz --number
  pomdata.icon = pomicon --string
  pomdata.scale = pomiconScale --number
  return pomdata
end

--- Creates a UserWaypoint containing the pom data and then returns the newly created waypointId
-- @param pomData contains the following information: {"type","flags","name","facet","x","y","z","icon","scale"} it is built by MapCommon.buildPOMWaypointData()
-- @return the waypointId for the newly created UserWaypoint representing the priest of Mondain
function MapCommon.CreateNewPOMWaypoint(pomData)
  --/script Debug.Print ( PackBytes ( type(pomData.name), type(L"_ICON_"), type(pomData.icon), type(L"_SCALE_"), type(pomData.scale)))
  --create the waypoint
  UOCreateUserWaypoint( pomData.type, pomData.x, pomData.y, pomData.facet, pomData.name .. L"_ICON_" .. towstring(pomData.icon) .. L"_SCALE_" .. pomData.scale)
  -get the waypointId
  for i = WindowData.WaypointList.waypointCount, 1 do
    if wstring.find(PackBytes(UOGetWaypointInfo(i))[3],  pomData.name) ~= nil then --if the first part of the waypoint matches the POMname it's the one we're looking for
      return i
    end
  end
end

--- Updates the PomList to include the new pom waypoint. These must be associate for the pom waypoints to work
-- @param waypointId is the systemgenerated waypoint Id for the priest of Mondain
-- @param pomId is the Usercreated waypoint for the priest of Mondain associated with the waypointId
function MapCommon.addToPOMList(waypointId,pomId)
      MapCommon.PomList[waypointId] = pomId
end
waypoints are really messed up by default, and in this way you just double the healer's waypoints. Also, this: UODeleteUserWaypoint works only for the waypoints created manually...
 

LowdownandShifty

Journeyman
Stratics Veteran
...in this way you just double the healer's waypoints...
Yeah, that was my intent: To create a second waypoint for each priest of Mondain. (It's actually only around 10-20 extra waypoints if the user is zoomed out completely. Otherwise, it's should only create 1-3 waypoints.) I figured the system was going to keep repopulating the system-generated ones with the default settings. So, I would just add a usergenerated one with a different icon over it. But it doesn't seem to be working :/

Do you have any thoughts as to why the whole UI goes crazy when I try to run this? It seems really strange that the whole thing freaks out the way it does.
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
Yeah, that was my intent: To create a second waypoint for each priest of Mondain. (It's actually only around 10-20 extra waypoints if the user is zoomed out completely. Otherwise, it's should only create 1-3 waypoints.) I figured the system was going to keep repopulating the system-generated ones with the default settings. So, I would just add a usergenerated one with a different icon over it. But it doesn't seem to be working :/

Do you have any thoughts as to why the whole UI goes crazy when I try to run this? It seems really strange that the whole thing freaks out the way it does.
Because the system doesn't like things added manually :p
 
Top