Thread Tools Display Modes
08/19/17, 06:39 PM   #1
Elmofuntz
Join Date: Jul 2017
Posts: 5
How do I figure out what api parameters are/do?

So I'm new to lua but not programming in general but I also don't do it for a living.. I'm trying to figure out how I can determine what the ZOS api calls are looking for as parameters and what they do. Specifically at the moment I'm looking at ZO_ReticleContainerInteract. I've looked at a couple addon's (craftautoloot) that use it and someone's example here but not clear on what the parameters are (and the board example is different than the addon code). I'm sure some of this confusion is due to not totally understanding lua yet.

Also why when I look at the wiki does it seem the esoui api is always behind? like right now it says "Page up-to-date to API Version 100020 (except ESOUI API which is at 100016)" Thanks for any assistance you can give a newcomer as I try to figure this all out.

Last edited by Elmofuntz : 08/19/17 at 06:55 PM.
  Reply With Quote
08/19/17, 08:33 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
http://www.esoui.com/downloads/info1...ourcecode.html

Download, Browse, find.

Also why when I look at the wiki does it seem the esoui api is always behind? like right now it says "Page up-to-date to API Version 100020 (except ESOUI API which is at 100016)" Thanks for any assistance you can give a newcomer as I try to figure this all out.
I'm lazy.

And ZO_ReticleContainerInteract is not part of the API, ZO_ReticleContainerInteract is defined in the Lua code, it does not come from the C++ Code.

And I would add that it's not even defined in a .lua file, but in an XML Definition.
\esoui\ingame\reticle\reticle.xml
So it don't have any parameter because it's not a function, it's a variable.

Lua Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="ZO_ReticleContainer" hidden="true" tier="LOW" layer="BACKGROUND">
  4.             <AnchorFill/>
  5.  
  6.             <OnInitialized>
  7.                 ZO_Reticle_Initialize(self)
  8.             </OnInitialized>
  9.  
  10.             <Controls>
  11.                        
  12.                 <Control name="$(parent)Interact" hidden="true">
  13.                     <Dimensions x="200" y="50" />
  14.                     <Anchor point="LEFT" relativePoint="CENTER" offsetX="45" offsetY="40" />
  15.                     <Controls>
  16.                         <Label name="$(parent)Context">
  17.                             <DimensionConstraints maxX="380" />
  18.                             <Anchor point="BOTTOMLEFT" />
  19.                         </Label>
  20.  
  21.                         <Control name="$(parent)KeybindButton" inherits="ZO_KeybindButton">
  22.                             <Anchor point="TOPLEFT" relativeTo="$(parent)Context" relativePoint="BOTTOMLEFT" offsetX="20" offsetY="6"/>
  23.                         </Control>
  24.  
  25.                         <Label name="$(parent)AdditionalInfo" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_CONTRAST">
  26.                             <Anchor point="TOPLEFT" relativeTo="$(parent)KeybindButtonNameLabel" relativePoint="BOTTOMLEFT" offsetY="6"/>
  27.                         </Label>
  28.                     </Controls>
  29.                 </Control>
  Reply With Quote
08/20/17, 07:51 AM   #3
Elmofuntz
Join Date: Jul 2017
Posts: 5
Ok cool I was not sure if there was a reason the versions were behind or just whoever did it was not able to get to it yet. I would hardly call anyone doing addon work for the community lazy. It "gets my goat" when people bitch about addon's not working especially right after a patch, like it's something they are owed. This is one reason I am trying to do one myself this time around (I avoided it in WoW and EQ).

The link to the source helps as well thanks. I guess I am still a bit confused about my question the line I was looking at shows this

Code:
ZO_ReticleContainerInteract:SetHandler("OnShow", function()
      local action, container, _, _, additionalInfo, _ = GetGameCameraInteractableActionInfo()
Then a giant if statement all wrapped up in that SetHandler and to me it looked like a function passing or setting variables. I was trying to figure out what some of that like the _'s are for. Like I said I'm very unfamiliar with lua more a PowerShell, vb, some C# guy and I only dabble for fun. I get the general gist of what the entire code does. I've been able to modify it and add new action types and objects to it but i'm looking to do more and while theres a good chance none of the rest of that line does anything I care about I tend to get stuck on trying to know all the details just in case.

BTW I did actually find an example of that XML in all my googling somewhere and it actually added to my confusion since as you stated its clearly not a function there..

I do appreciate all the help.

-E

Last edited by Elmofuntz : 08/20/17 at 07:55 AM.
  Reply With Quote
08/20/17, 08:22 AM   #4
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
In that example, ZO_ReticleContainerInteract is the target, SetHandler is being executed on it and adding a function on show. The function is grabbing the data from GetGameCameraInteractableActionInfo() which is shown in the ESO API:

Returns: string:nilable action, string:nilable name, boolean interactBlocked, boolean isOwned, number additionalInfo, number:nilable contextualInfo, string:nilable contextualLink, boolean isCriminalInteract
  Reply With Quote
08/20/17, 06:50 PM   #5
Elmofuntz
Join Date: Jul 2017
Posts: 5
Ah thanks for the info!
  Reply With Quote
08/26/17, 05:22 AM   #6
manavortex
 
manavortex's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 138
Here's the API documentation:
http://wiki.esoui.com/Api

  Reply With Quote
08/26/17, 06:45 PM   #7
Elmofuntz
Join Date: Jul 2017
Posts: 5
Originally Posted by manavortex View Post
Here's the API documentation:
http://wiki.esoui.com/Api

Um ok. Thanks? Been there couldn't find it (cause its not in there) thus the post and the helpful replies already. But thanks anyhow for trying!
  Reply With Quote
08/26/17, 06:58 PM   #8
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
She was building on my response; not trying to answer the original question.
  Reply With Quote
08/27/17, 09:33 PM   #9
Elmofuntz
Join Date: Jul 2017
Posts: 5
Originally Posted by Rhyono View Post
She was building on my response; not trying to answer the original question.
That's cool. All the help I can get. I guess one should never assume someone knows about something unless its clearly stated in a post. I failed to say I had seen the API listing and gotten totally lost trying to find what I needed. My bad. Again thanks for all the help you all have been great so far.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How do I figure out what api parameters are/do?

Thread Tools
Display Modes

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