• 0

    posted a message on Frame doesn't show
    I made a mistake. Seeing you suggested PLAYER_LOGIN as event, I changed the code because I run it after login. Using wowlua.
    ...but there is no 'self', when the code is not a part of MyAddOn ('member' function).
    Posted in: AddOn HELP!
  • 0

    posted a message on Frame doesn't show
    Thanks for the comments, Phanx especially. Very nice of you to take the time.

    I ran the script Phanx wrote using the wowlua addon and had some problems:
    "attempt to index global 'self' (a nil value)"
    I suppose that means that self isn't defined or initialized with MyAddOn, and I just changed 'self' to MyAddOn, and it works.

    Thanks again.
    Posted in: AddOn HELP!
  • 0

    posted a message on Frame doesn't show
    Phanx;271627]Why are you polluting the global namespace by creating a frame in XML? :(

    When I saw your sad smily I just knew something was wrong.
    I've no intentions of putting the addon on curse just yet, or anytime at all, so only I will have to endure the pollution, but I'm currious about something. As long as I give my frame a uniq name, like prefixing it with the modname, it shouldn't be a problem, right? I read on wowwiki, that I should use xml frames for static frames and createframe() for dynamic frames. Is that not correct?

    Also, embeds.xml is for referencing libraries. If you really need to do other stuff in XML (which you don't) make a separate file.

    I moved the xml frame to another file. Trying to call it before it was defined did not work! :D

    Also, your frame is shown by default, so the :Show() call does nothing, but you didn't add any properties to it that would make it visually apparent, so it's invisible.
    This comment saved me. I did think the button was visible, but it wasn't before it inheritede from OptionsButtonTemplate. Not even when the text attribute was set in the button element.
    Posted in: AddOn HELP!
  • 0

    posted a message on Frame doesn't show
    This is the start of my first and very simple addon, but the frame doesn't show:

    Vampyr.toc
    ## Interface: 30000
    ## Title: Vampyr
    ## Notes: Vampire addon
    ## Author: Gretter1
    ## Version: 0.1
    ## X-Category: Guild

    embeds.xml
    main.lua


    embeds.xml
    <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
    <Script file="Libs\LibStub\LibStub.lua"/>
    <Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
    <Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
    <Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
    <Frame name="MyAddon_Frame" parent="UIParent" hidden="false">
    <Size><AbsDimension x="200" y="200"/></Size>
    <Anchors>
    <Anchor point="CENTER"/>
    </Anchors>
    <Frames>
    <Button name="MyAddon_Button">
    <Anchors>
    <Anchor point="CENTER"/>
    </Anchors>
    </Button>
    </Frames>
    </Frame>
    </Ui>


    main.lua
    MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0", "AceEvent-3.0")

    function MyAddon:OnInitialize()
    -- Code that you want to run when the addon is first loaded goes here.
    -- AceConsole used as a mixin for AceAddon
    -- MyAddon:Print("Hello, world!")
    MyAddon_Frame:Show()
    end

    function MyAddon:OnEnable()
    -- Called when the addon is enabled
    -- Hook the event ZONE_CHANGED to know when the game character enters a new zone.
    self:RegisterEvent("ZONE_CHANGED")
    MyAddon_Frame:Show()
    end

    function MyAddon:OnDisable()
    -- Called when the addon is disabled
    end

    function MyAddon:ZONE_CHANGED()
    -- Event handler for ZONE_CHANGED.
    self:Print("You have changed zones!")
    if GetBindLocation() == GetSubZoneText() then
    self:Print("Welcome Home!")
    end
    end
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    This morning I read through: http://old.wowace.com/wiki/WelcomeHome_-_Your_first_Ace3_Addon. It has a lot of info for me at this point on my learning curve. One thing I would like to know more about is user interface. The addon in the mentioned article uses UIErrorsFrame to display a message.
    Does Ace3 have a UI library I should use, or maybe someone can guide me to another article about making a UI and hooking it with my addon code?

    To begin with I'm just going to have an area for text output and a few buttons. Later on I'll have a bar to be filled up from the buttom: The more mobs killed, the more blood in the bar.

    Also, I read a bit about unitframes. It seems that the projects I came across are ment to replace blizzards UI. But I just need to add a little, so instead of digging to deep into those projects I ask here.
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    Quote from Farmbuyer
    If main.xml isn't listed in the .toc file, it won't be loaded. Since your main.xml doesn't do anything in this example, you can get rid of it.


    Thx. I've corrected that in my initial post. main.xml is not used just embed.xml
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    Thx to both. Great advise. This is the kind of stuff anyone needs to get started.
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    Thx jerry - very helpful. I now have bugbag and !buggrabber.
    After correcting the order of embed.xml and main.luz in vampyr.toc I get this error from bugbag:

    2009/03/31 19:52:12-1-x1]: Vampyr-0.1\main.lua:7: attempt to call method 'Print' (a nil value)
    (tail call): ?:
    <in C code>: ?
    <string>:"safecall Dispatcher[1]":9: in function <[string "safecall Dispatcher[1]"]:5>
    (tail call): ?:
    AceAddon-3.0-5 (BugSack):340: in function `InitializeAddon'
    AceAddon-3.0-5 (BugSack):428: in function <...ce\AddOns\BugSack\Libs\AceAddon-3.0\AceAddon-3.0.lua:421>

    so maybe I didn't mixin the library with the Print("string") function. I'll have to check on that now.

    Edit: yes, it works with this line instead:
    MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0")
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    No effect. I was hopping to see: Hello, world!
    in the chat window.
    I'm guessing OnInitialize() happens to early, and that maybe the chat window isn't ready at that time.
    Posted in: AddOn HELP!
  • 0

    posted a message on Could need some help to understand all this...
    Hi I just started as well, and maybe we can benefit from each others learnings... maybe :)

    Anyways, here is what I'm doing.
    I'm using Notepad++ as my editor.
    My addon will be named Vampyr - vampire in danish. It's going to add some flavor to my guilds play, giving humorous reminders for vampires.

    As I start to write my addon I'm going to make mistakes and syntax errors. Having to start wow over every time I make a code change will be a hassel, and I hope to get some improved debugging help using Ace3. Perhaps even be able to reload the addon while wow is running. Can I do that?

    CODE:
    My first code will be in three files and a sub folder with libraries.
    Vampyr.toc, main.xml and main.lua

    Vampyr.toc:
    ## Interface: 30000
    ## Title: Vampyre
    ## Notes: Vampire addon
    ## Author: Gretter1
    ## Version: 0.1

    embeds.xml:
    <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
    <Script file="Libs\LibStub\LibStub.lua"/>
    <Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
    <Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
    </Ui>

    main.lua:
    MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon")

    function MyAddon:OnInitialize()
    -- Code that you want to run when the addon is first loaded goes here.

    -- AceConsole used as a mixin for AceAddon
    MyAddon:Print("Hello, world!")
    end

    function MyAddon:OnEnable()
    -- Called when the addon is enabled
    end

    function MyAddon:OnDisable()
    -- Called when the addon is disabled
    end


    And now I'll go try it out... see if it does anything.
    btw. The code I got from here:
    http://www.wowace.com/projects/ace3/pages/getting-started/

    oh.. and in the Libs folder are alle the files form the latest ace3 beta release.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.