PDA

View Full Version : Help with ruleset



dpirate
January 26th, 2009, 22:18
I'm just starting to create my own ruleset and have been looking at the xml and lua files. You know following them as they are loaded and all. As well as the db.xml file in the campaign for this ruleset.

Here is the first of many questions --

I ran accross

"{pc = getDatabaseNode().getParent().getParent().getParen t().getParent()}"

as the last paramter in a function call for this function

ChatManager.Message()

I found the code for the function, but do not know what exactly is returned by the parameter above.

I'm trying to allow a double click on a strigfield that will put the contents of the string in the chatbox. I might also want to add to the string before it is sent to the chatbox. Can someone help me out.

Also, what resources are there for identifying datatypes and their relationships, along with functions defined for them.

Thanks,
dpirate

Valarian
January 27th, 2009, 08:30
"{pc = getDatabaseNode().getParent().getParent().getParen t().getParent()}"
The call gets the current node in the database (db.xml) and goes up four levels within the hierarchy tree.

e.g.


P4 -> pc = this!
+- P3
+- P2
+- P1
+- node


Resources for Lua are in the Library. There's also a Lua reference online.

Oberoten
January 27th, 2009, 09:31
And this explanation into the Wiki Goes. :)

- Obe

dpirate
January 30th, 2009, 01:16
Thanks. So that would put it at the root node of the db.xml? I think I'm understanding if that is correct.

Valarian
January 30th, 2009, 08:31
I don't know where exactly in the code you're looking. From the name given "pc", I would hazard a guess that it's the root node of the character that is being looked for (i.e. id-?????).


I'm trying to allow a double click on a strigfield that will put the contents of the string in the chatbox. I might also want to add to the string before it is sent to the chatbox. Can someone help me out.
There's something similar that throws dice on a double-click (https://www.fantasygrounds.com/forums/showthread.php?t=6015).
You'd need something similar to do what you want. A function in the ChatManager.lua to put the message on the chat window, and a onDoubleClick trigger on the string field.