Page 1 of 1
How do I modify and test code?
Posted: Sun Apr 22, 2012 3:55 am
by jenx
This is what I am doing currently, but it takes forever:
1. Rename tome-3.9.38-nomusic.team to tome-3.9.38-nomusic.zip
2. Unzip tome-3.9.38-nomusic.zip
3. Modify lua files
4. Rezip into tome-3.9.38-nomusic.zip
5. Delete unzipped files
6. Rename tome-3.9.38-nomusic.zip to tome-3.9.38-nomusic.team
This is hopeless for changing code and then running the game and then seeing how it works.
If I don't do it this way, the program crashses, even in cheat mode.
Is there a better way, where I could just change the code and then start the game?
That is, how can I unzip all the *.tea? files, and then modify them as I wish, and then simply run the program. I used to be able to do this on earlier betas.
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 4:57 am
by phantomglider
One thing you could do is make an addon, copy everything you want to change over to the proper overload folder, and then edit them there.
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 5:43 am
by jenx
ok - I"m modifying at this stage damage_types.lua and Actor.lua. Can you explain how to do this in more detail?
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 6:09 am
by phantomglider
If you download an addon from the site, it should be a .teaa file. You can unzip this into a folder (in the game/addons folder), which you can rename and edit to make a new addon without having to make everything from scratch. The
Darkwood UI is probably a good base for you. If you go looking through the addon's folder, you can see its structure. The important parts for you are the init.lua and the overload folder (which, as it happens, are all that Darkwood UI has).
The init.lua should tell you the addon's name, information, and what kinds of additional stuff to load it has. You'll want to edit this file to have your new addon's information; the Darkwood UI should have the proper setting for the overload, superload, hooks, and data variables.
The overload folder has a list of files that replace the module's default files. For example, whenever the game wants to load the image \data\gfx\ui\playerframe\back.png, Darkwood UI says "hey, I have an image at \overload\data\gfx\ui\playerframe\back.png, go load that instead." All you have to do is remove the Darkwood UI overload files and put in the files you want to change. (in your case, damage_types.lua and Actor.lua) Make sure to replicate their directory path so the game knows which damage_types.lua and Actor.lua to replace.
Addons should work even when they are unzipped, so after you go make your own testbed addon you won't need to zip it to test it out, I don't think.
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 11:46 am
by PureQuestion
Personally, I just told my computer to open .team files with Winrar.
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 12:50 pm
by jenx
Thanks, I got this to work. I've started working on my first add on.
Re: How do I modify and test code?
Posted: Sun Apr 22, 2012 9:04 pm
by lukep
Doesn't it work to run it straight from the folder (instead of the .teaa file)?
Although, creating a custom addon is better, and it definitely works without compressing it.