ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   Changing zone or entering house. (https://www.esoui.com/forums/showthread.php?t=9993)

Phinix 11/20/21 05:10 PM

Changing zone or entering house.
 
Hey all,

I have tried several methods of detecting going from a zone containing a player house into that player house, but none of them seem to work.

I have tried EVENT_ZONE_CHANGED, EVENT_CURRENT_SUBZONE_LIST_CHANGED, EVENT_PLAYER_ACTIVATED, and some others but none of these seem to fire when going through a simple "fade to black" door and not an actual wayshrine zone change.

Looking for a reliable, low-impact way to detect this, if anyone knows a way!

Calamath 11/20/21 07:13 PM

Player houses are in different zones, so EVENT_PLAYER_ACTIVATED should be fired.
GetCurrentZoneHouseId() returns a non-zero value only in the player house,
so you can determine whether your character is located in the player house or not.

Edited: ;-p

Baertram 11/21/21 09:55 AM

Non-player houses are not detectable afaik.
There is no event firing and the map and zone data stays the same (for most of them).


If there is any unique interaction text at the door which you are able to detect (like "Open door to ...." or similar) you'd be able to use INTERACTION_MANAGER

Lua Code:
  1. SecurePostHook(FISHING_MANAGER, "StartInteraction", OnStartInteraction)
  2.         local action, interactableName, interactionBlocked, isOwned, additionalInteractInfo, context, contextLink, isCriminalInteract = GetGameCameraInteractableActionInfo()
  3.         if additionalInteractInfo == ADDITIONAL_INTERACT_INFO_<choose constant here> and not interactionBlocked and action== "<your action text like 'Open door' here>" then
  4.        end

> I found the additionalInteractInfo == ADDITIONAL_INTERACT_INFO_HOUSE_INSTANCE_DOOR in ZOs code, maybe it's always this for doors?
> action will be the name of the house owner then I guess, and the text at the reticle will use SI_GAME_CAMERA_TARGET + the action text then

to check for the interacation and if it was interacted with (not sure how to detect if this was interacted with though, maybe there fires another event then. You can check this via merTorchbug events or zgoo events e.g.) you#d know you have used a door or similar.

But IF I remember correctly the doors are all named differently :-( Maybe a pattern like "Enter <name>'s house" will appear, but still it would be a hacky way to detect + multi language issue

Phinix 11/21/21 07:25 PM

Thanks guys. Oddly enough, after completely exiting the game and logging back in, my EVENT_PLAYER_ACTIVATED registration is now firing when entering a house or place that requires a fade-to-black loading screen. :)


All times are GMT -6. The time now is 12:34 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI