-
June 22nd, 2018, 05:07 #1
- Join Date
- Nov 2017
- Posts
- 10
Ruleset script accessing module data
In a ruleset (CoreRPG) script, how do I access module data by looking up via record type without already having a record?
-
June 22nd, 2018, 05:22 #2
Info on the database here - see the "database paths" section for details of the difference between data in a module and the base campaign database: https://www.fantasygrounds.com/wiki/...ets_-_Database
Note that you can use a wildcard in the database path - e.g. encounter@* would reference the main encounter node (where Story entries are stored) across all open modules (that's what the @* means). See the Data File Format for details of the main database node names: https://www.fantasygrounds.com/wiki/...ta_File_Format
You need to access the database using the database API. Start here: https://www.fantasygrounds.com/refdoc/DB.xcp
You can find a specific databasenode within the FG structure using DB.findNode: https://www.fantasygrounds.com/refdoc/DB.xcp#findNode
If you need to search through various nodes to find the one you want, you can get all of the children of a specific node with DB.getChildren: https://www.fantasygrounds.com/refdo...cp#getChildren and then iterate through the returned table.
Do a search through some of the main FG rulesets for examples of these API calls.Last edited by Trenloe; June 22nd, 2018 at 05:27.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
June 22nd, 2018, 18:22 #3
- Join Date
- Nov 2017
- Posts
- 10
Thanks for your help. I was able to get the script working.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks