You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


/!\ We are moving to a new board. Come join us. This board will go into read-only mode on 20.06. /!\

21

Wednesday, May 13th 2015, 10:24am

You can use this tool to extract the *.fdb files. For addon development you should mostly be interested in the contents of the file "<RoM Folder>/fdb/interface.fdb" (the *.xml and *.lua files are located in interface/worldxml/ and so is ui.xsd)

What it doesn't do however is fill in the values like relativeTo = "UIParent" where do I find all this info? what are my options?
UIParent is the name of a frame provided by the default RoM interface, and in most cases is used as the default parent frame for other frames (unless you specifically want another parent frame). You can find its definition in interface/worldxml/uiparent.xml (if you have extracted the files as mentioned above). Generally, however, if you find an unknown frame name you should be able to find its definition either inside one of the *.xml or *.lua files either in interface/worldxml/ (from interface.fdb) or "<RoM Folder>/interface/addons/" (where your addons are installed)
Mithrandir - Warden/Warrior/Scout/Druid 95/95/95/87 (Dochas) - yes, I'm german :P
Creator of RaidHeal (Curse)

22

Wednesday, May 13th 2015, 2:12pm

You can use this tool to extract the *.fdb files. For addon development you should mostly be interested in the contents of the file "<RoM Folder>/fdb/interface.fdb" (the *.xml and *.lua files are located in interface/worldxml/ and so is ui.xsd)

Quoted from "danielrayment" What it doesn't do however is fill in the values like relativeTo = "UIParent" where do I find all this info? what are my options? UIParent is the name of a frame provided by the default RoM interface, and in most cases is used as the default parent frame for other frames (unless you specifically want another parent frame). You can find its definition in interface/worldxml/uiparent.xml (if you have extracted the files as mentioned above). Generally, however, if you find an unknown frame name you should be able to find its definition either inside one of the *.xml or *.lua files either in interface/worldxml/ (from interface.fdb) or "<RoM Folder>/interface/addons/" (where your addons are installed)




thank you.

I have the tool and have copied the interface.fdb file into the same path as the tool, but I can't seem to make it extract the files. if you can give me the command for it that be great. the -? help options descriptions are pretty useless (long time no use dos command prompt ie took me like 10 mins to remember DIR command). Maybe I am missing bracket or quotes I have no idea I have tried several commands including FDB_ex2 -i interface.fdb ( < hoping that would just extract all the files). All I get is the ? printout.


EDIT
still would like to know ^, but not overly important I found the windows version extractor does wonderful things FDB_Extractor2.

This post has been edited 1 times, last edit by "danielrayment" (May 13th 2015, 3:03pm)


23

Monday, May 18th 2015, 3:03pm

Still waiting on the books but figured an easier way to call the garbage collection methods perfectly with my limited knowledge of hello world apps. Just calling the method within my hello world function after the call to the default frame. No buttons, GUI, XML complications needed. type /fle -> calls the method.

24

Monday, May 18th 2015, 5:36pm

Ok so XML is ticking me off perhaps someone can add something to why this basic hello world code doesn't do OnLoad, OnEvent calls. I am mimicking other peoples code but with a little of my own flavour. I know most peoples code would call OnLoad like Applet.OnLoad(this) but Applet:OnLoad() < same thing.

if I use the /flec command the message function prints fine, code is the same thing (except for the "Loaded" .. ) as in the OnEvent() call so the on event call must not be getting called.

Flecia.TOC --

## Title: Flecia
## Version: 0.1
## Notes: printf("hello world")
## Author: DwR

Flecia.lua
Queldown.lua
Flecia.xml

-- Flecia.TOC


Queldown.lua is an empty file for now.

Flecia.xml ---

<?xml version="1.0" encoding="utf-8"?>
<Ui xmlns="http://www.runewaker.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.runewaker.com/UI.xsd">
<Script file ="Flecia.lua"/>

<Frame name="Applet_Frame" parent="UIParent">

<Scripts>
<OnLoad> Applet:OnLoad(); </OnLoad>
<OnEvent> Applet:OnEvent(event); </OnEvent>
</Scripts>

</Frame>


</Ui>
-- Flecia.xml



-- Flecia.lua

local Applet = {
-- struct App
["App"] = { Programmer = "DwR"; Name = "Queldown"; Version = 1.0; };
}

function Applet:GetProgrammer()
return self.App.Programmer;
end

function Applet:GetName()
return self.App.Name;
end

function Applet:GetVersion()
return self.App.Version;
end


function Applet:OnLoad()
this:RegisterEvent("APPLET_LOADED");
end

function Applet:OnEvent(event)
if event=="APPLET_LOADED" then
DEFAULT_CHAT_FRAME:AddMessage( "Loaded " .. Applet:GetProgrammer() .. "; " .. Applet:GetName() .. Applet:GetVersion() );
return;
end
end



