Thread: Accessing node attributes in Lua
-
March 30th, 2020, 15:59 #1
Accessing node attributes in Lua
Hi folks.
The dev guide is saying "Attributes are not accessible in this manner" (1). Looking if there is another way only brought up age old threads, and examining CoreRPG sourcecode didn't yield anything useful either, so I wanted to ask what the current status on that is: Is there a way to access node attributes in Lua, and if so, how would one go about it?
Cheers!
___
1 https://www.fantasygrounds.com/wiki/...s_from_Scripts
-
March 30th, 2020, 16:17 #2
To be more helpful, what are you attempting to try and access?
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
March 30th, 2020, 17:13 #3
Custom attributes. I know I can interact with a lot of the built in stuff like anchoring for controls etc. via getter and setter. But being able to leave multiple custom parameters for my scripts in a single self closing tag, instead of bloating up my node tree would be nice.
Turning this:
Code:<genericcontrol name="foo"> <param1>These</param> <param2>Are</param> <param3>Parameters</param> </genericcontrol>
Code:<genericcontrol name="" param1="These" param2="Are" param3="Parameters" />
Last edited by Tommycore; March 30th, 2020 at 17:37.
-
March 30th, 2020, 17:44 #4
Depending on the type of element you are using to store data within the code, they may save to the database. I would suggest checking over the reference document for the different element types and how to access them. If the data does get stored to the database, you can use lua to access the node in question. Here is a link for a break down of the code that may assist.
https://www.fantasygrounds.com/refdoc/databasenode.xcpDominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
March 30th, 2020, 23:05 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
Attributes are not converted into Lua variables; only tags are. So, the example in post 3 means that param1, param2 and param3 would not be available as variables within the Lua script.
Regards,
JPG
-
March 30th, 2020, 23:12 #6
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks