EC: crystal portal vs. corrupted crystal portal confusion

ForeverFunForeverFun Posts: 900
In EC, when you double click on a crystal portal or a corrupted crystal portal, they have identical dialog box content, even though the capabilities of the two portals are different. 

Additionally, the portal "Go" command uses say instead of whisper, which leaks your destination to everybody on screen.

All changes to crystalportal.lua

function CrystalPortal.GO()
	--SendChat( _channel, L"/say " .. finalstring )
SendChat( _channel, L";" .. finalstring ) -- use whisper instead of say

function CrystalPortal.OnShown()

if (GumpData.Gumps[9083] ~= nil and GumpData.Gumps[9083].Labels ~= nil and GumpData.Gumps[9083].Labels[1] ~= nil) then
local dungeon = true -- default all to match old crystal portal settings.
local bank = true
local moongate = true
local stringId = 1113945

if (GumpData.Gumps[9083].Labels[1].tid == 1150074) then -- corrupted crystal portal
stringId = 1150074
bank = false
moongate = false

if(CrystalPortal.LastArea ~= 1) then -- only consider dungeons.
CrystalPortal.LastArea = 0
CrystalPortal.LastSelection = 0
end
elseif (GumpData.Gumps[9083].Labels[1].tid == 1113945) then -- crystal portal
dungeon = false

if(CrystalPortal.LastArea == 1) then
CrystalPortal.LastArea = 0
CrystalPortal.LastSelection = 0
end
end

WindowUtils.SetWindowTitle(CrystalPortal.WindowName, L" ")
WindowUtils.SetWindowTitle(CrystalPortal.WindowName, GetStringFromTid(stringId))
WindowSetShowing(CrystalPortal.WindowName .. "DungeonButton", dungeon )
WindowSetShowing(CrystalPortal.WindowName .. "DungeonLabel", dungeon )
WindowSetShowing(CrystalPortal.WindowName .. "MoongateButton", moongate)
WindowSetShowing(CrystalPortal.WindowName .. "MoongateLabel", moongate)
WindowSetShowing(CrystalPortal.WindowName .. "BankButton", bank)
WindowSetShowing(CrystalPortal.WindowName .. "BankLabel", bank)
end




Comments

  • YoshiYoshi Posts: 3,322
    edited May 2023
    “On your corrupted portal. Why you got dungeon option when there is no other option?

    could I suggest you copy the shrine portal menu? That’s really nice one”
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • ForeverFunForeverFun Posts: 900
    edited May 2023
    Yoshi said:
    “On your corrupted portal. Why you got dungeon option when there is no other option?

    could I suggest you copy the shrine portal menu? That’s really nice one”

    Try saying "britain mint" at a corrupted crystal portal, when there is no crystal portal nearby. 
    Likewise, say "dungeon shame" at a crystal portal, when there is no corrupted crystal portal nearby.

    AFAIK, does nothing...  Hence the bug report.

    (I believe the range is ~2 tiles where you utter the command/use the portal).
  • ForeverFunForeverFun Posts: 900
    Yoshi said:
    “dungeon option when there is no other option?

    Here's a tweak that pre-selects dungeon or a valid option based on the portal type.

    At this time, not planning on doing anything more extensive (see the first line comment below).

    		-- should really introduce separate LastArea and LastSelection variables based on the portal type, so those save to the Interface settings via Interface.SaveNumber
    if (GumpData.Gumps[9083].Labels[1].tid == 1150074) then -- corrupted crystal portal
    stringId = 1150074
    bank = false
    moongate = false

    if(CrystalPortal.LastArea ~= 1) then -- only consider dungeons.
    CrystalPortal.LastArea = 1 -- dungeon checkbox set, only valid selection
    CrystalPortal.LastSelection = 0
    end
    elseif (GumpData.Gumps[9083].Labels[1].tid == 1113945) then -- crystal portal
    dungeon = false

    if(CrystalPortal.LastArea == 1) then
    CrystalPortal.LastArea = 2 -- insure non-dungeon checkbox set
    CrystalPortal.LastSelection = 0
    end
    end


  • ForeverFunForeverFun Posts: 900
    edited May 2023
    Another generic problem that is not likely to be EC or CC specific:

    The UO server distance check for the portal appears to take into account Z distance.  Some public houses have a portal on the edge of floor level of the house, at Z+5 from the ground tile right next to it.  The portal doesn't work (*) at X/Y distance of 1 (or 2).

    Also, ankh of devotion on a pedestal, same Z distance problem there too.

    (*) can double click, gets the UI popup, but the uttered command does nothing.

    Server should ignore the Z distance and only check the X/Y distance.

  • YoshiYoshi Posts: 3,322
    "many many house add ons work on all Z axis, crafting stuff, soulforges etc..."
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • ForeverFunForeverFun Posts: 900
    edited May 2023
    Ideally the Z distance checks for all the various portals should be removed (for both use and command uttering).

    More detail regarding the Z position distance check:

    The Ankh of devotion does a Z distance check on double click/use, and won't show the gump/choice list if the Z distance exceeds a threshold (standing next to the ankh - 1 tile).  I didn't determine the Z distance threshold.

    The "Crystal Portal" does a Z distance check on double click/use, but it's >5 tiles where it will fail to open/show the gump.   However, you can successfully utter commands to the crystal portal at Z+-20 (or more, e.g. on a different house floor, without using the portal).

    The "Corrupted Crystal" portal has more stringent Z distance checking than the "Crystal Portal" --- e.g. you can't utter a command at Z+-20 distance.  (as mentioned before Z+5 doesn't accept commands, even though the UI makes you believe otherwise)

    The "moonstone crystal", does a similiar Z distance check to the Ankh of devotion, on use.  However, once you have the selection gump up, you can go to Z+20 (X/Y distance of 1) and succesfully go to a destination (it will again check X/Y distance at this step, however).

    gumpsparsing.lua / crystalportal.lua has some curious "Toggle" behavior (you can see this if you repeatedly double click a portal), and there's also a help "book" which currently isn't shown.  I'll post changes later that address these, as well as separating the persisted crystal portal vs. corrupted crystal portal settings.
  • YoshiYoshi Posts: 3,322
    edited May 2023
    “The book isn’t needed on EC as you have the menu, the book is instructions for CC as there is no portal menu in CC”
    Posts on this account have been pre filtered from personal comment or opinion in an effort to suppress conservative views in order to protect the reader.
  • ForeverFunForeverFun Posts: 900
    Yoshi said:
    “The book isn’t needed on EC as you have the menu, the book is instructions for CC as there is no portal menu in CC”

    The info in the book is useful, and applicable for EC users too.  I have the display of the book tied to the "Tip of the Day" setting -- enabled if tip of day setting is enabled -- as new users will likely have that enabled.

Sign In or Register to comment.