Thread Tools Display Modes
12-24-11, 09:43 PM   #1
phillydave2012
A Murloc Raider
Join Date: Dec 2011
Posts: 6
wowiki tutorial question

I have a hankering to write an addon to parse text going to the chat window and format it in a particular way.

I went to wowwiki's tutorial on writing addons. It has a hello world program to get one started.

I placed the HelloWorld directory in my addons directory next to Blizzard's directories and the other directories for things like Gatherer and Recount.

I added inside my directory the HelloWorld.lua , HelloWorld.xml, and HelloWorld.toc files.

As a software developer I know that you have to be very careful and specific. For the life of me I cannot see why my HelloWorld addon does not appear with a checkbox when I open the WoW UI.

I'd swear the directory and files have proper permissions and are in the proper directory. All my other addons are there and all work.

I actually had tried this a few years back and had it working but for the life of me now that I actually have an idea I really want to implement I cannot figure out what I am doing wrong to even get going.

Any help at all would be greatly appreciated.
  Reply With Quote
12-24-11, 10:03 PM   #2
Coote
A Scalebane Royal Guard
 
Coote's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 440
It would help if you post your folder structure, and code.
__________________

"This is the fifteen-thousandth four hundredth and ninety-eighth occurence".
  Reply With Quote
12-24-11, 10:49 PM   #3
phillydave2012
A Murloc Raider
Join Date: Dec 2011
Posts: 6
structure

Had to tried to describe it so I wouldn't waste bandwidth. Sorry.

Here are two screen prints showing the addons directory and the contents of my directory inside.

They are just saved using paint from Windows 7.
Attached Images
File Type: png addons.png (183.1 KB, 661 views)
File Type: png files inside.png (154.6 KB, 640 views)

Last edited by phillydave2012 : 12-25-11 at 12:24 AM.
  Reply With Quote
12-24-11, 11:54 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
You forgot your screenshots. You can attach them to your post by scrolling below the "submit reply" button when typing a comment.

PS- you should switch to wowpedia rather than wowwiki - it will be updated more reliably, as most of the wowwiki staff moved to the new site.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-25-11, 12:37 AM   #5
JerichoHM
A Kobold Labourer
 
JerichoHM's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 1
Originally Posted by phillydave2012 View Post
Had to tried to describe it so I wouldn't waste bandwidth. Sorry.

Here are two screen prints showing the addons directory and the contents of my directory inside.

They are just saved using paint from Windows 7.
It seems your file structure is correct. Perhaps you can create a paste at wowace.com of each file that will allow us to browse the code. You could also us the code tags here since the HelloWorld is so small.
  Reply With Quote
12-25-11, 01:04 AM   #6
phillydave2012
A Murloc Raider
Join Date: Dec 2011
Posts: 6
file contents

As per your instructions I switched to wowpedia.

Because I could not see a single thing wrong. I did two things.

I deleted the Omen directory from addons to confirm I was in the right place.

Sure enough, it vanished.

Also I started from scratch with the wowpedia versions of the code, cut and pasted exactly from the wowpedia hello world program.

So the code you ask for is at:
http://www.wowpedia.org/AddOn_progra...l/Introduction

I am having trouble getting in to my wowace since curse is one of the few things I allow to store my pw and have forgotten. Resetting but I will post it.

But it really is copied and pasted from the link above.



PS ok I now have it posted over at WoWace!

Goodness I really have got to know what it is because I feel like I am following along and doing exactly as instructed. In fact I even had this working once years back but didn't really have a good idea for an addon and just never went further.

Now of course that I have an idea, stumped.

Last edited by phillydave2012 : 12-25-11 at 01:16 AM.
  Reply With Quote
12-25-11, 03:33 AM   #7
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Have you restarted wow (a simple reload will not find new created files in the filestructure) ?

Really make sure that the number in the toc for your interface is not bigger than 40300.

Edit:

I tested the code on wowpedia and now I know where all the faults with duplicated stuff comes from
The code itself is fine and should do what you want. The only "problem" is that the HelloWorld.lua is loaded twice.
Once in your toc and once in your xml.
You should decide if you want to use xml at all as it is only required for very few special cases.
See http://www.wowpedia.org/AddOn_progra...implementation
__________________
The cataclysm broke the world ... and the pandas could not fix it!

Last edited by Rilgamon : 12-25-11 at 03:43 AM.
  Reply With Quote
12-25-11, 05:44 AM   #8
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Originally Posted by phillydave2012 View Post
Had to tried to describe it so I wouldn't waste bandwidth. Sorry.

Here are two screen prints showing the addons directory and the contents of my directory inside.

They are just saved using paint from Windows 7.
So, out of curiosity, it says that the file type is a "text document", did you - by accident perhaps - maybe not save the file as it should've been saved, and instead it is saving a text document with an invalid extension?
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote
12-25-11, 05:54 AM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,007
Yep, that is indeed what it looks like. programmers notepad does that if youre not careful.

If you create a text file with windows 7 without notepad then it will give it the .txt extension by default. However if you open notepad and do save as a non text document and put the correct extension on it should work fine.

So in essence they are HelloWorld.lua.txt etc

To check this, right click on the file and choose properties and then details. The name will be the full name.

However, to rename it you will either have to copy and paste the contents of the file into a new one and save it correctly or ... use the Organize/Folder and Search Options to restore the extension display as my images attached show.
Attached Images
File Type: png test1.png (189.4 KB, 634 views)
File Type: png test2.png (236.7 KB, 648 views)
File Type: png test3.png (182.8 KB, 626 views)
__________________


All Level 70 Characters:
Demon Warlock
Resto Druid
Disc Priest
Resto Shaman
Survival Hunter
Augment Evoker
Frost Mage
Vengence Demon Hunter
Rogue ( was subtlety )

Brewmaster Monk (TR)
Prot Paladin (TR)
Blood Death Knight ( TR)

As you can see I am missing a warrior

And .. I don't have all the allied races covered. Time Runner time when it happens again


Last edited by Xrystal : 12-25-11 at 06:12 AM.
  Reply With Quote
12-25-11, 10:40 AM   #10
phillydave2012
A Murloc Raider
Join Date: Dec 2011
Posts: 6
HUGE thank you!

(edit) Well as stated below my addon is seen by WoW now. Very happy. It is not however sending the line of text to my chat window. The earlier responder suggested it is being called twice. To my mind the result of that should be two lines of text but I guess not. I wish I was not so clueless as to syntax and usage at this point. I feel a bit helpless but I am pretty good with fiddling. But if anybody can see from the code I took from wowpedia why it might not be actually sending the simple line of text to the window I'd love to hear from you.

Xrystal's suggestion finally got me over the top. I had seen the .txt extension problem suggested and was sure I had fixed it by starting over and switching to notepad but I had created the files as text files from Windows and so using notepad had done nothing about it.

The files did in fact have those stupid extra .txt and because I was sure they did not I would have NEVER revisited it.

Thanks to everyone, I cannot get over how helpful this site is. Special thanks Xrystal for those screen prints on Windows7 since I had known where to find that resetting of Windows options on previous versions but had not done that sort of thing with the new OS yet.

I really hope I can learn a bit about the actual syntax, api's, lua and xml now because having come back to wow in 4.3 I actually have a few tools I need that have not been implemented so maybe I can make a tiny contribution.

It is so frustrating when you think you are being careful about using the suggested example exactly and it does not work.

I knew it would be something important but I could not see those darn hidden extensions and thought I had already addressed it.

Again, huge thanks.

Last edited by phillydave2012 : 12-25-11 at 10:53 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » wowiki tutorial question


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