Thread Tools Display Modes
07/27/14, 01:15 PM   #1
Aetheron
 
Aetheron's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 32
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
  Reply With Quote
07/27/14, 02:14 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Aetheron View Post
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
  Reply With Quote
07/27/14, 04:59 PM   #3
Aetheron
 
Aetheron's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 32
Originally Posted by Garkin View Post
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!
  Reply With Quote
07/27/14, 05:37 PM   #4
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Have you tried the other Camera events ? Some of them sound like they may be useful, even if not exactly what you want.
  Reply With Quote
07/27/14, 05:51 PM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Aetheron View Post
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()

Originally Posted by Aetheron View Post
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.
  Reply With Quote
07/27/14, 06:33 PM   #6
Aetheron
 
Aetheron's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 32
Originally Posted by Xrystal View Post
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...
  Reply With Quote
07/27/14, 06:39 PM   #7
Aetheron
 
Aetheron's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 32
Originally Posted by Garkin View Post
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).
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Detecting player interactable state


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off