Thread Tools Display Modes
01/26/16, 09:30 AM   #1
step1step2
Join Date: Nov 2014
Posts: 5
New to the API. Already got stuck.

Are only addons uploaded to this website supported by the client? I've tried quite a few things to get started but nothing works so far. Even code of your wiki doesn't work. My first guess was that the wiki might be outdated but this code seems to work for other addons as well so wtf.

Do you have a Slack channel? The IRC channel is dead. I dislike creating threads to ask. I have 1 question every 10 minutes. I doubt you want me to spam your forums.

Any help is very much appreciated.

One of many attempts (I didn't save them all):
https://gist.github.com/anonymous/2976abea033cb77b120f
The code is based on CombatIndicator. An addon that does seem to work.
I was hoping to receive an exception at least. But I'm getting ignored.
  Reply With Quote
01/26/16, 09:45 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Hi and welcome

Watch out the version number in the right corner. If there is no version number (currently 2.2.4) it is "out-dated". It may still works, but it's likely not a good example to start with.

Try http://www.esoui.com/downloads/info934-HelloWorld.html

And yes, keeping tutorials up-to-date is work, too

Later on, you may check the "Developer Utilities" category: http://www.esoui.com/downloads/cat35.html
  Reply With Quote
01/26/16, 10:17 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Welcome!

If you do not see any output or errors at all, it might be an issue with your meta file which prevents your addon from getting loaded.
Check if the addon is in the list of loaded addons ingame and if it is, put only error("test") in your file to see if the file is even loaded.

Also don't worry about asking many questions on the forums. That's what they are here for.
Haven't used Slack until now and don't think we have a Slack channel, but maybe someone could create one as an alternative to the more or less failed plan of making an ingame guild for exactly the same purpose?
  Reply With Quote
01/26/16, 11:10 AM   #4
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Your code has holes all over it. :P

Also d() doesn't work at startup because (I think) the chat isn't available at that point (d() prints at the chat window).

Are you sure you're putting the add-ons in the correct folder? I don't mean to be rude I'm just checking.

I'd suggest you start with something even smaller, like a slash command that prints a message and then go from there in small steps. When you get the hang of it you'll naturally increase the size of each step.

This, for instance:

Code:
local function OnAddOnLoaded()
    SLASH_COMMANDS["/myaddon"] = function()
        d("Hey oh!")
    end
end

EVENT_MANAGER:RegisterForEvent("MyAddOn", EVENT_ADD_ON_LOADED, OnAddOnLoaded)
Put it in a file called MyAddOn.lua with another file called MyAddOn.txt with this content:

Code:
# APIVersion: 100013
# Title: MyAddOn

MyAddOn.lua
Both files go in a folder called MyAddOn, and that folder you put in MyDocuments\Elder Scrolls Online\live\AddOns\.

If you're in European server change "live" to "liveeu".

Log in the game and see what happens when you type /myaddon.

Last edited by haggen : 01/26/16 at 11:13 AM.
  Reply With Quote
01/26/16, 12:42 PM   #5
coolmodi
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 47
Originally Posted by haggen View Post
Also d() doesn't work at startup because (I think) the chat isn't available at that point (d() prints at the chat window).
To still output things after "start" you can use the EVENT_PLAYER_ACTIVATED, at least that's what I did.

Lua Code:
  1. local function OnPlayerActive()
  2.     d("sdghskdg")
  3. end
  4.  
  5. EVENT_MANAGER:RegisterForEvent("MyAddOn", EVENT_PLAYER_ACTIVATED, OnPlayerActive)
  Reply With Quote
01/26/16, 12:53 PM   #6
step1step2
Join Date: Nov 2014
Posts: 5
Originally Posted by votan View Post
Hi and welcome

Watch out the version number in the right corner. If there is no version number (currently 2.2.4) it is "out-dated". It may still works, but it's likely not a good example to start with.

Try http://www.esoui.com/downloads/info934-HelloWorld.html

And yes, keeping tutorials up-to-date is work, too

Later on, you may check the "Developer Utilities" category: http://www.esoui.com/downloads/cat35.html
Thank you very much. It helps.

Originally Posted by sirinsidiator View Post
Welcome!

If you do not see any output or errors at all, it might be an issue with your meta file which prevents your addon from getting loaded.
Check if the addon is in the list of loaded addons ingame and if it is, put only error("test") in your file to see if the file is even loaded.

Also don't worry about asking many questions on the forums. That's what they are here for.
Haven't used Slack until now and don't think we have a Slack channel, but maybe someone could create one as an alternative to the more or less failed plan of making an ingame guild for exactly the same purpose?
https://gist.github.com/anonymous/32...aneuver-lua-L4
Didn't do anything. Is there something like a debug console I need to enable?
The addon seems to be loaded:



Originally Posted by haggen View Post
Your code has holes all over it. :P

Also d() doesn't work at startup because (I think) the chat isn't available at that point (d() prints at the chat window).

Are you sure you're putting the add-ons in the correct folder? I don't mean to be rude I'm just checking.

I'd suggest you start with something even smaller, like a slash command that prints a message and then go from there in small steps. When you get the hang of it you'll naturally increase the size of each step.

This, for instance:

Code:
local function OnAddOnLoaded()
    SLASH_COMMANDS["/myaddon"] = function()
        d("Hey oh!")
    end
end

EVENT_MANAGER:RegisterForEvent("MyAddOn", EVENT_ADD_ON_LOADED, OnAddOnLoaded)
Put it in a file called MyAddOn.lua with another file called MyAddOn.txt with this content:

Code:
# APIVersion: 100013
# Title: MyAddOn

MyAddOn.lua
Both files go in a folder called MyAddOn, and that folder you put in MyDocuments\Elder Scrolls Online\live\AddOns\.

If you're in European server change "live" to "liveeu".

Log in the game and see what happens when you type /myaddon.
Your code didn't work. I have tried to use brackets of the Hello World template tho. Unfortunately it didn't help either.
https://gist.github.com/anonymous/323b5dc4352df3cfb43e
  Reply With Quote
01/26/16, 01:03 PM   #7
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
If the error never shows up, it means the file does not get loaded. Can you upload the whole thing somewhere so we can see your addon manifest and folder structure?
  Reply With Quote
01/26/16, 01:15 PM   #8
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by sirinsidiator View Post
Haven't used Slack until now and don't think we have a Slack channel, but maybe someone could create one as an alternative to the more or less failed plan of making an ingame guild for exactly the same purpose?
Neither have I, but I went ahead and made esouidevs.slack.com. I don't know if it will fare any better than IRC, but I suppose it's worth a shot . I think it would actually be convenient if it gets traction.
  Reply With Quote
01/26/16, 01:21 PM   #9
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Originally Posted by step1step2 View Post
Your code didn't work. I have tried to use brackets of the Hello World template tho. Unfortunately it didn't help either.
https://gist.github.com/anonymous/323b5dc4352df3cfb43e
You changed the code and introduced a bug. :P No worries I'll walk you through it:

When you defined the #Initialize method you used the dot notation, so "self" doesn't exist in there.

Either you give that method the correct "self" object or you use the colon notation:

Code:
function Maneuver:Initialize(...)
Which works exactly like if you had done this:

Code:
function Maneuver.Initialize(self, ...)
But when you call this method you have to give it the "self" it is expecting so you either do this:

Code:
Maneuver:Initialize(...)
Or this:

Code:
Maneuver.Initialize(Maneuver, ...)
Because the way you did "self" in there is the eventCode thrown by EVENT_ADD_ON_LOADED, so the test "... == self.name" will never work.

Also no need for "GetEventManager()". That's exactly what was assigned to the global EVENT_MANAGER, so you can just use it.

A big pro tip that worked really great for me was to read A REALLY LOT of the source code for the stock UI, you can find it here: http://esodata.uesp.net/current/src/luadir.html

Just explore the folders and files reading randomly or search for something you'd like to see, you'll learn TONS of stuff about the API and Lua (and the methodologies and background of the developers at ZOS ).

EDIT.
There, fixed it for you: https://gist.github.com/haggen/d5672ea740eb4ae326a0

Last edited by haggen : 01/26/16 at 01:29 PM.
  Reply With Quote
01/26/16, 01:21 PM   #10
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Originally Posted by Randactyl View Post
Neither have I, but I went ahead and made esouidevs.slack.com. I don't know if it will fare any better than IRC, but I suppose it's worth a shot . I think it would actually be convenient if it gets traction.
Why not just ESOUI?
  Reply With Quote
01/26/16, 01:29 PM   #11
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by haggen View Post
Why not just ESOUI?
I picked what I thought I remembered was the IRC channel name (it was actually #esouidev).
But it doesn't really matter. I made esoui.slack.com too, so I guess vote for what you guys want

PS, sorry for being slightly off topic
  Reply With Quote
01/26/16, 01:33 PM   #12
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Originally Posted by Randactyl View Post
I picked what I thought I remembered was the IRC channel name (it was actually #esouidev).
But it doesn't really matter. I made esoui.slack.com too, so I guess vote for what you guys want

PS, sorry for being slightly off topic
You're forgiven. Now invite me there [email protected]
  Reply With Quote
01/26/16, 01:54 PM   #13
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Guess I need an invite too: [email protected]
  Reply With Quote
01/26/16, 03:57 PM   #14
step1step2
Join Date: Nov 2014
Posts: 5
Thank you very much everyone!
I want an invite as well
[email protected]
  Reply With Quote
01/26/16, 04:07 PM   #15
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by step1step2 View Post
Thank you very much everyone!
I want an invite as well
[email protected]
Sidenote:
Lua Code:
  1. d("blabla")
will NOT work until you have made a function for it:
Lua Code:
  1. local function d(...)
  2.     CHAT_SYSTEM:AddMessage(...)
  3. end
  Reply With Quote
01/26/16, 04:18 PM   #16
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Originally Posted by SnowmanDK View Post
Sidenote:
Lua Code:
  1. d("blabla")
will NOT work until you have made a function for it...
Actually it will. "d()" is defined globally here: http://esodata.uesp.net/100013/src/l...ls.lua.html#36
  Reply With Quote
01/26/16, 04:18 PM   #17
step1step2
Join Date: Nov 2014
Posts: 5
Originally Posted by SnowmanDK View Post
Sidenote:
Lua Code:
  1. d("blabla")
will NOT work until you have made a function for it:
Lua Code:
  1. local function d(...)
  2.     CHAT_SYSTEM:AddMessage(...)
  3. end
Oh wow. I was assuming it is part of the API
  Reply With Quote
01/26/16, 04:28 PM   #18
step1step2
Join Date: Nov 2014
Posts: 5
Originally Posted by haggen View Post
Actually it will. "d()" is defined globally here: http://esodata.uesp.net/100013/src/l...ls.lua.html#36
It still seems to work this way. Do I need to include a lib?
  Reply With Quote
01/26/16, 04:45 PM   #19
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Final off topic post:

I think Haggen and I have settled on Gitter for quick communication. See his post here - http://www.esoui.com/forums/showthre...5676#post25676
  Reply With Quote
01/26/16, 04:49 PM   #20
haggen
 
haggen's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2015
Posts: 137
Originally Posted by step1step2 View Post
It still seems to work this way. Do I need to include a lib?
Absolutely not. Everything you find here http://esodata.uesp.net/100013/src/l...es/luadir.html or here https://github.com/ESOUI/ESOUI (which are the same code base by the way) is the actual source bundled by the game so you have access to everything that's global (and not protected: http://wiki.esoui.com/Protected_and_Private_functions).
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » New to the API. Already got stuck.

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