1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice

[Suggestion] Priest of Mondain & Wandering Healder Locations

Discussion in 'UO Enhanced Client Discussion' started by LowdownandShifty, Jun 9, 2014.

  1. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    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
     
  2. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    you can't do that, the server won't send that info unless you are dead.
     
  3. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    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.
     
  4. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    mmm yes, I'll take a look on that, I have few ideas :p
     
    DJAd likes this.
  5. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    something like this?
    [​IMG]
     
    Storm, DJAd and LowdownandShifty like this.
  6. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    Yes!
     
  7. DJAd

    DJAd Stratics Legend
    Stratics Veteran

    Joined:
    Aug 17, 2007
    Messages:
    7,926
    Likes Received:
    3,574
    Yes!!
     
  8. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    I'm glad I'm not the only one that wanted this lol
     
  9. DJAd

    DJAd Stratics Legend
    Stratics Veteran

    Joined:
    Aug 17, 2007
    Messages:
    7,926
    Likes Received:
    3,574
    Definitely. When I'm playing my red char knowing where the red healers are is so handy.
     
  10. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    I did that feature, so in a way or another you will get it :p
     
  11. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    How can we get a copy?
     
  12. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    for now you can't... I'm going to re-work my interface when the new default come out, so just wait for it :p
     
    Storm likes this.
  13. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    Any word when that's supposed to happen? :eyes:
     
  14. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    check uo.com, when the new default arrives I'll be able to go back to work on my UI... :p
     
    Storm likes this.
  15. Great DC

    Great DC Journeyman
    Stratics Veteran

    Joined:
    Jul 13, 2010
    Messages:
    253
    Likes Received:
    168
    Cant you just make friends that will come res you!! This is not what needs to be fixed. Toooooo many whiners.
     
  16. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    :coco:... :drama:
     
  17. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    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 
    
    
     
  18. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    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...
     
  19. LowdownandShifty

    LowdownandShifty Journeyman

    Joined:
    Nov 19, 2013
    Messages:
    177
    Likes Received:
    49
    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.
     
  20. Pinco

    Pinco UOEC Modder
    Stratics Veteran Stratics Legend

    Joined:
    Jul 25, 2005
    Messages:
    5,673
    Likes Received:
    865
    Because the system doesn't like things added manually :p
     
    Storm likes this.