-- Set the environment variable global so other modules can access the data.
_G.Flecia = Applet;
SLASH_Flecia1 = "/flec";

SlashCmdList["Flecia"] = function(editBox, msg)
DEFAULT_CHAT_FRAME:AddMessage( Applet:GetProgrammer() .. "; " .. Applet:GetName() .. Applet:GetVersion() );
collectgarbage();
end

-- Flecia.lua

This post has been edited 1 times, last edit by "danielrayment" (May 18th 2015, 7:27pm)


Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

25

Tuesday, May 19th 2015, 12:43am

The event doesn't fire because APPLET_LOADED is not a RoM event. Remember, the game fires events and it is your responsibility to tell the game which ones you are interested in. Since APPLET_LOADED isn't a RoM event, it will never be fired.
2013... The year from hell....

26

Tuesday, May 19th 2015, 1:28am

The event doesn't fire because APPLET_LOADED is not a RoM event. Remember, the game fires events and it is your responsibility to tell the game which ones you are interested in. Since APPLET_LOADED isn't a RoM event, it will never be fired.



Good to know. I am so used to having to make my own events for multithreading and other stuff. I figured from reading the code it was there own event creations. However, I renamed APPLET_LOADED to VARIABLES_LOADED and still do not get the results I am looking for. The addons that I grab this code from all printout some text as you load the game. Seems like OnLoad is still not getting called.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

27

Tuesday, May 19th 2015, 12:51pm

In your XML file, you use Applet as the variable name, but that is declared as local in you Lua file. Change the XML file so that it uses this or self (can't remember which at the moment.

Also, in the future, please use code tags when posting your code as it makes things much easier to read.
2013... The year from hell....

28

Tuesday, May 19th 2015, 5:01pm

The code printout above is just "starting out" gobby guke stuff. There is nothing there that should need explaining to someone that has successfully created addons in the past. Aside from Applet's (simplistic starting out ) class interface functions there is very little that will be carried over into my real code. I am just trying to make the thing work first before I start building my Applet class. That and I need Lua's book to arrive so I can pure understand how to make the metatables work with inheritance and mimic other wonderful C++ stuff.

I have however made some programming progress thanks to you (peryl) and hoff. Also finding the right addon samples that think a lot like I do. Problem number one why I hate looking at other people code! No offense to anyone whose code makes no sense as I am sure my coding doesn't always make sense to others either. While I haven't been able to test the new code just yet I am feeling confident that it will work or just need minor tweeking to work. If it doesn't work I may throw my computer out the door, or just quit with the addon coding all together. ( XML / Rogue Rage )

There is still much to learn about RoM's api interface before I can do anything more than Hello World type app so I may send a private message with my email if that's good for you (or you can message me with yours if you like). My code is progressing to the point I wont be posting it any more on this site, mostly because it would then need more documentation for most people to understand.


Thanks for your patience and being helpful (most people on these forums are anything but).

DwR

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

29

Wednesday, May 20th 2015, 10:55am

Well I prefer not giving out my email address, but you can send private messages.
2013... The year from hell....

30

Wednesday, May 20th 2015, 3:58pm

No worries.

For the record the reason OnLoad was not getting called is that it has to have the this parameter.
this is not what I originally thought it was (aka wrapper for : conventions), but most likely a parameter that rom passes in that is a table with the registerevent function among other stuff.

EDIT -- old
I use the dot operator with a this parameter aka -> Applet.OnLoad(this). (Though my code has changed much since then so I don't use Applet name within the XML anymore.

EDIT -- new
I dropped the dot operator for the : and it still works fine. The important stuff is a) "Applet" need to be a global variable|global reference b) OnLoad( param ) param must be there.




Guess I don't have to throw my computer out the window just yet. Though I just might do it anyway ..... see Skill bugs -- Blind Spot thread.

This post has been edited 1 times, last edit by "danielrayment" (May 20th 2015, 5:04pm)


31

Thursday, May 28th 2015, 1:19am

So to follow up the Lua book arrived I read up enough that I could start looking at samples and make more sense of them. Still even with a better understanding of Lua looking at other code can be head scratching.

If there are any C++ programmers out there trying to grasp Lua that want "OOP", but cant grasp how to make it functional through metatables I have now gone through the hassles of learning how to get it working and have a very simple mechanism to make class (table) inheritance functional (though not as epic as C++ it works and its simple). I learned more about this topic at this link (after I read the Lua book) http://lua-users.org/wiki/InheritanceTutorial, then any other website or book could offer.

I have gone through the tutorials (Peryl linked) now and have started the process of getting to where I need to get to. They were helpful once I cleared a few hurdles. I now have a basic applet class for making simple hello world apps display text in a moveable RoM frame. To be improved on as I work on my future projects.


Thanks again to those that were helpful.