So.. whats the point of this thread? You basically said "I want to make a similar addon, I don't have any idea on what to change, but I don't want it to be exactly the same.", and you didn't ask a question.
Look at the code of other addons. Read sticky threads. Go over to wowwiki.com, start at the Interface Customization portal (link on the left sidebar), and read HOWTOs.
erm that made me even more confused and frustrated. i didn't really want you to write the code for me or something. atm i'm not even sure where to put it.
i do understand whats there tho.
umm this might be a good time to mention i haven't tried loading anything in game yet.
i think my problem is i want to read what i need to read and not all this other stuff cux all this other stuff is making me mad.
What do i need to read to make a moveable text box that displays the unit's power.
There's only two ways to help someone write code, point them at documentation or write the code for them. Both of which were done in this thread. If said docs are making you mad, then perhaps you don't have the aptitude for coding.
Conversely, there's only two ways to learn how to code, read documentation and look at other people's code.
egingell, what i'm saying is i feel like i'm not getting anywhere with anything i read. it just leads to more unanswered questions. I want to learn it i really do but at the moment it feels like i'm in a sea of information that i can't piece together to make something of. it's not like i haven't completed the simple HelloWorld tutorial but everything i read makes more questions and from those questions come more questions which i can't find an answer to. Maybe i'm just getting a little ahead of myself. i think i'll complete the Show Me The Money Tutorial then read some more stuff.
Btw is there like a list or an explanation of what some of theses xml/lua are for in Blizzard Interface Data folder?
i need to do the following:
create a frame
make an event handler
make the event for rage
i need to put the event in an edit box as text
i need to set the base value to player
then i need to make the whole thing drag-able
1) Create a frame.
2) Add a font string to your frame.
3) Make your frame draggable.
4) Set an event handler on your frame.
5) Register the appropriate event(s) on your frame.
6) When your event handler is called, set the text of your font string.
i'm having problems figuring out which is xml and which is lua. i understand lua is script and xml is look and feel. it feels as if i missing something or i didn't read something. also just putting this stuff in seems i'm missing alot of filler of code that i don't know about.
i'm having problems figuring out which is xml and which is lua. i understand lua is script and xml is look and feel. it feels as if i missing something or i didn't read something. also just putting this stuff in seems i'm missing alot of filler of code that i don't know about.
The bolded part is wrong. Lua and XML are simply two different file types. You can have Lua code in an XML file, and you can have code that performs the same function as XML in a Lua file. You do not need an XML file to have an addon, and most addons do not use an XML file, as it is generally simpler to just create frames in Lua than in XML.
You may find the following pages on WoWWiki useful:
The converse is also true, you can write an addon purely in XML. It would be ugly, but its doable, by putting your entire addon code in a frame's OnLoad in XML. :)
Its generally "preferred" to write an addon purely in Lua because
- XML is overly verbose.
- XML parsing errors are hard to detect as they don't show the line numbers in FrameXML.log, you have to load it in IE or Firefox to see which line errored.
- XML has issues when you try to comment code with --
- You can adjust frame properties in Lua faster than in XML since you an copy/paste code in game to adjust things.
so how does this all relate to the ace3? i understand ace3 is a collection of libs for reuse among other addons so i'm guessing nothing in ace3 has to do with my addon.
Phanx:
Is there a tool to look at ur code better it's not entirely neat like some i have looked at. Like it's all 1 line almost. Also what is the purpose of the xml file then if it is purely Lua?
so how does this all relate to the ace3? i understand ace3 is a collection of libs for reuse among other addons so i'm guessing nothing in ace3 has to do with my addon.
Ace3 simplifies a lot of stuff, and reuses code for other things. Any addon can be done with or without Ace3, its just easier to do some things in it.
Is there a tool to look at ur code better it's not entirely neat like some i have looked at. Like it's all 1 line almost. Also what is the purpose of the xml file then if it is purely Lua?
How the code looks is up to the person that writes it. There are many editors that will help you with formatting (while writing code), but its a fact of life: when looking at other people's code, it will often be messy and hard to follow because they don't write code the same as you do.
XML is largely irrelevant now. At the time of WoW's release you couldn't do frames entirely with LUA, or even do much manipulation of frames with LUA. In a later patch, (1.10, I think) CreateFrame was added to LUA, and in subsequent patches other frame-affecting functions were added. This made it possible to do anything XML can do in LUA.
XML frame-creation is simply part of WoW's engine, its up to you whether to use LUA or XML. *WE* consider LUA to be better, but it is every author's choice and opinion.
Try using WordPad to view Phanx's code instead of NotePad - sometimes they interpret line endings differently. Better yet, if you are on Windows, download NotePad++
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
i'd like to add other stuff to it also but for now i would like to just get going what that addon has.
i do not wish to copy it i don't know where i'd like to go with it.
how can i make something like that is what i'm asking. i'm brand new to this also >.<
I've figured out i need to use Unit Power, Unit Power type, and making the frame drag-able. I'm at a loss of where do go from here tho.
Where do i read on how to make this frame for the unit power? All i've found is to put it into chat
do i have to xfer the data from chat to the frame?
i'm confused.
i do understand whats there tho.
umm this might be a good time to mention i haven't tried loading anything in game yet.
i think my problem is i want to read what i need to read and not all this other stuff cux all this other stuff is making me mad.
What do i need to read to make a moveable text box that displays the unit's power.
i've read the following:
http://www.wowwiki.com/API_UnitPower
http://www.wowwiki.com/API_UnitPowerType
http://www.wowwiki.com/Making_Draggable_Frames
Conversely, there's only two ways to learn how to code, read documentation and look at other people's code.
See the similarities?
Btw is there like a list or an explanation of what some of theses xml/lua are for in Blizzard Interface Data folder?
i need to do the following:
create a frame
make an event handler
make the event for rage
i need to put the event in an edit box as text
i need to set the base value to player
then i need to make the whole thing drag-able
1) Create a frame.
2) Add a font string to your frame.
3) Make your frame draggable.
4) Set an event handler on your frame.
5) Register the appropriate event(s) on your frame.
6) When your event handler is called, set the text of your font string.
The bolded part is wrong. Lua and XML are simply two different file types. You can have Lua code in an XML file, and you can have code that performs the same function as XML in a Lua file. You do not need an XML file to have an addon, and most addons do not use an XML file, as it is generally simpler to just create frames in Lua than in XML.
You may find the following pages on WoWWiki useful:
http://www.wowwiki.com/API_CreateFrame
http://www.wowwiki.com/Making_Draggable_Frames (see the "Lua only approach" section near the bottom of the page)
You can also look at my addon Speedometer for a very simple example of a draggable frame that displays a single text string, all in pure Lua:
http://wowinterface.com/downloads/info8726-Speedometer.html
Its generally "preferred" to write an addon purely in Lua because
- XML is overly verbose.
- XML parsing errors are hard to detect as they don't show the line numbers in FrameXML.log, you have to load it in IE or Firefox to see which line errored.
- XML has issues when you try to comment code with --
- You can adjust frame properties in Lua faster than in XML since you an copy/paste code in game to adjust things.
Phanx:
Is there a tool to look at ur code better it's not entirely neat like some i have looked at. Like it's all 1 line almost. Also what is the purpose of the xml file then if it is purely Lua?
Ace3 simplifies a lot of stuff, and reuses code for other things. Any addon can be done with or without Ace3, its just easier to do some things in it.
How the code looks is up to the person that writes it. There are many editors that will help you with formatting (while writing code), but its a fact of life: when looking at other people's code, it will often be messy and hard to follow because they don't write code the same as you do.
XML is largely irrelevant now. At the time of WoW's release you couldn't do frames entirely with LUA, or even do much manipulation of frames with LUA. In a later patch, (1.10, I think) CreateFrame was added to LUA, and in subsequent patches other frame-affecting functions were added. This made it possible to do anything XML can do in LUA.
XML frame-creation is simply part of WoW's engine, its up to you whether to use LUA or XML. *WE* consider LUA to be better, but it is every author's choice and opinion.