Page 1 of 1

Weird problem getting Addons to work

Posted: Wed Feb 15, 2012 7:24 pm
by Immet
I've been playing ToME for a little while and really enjoying it so I thought I'd try to make an addon class. However, I kept getting more and more frustrated at the fact that my class wasn't showing up in the list even though other addons were working. I ended up trying to change a copy of Goblinz's Death Knight- at first large changes but later smaller and smaller changes until I was just trying to change some of the text.

I then tried unzipping the file, deleting the old one and compressing the folder again immediately without any changes, then converting back to .teaa and it no longer shows up. As in a class which definitely works stops working because I personally zipped it rather than it being zipped elsewhere.

So basically, if I compress the addon folder into a .zip using the standard context menu (Mac OS 10.6) then convert it to a .teaa it doesn't work. It doesn't work for mine or other addons so its not a programming error on my part.

Is there something specifically wrong about using the Mac compression, or is there something else going on?

Re: Weird problem getting Addons to work

Posted: Thu Feb 16, 2012 1:17 am
by Goblinz
Have you tried to make an addon in non .teaa form? That is the way to start out and is much simpler. The change to .teaa is just for publishing purposes so it does no invalidate your online characters. You also may be compressing the folder that contains the actual addon. so for a normal folder you have something like this

Code: Select all

addons/foo/init.lua
for .teaa you have this

Code: Select all

addons/foo.teaa/init.lua
what you are probably doing ins

Code: Select all

addons/foo.teaa/foo/int.lua
also what compression format are you using? it could be possible that it does not work. If nothing here helps check out the irc channel. there is a good chance someone will be able to help you.

Re: Weird problem getting Addons to work

Posted: Thu Feb 16, 2012 1:45 am
by lukep
To compress in a mac, you cannot select the folder. Instead, select all of the files in the folder, and compress those (then rename it from archive.zip to tome-foo.teaa in the "get info" window, so you aren't getting tome-foo.teaa.zip.)

Re: Weird problem getting Addons to work

Posted: Thu Feb 16, 2012 2:18 am
by Immet
Oh, thats absolutely brilliant. It works fine now.

I think I tried just having an addon as a folder earlier, but when I tried starting a new game to test the class it started loading extremely slowly around the 34% mark. As in about 1% every other second. I tried leaving it to get to 100% but nothing happened once it got there so I had to force quit it. After that I thought it had to be .teaa files.

Which... doesn't make sense now that I'm thinking about it since the example module addons are folders instead of .team files.

It did start loading slowly about the 34% mark again, but at about 36% onwards it was fine. And I was compressing it as a zip file.

Thanks again.

Re: Weird problem getting Addons to work

Posted: Thu Feb 16, 2012 4:01 am
by Phoenix1
So the problem is that the class isn't showing up in the character creation page, right? I think missing any of the following could cause that:

Did you attach the class to an existing metaclass, or if it's part of a new metaclass, did you attach the metaclass to the campaigns?

Did you add the class definition to the birther in the ToME:load hook?

Did you format init.lua for the addon? And in particular, is it set to work with your version of ToME?

If none of that...I dunno. If you want to try uploading the addon, we might be able to spot a problem.