ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Detecting player interactable state (https://www.esoui.com/forums/showthread.php?t=2025)

Aetheron 07/27/14 01:15 PM

Detecting player interactable state
 
Hi All,
I've recently released my first ESO add-on, "Combat Reticle" which detects various game states and changes the reticle. One issue I'm having though is that I can't figure out how to detect when it's possible to interact with another player (i.e. the "Press V to interact" is shown). GetUnitReaction() just tells me I'm targeting a player, and GetGameCameraInteractableInfo() and GetGameCameraInteractableActionInfo() don't seem to do anything with players (only NPCs and objects). GetInteractionType() doesn't seem to give me any result ever... Any ideas on how to detect this? I thought about just tracking the visibility of the interaction text, but that might fail since it could have been hidden by another add-on.

Thanks!
-A

Garkin 07/27/14 02:14 PM

Quote:

Originally Posted by Aetheron (Post 10896)
Hi All,
I've recently released my first ESO add-on, "Combat Reticle" which detects various game states and changes the reticle. One issue I'm having though is that I can't figure out how to detect when it's possible to interact with another player (i.e. the "Press V to interact" is shown). GetUnitReaction() just tells me I'm targeting a player, and GetGameCameraInteractableInfo() and GetGameCameraInteractableActionInfo() don't seem to do anything with players (only NPCs and objects). GetInteractionType() doesn't seem to give me any result ever... Any ideas on how to detect this? I thought about just tracking the visibility of the interaction text, but that might fail since it could have been hidden by another add-on.

Thanks!
-A

You can use for example:
Lua Code:
  1. if PLAYER_TO_PLAYER:IsReticleTargetInteractable() then
  2.    --do stuff
  3. end

Or:
Lua Code:
  1. if DoesUnitExist("reticleoverplayer") and IsUnitOnline("reticleoverplayer") and GetUnitAlliance("player") == GetUnitAlliance("reticleoverplayer") then
  2.    --do stuff
  3. end

Aetheron 07/27/14 04:59 PM

Quote:

Originally Posted by Garkin (Post 10897)
You can use for example:
Lua Code:
  1. if PLAYER_TO_PLAYER:IsReticleTargetInteractable() then
  2.    --do stuff
  3. end

Or:
Lua Code:
  1. if DoesUnitExist("reticleoverplayer") and IsUnitOnline("reticleoverplayer") and GetUnitAlliance("player") == GetUnitAlliance("reticleoverplayer") then
  2.    --do stuff
  3. end

Hmmm, I tried both of these and they do the same thing as the code I've tried - they trigger when the reticle is aimed at a player regardless of how far away the player is. I need some way to know when the interaction menu is available. Btw, how did you know about the PLAYER_TO_PLAYER table? Google doesn't have much to say about that.

Thanks!

Xrystal 07/27/14 05:37 PM

Have you tried the other Camera events ? Some of them sound like they may be useful, even if not exactly what you want.

Garkin 07/27/14 05:51 PM

Quote:

Originally Posted by Aetheron (Post 10896)
I can't figure out how to detect when it's possible to interact with another player (i.e. the "Press V to interact" is shown).

If you really just want to know if player to player prompt is visible:
Lua Code:
  1. PLAYER_TO_PLAYER:IsHidden()

Quote:

Originally Posted by Aetheron (Post 10902)
Hmmm, I tried both of these and they do the same thing as the code I've tried - they trigger when the reticle is aimed at a player regardless of how far away the player is. I need some way to know when the interaction menu is available. Btw, how did you know about the PLAYER_TO_PLAYER table? Google doesn't have much to say about that.

Thanks!

You can find it for example using the Zgoo - data inspection tool.
Or if you have extracted EsoUI files, you can find it in EsoUI\Ingame\PlayerToPlayer\PlayerToPlayer.lua.

Aetheron 07/27/14 06:33 PM

Quote:

Originally Posted by Xrystal (Post 10903)
Have you tried the other Camera events ? Some of them sound like they may be useful, even if not exactly what you want.

Yeah, I think I've tried all the game camera functions. Seems like one of them should have worked...

Aetheron 07/27/14 06:39 PM

Quote:

Originally Posted by Garkin (Post 10905)
If you really just want to know if player to player prompt is visible:
Lua Code:
  1. PLAYER_TO_PLAYER:IsHidden()


You can find it for example using the Zgoo - data inspection tool.
Or if you have extracted EsoUI files, you can find it in EsoUI\Ingame\PlayerToPlayer\PlayerToPlayer.lua.

Thanks, I'll try out zgoo. I don't know how to extract the EsoUI files, but I'll look into. Also, I don't want to know when the player-to-player menu is visible, but when you have the option of opening it. (Just like the prompt you get with other interactable objects/NPCs in the game).


All times are GMT -6. The time now is 02:04 AM.

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