Thread: Error with iadd
-
May 22nd, 2016, 06:12 #1
Error with iadd
Hi team,
I have added a new campaign tool called CAS (Command Line Attributes and Skills) for MoreCore. It will allow you to have a library of drag n drop skills / attributes / rolls for use with systems being played on top of MoreCore. Im totally fudging my way thru here but I have the button, the window, the list of skills. I can right click in the window and add a new CAS entry but when I use the iadd button I get an error:
Script Error: [string "campaign/cas_button_new.lua"]:8: attempt to index a nil value
Attachment 14133
I took code from campaign_button_new.lua and template_campaign.xml.
iadd button xml
Code:<template name="button_iadd_cas"> <button_iadd_campaign> <script file="campaign/cas_button_new.lua" /> </button_iadd_campaign> </template>
Code:-- -- Please see the license.html file included with this distribution for -- attribution and copyright information. -- function onButtonPress() if User.isHost() then local node = window.getDatabaseNode().createChild(); if node then local w = Interface.openWindow(class[1], node.getNodeName()); if w and w.name then w.name.setFocus(); end end else local nodeWin = window.getDatabaseNode(); if nodeWin then Interface.requestNewClientWindow(class[1], nodeWin.getNodeName()); end end window.list_iedit.setValue(0); end
Line 8 is:
local node = window.getDatabaseNode().createChild();
Any suggestions?
Happy to post a dropbox link to the whole ruleset...Last edited by damned; May 22nd, 2016 at 09:33.
-
May 22nd, 2016, 07:23 #2
Not an answer to my question above but I just added the ability to export these rolls to a module as part of the inbuilt /export command/utility.
I probably need to change the window to use campaignlistwithtabs instead of the current one but that will have to come later.
Attachment 14135
But in other news - I still need help with the iadd button if anyone has any ideas...
-
May 22nd, 2016, 12:09 #3
Tabs are also working now.
Attachment 14136
But still not the other thing....
-
May 22nd, 2016, 12:47 #4
I think you'll need a Moon Wizard
If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php
-
May 22nd, 2016, 13:13 #5
Hi Chap,
Just fired an email off. If you're struggling - chuck me the ruleset and when I finish being 'Dad' for this afternoon, I'll take a butchers.
CheersRuleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
May 22nd, 2016, 13:35 #6
As I get a Nil result on the window.getDatabaseNode() I think my issue is happening earlier.
Going back to the campaign_cas.xml (new) file where the cas_button_new.lua is being called from Im pretty sure that it wasnt getting the getDatabaseNode() there either as I have specified it manually to get it to work... <datasource>clilist</datasource>
campaign_cas.xml
Code:<?xml version="1.0" encoding="iso-8859-1"?> <!-- Please see the license.html file included with this distribution for attribution and copyright information. --> <root> <template name="button_iadd_cas"> <button_iadd_campaign> <script file="campaign/cas_button_new.lua" /> </button_iadd_campaign> </template> <windowclass name="cassmall"> <margins control="0,0,0,2" /> <!-- come back and fix!!! <script file="campaign/scripts/campaign_list_record.lua" /> --> <sheetdata> <!-- Create Left Anchor --> <genericcontrol name="leftanchor"> <anchored height="0" width="0"> <top offset="2" /> <left /> </anchored> </genericcontrol> <!-- Create Right Anchor --> <genericcontrol name="rightanchor"> <anchored height="0" width="0"> <top offset="2" /> <right /> </anchored> </genericcontrol> <!-- Add Shortcut Button for use with Libraries or to store info --> <linkfield name="shortcut"> <anchored to="leftanchor" width="20" height="20"> <top /> <left anchor="right" relation="relative" offset="4" /> </anchored> <class>ref_attributes</class> <description field="name" /> <readonly /> </linkfield> <!-- Create Field to hold the Roll Info --> <simplestring name="name"> <readonly /> <anchored position="insidetopleft" offset="0,0" height="20"> <left parent="leftanchor" anchor="right" relation="relative" offset="8" /> </anchored> <script> function onEnter() return true; end function onDeleteUp() if isReadOnly() then return; end end </script> </simplestring> <button_idelete name="idelete"> <anchored> <top /> <right parent="rightanchor" anchor="left" relation="relative" offset="-2" /> </anchored> </button_idelete> </sheetdata> </windowclass> <windowclass name="caslist"> <frame>campaignlistwithtabs</frame> <placement> <size width="300" height="400" /> </placement> <sizelimits> <minimum width="300" height="400" /> <dynamic /> </sizelimits> <softclose /> <nodelete /> <sheetdata> <banner_campaign> <icon>title_cas</icon> </banner_campaign> <list_campaign_nofilter name="list"> <datasource>clilist</datasource> <class>cassmall</class> <script> function onDrop(x, y, draginfo) if draginfo.isType("shortcut") then return CampaignDataManager.handleDrop("cassmall", draginfo); end end </script> </list_campaign_nofilter> <scrollbar_list /> <anchor_campaign_nofilter /> <button_iedit_campaign> <script> function onInit() setVisible(true); end </script> </button_iedit_campaign> <button_iadd_cas> <class>cassmall</class> </button_iadd_cas> <categories> <targetcontrol>list</targetcontrol> </categories> <resize_campaignlistwithtabs /> <close_campaignlist /> </sheetdata> </windowclass> </root>
Last edited by damned; May 22nd, 2016 at 14:13.
-
May 22nd, 2016, 14:57 #7
Ok a bit more info for anyone that may look at this while I sleep...
I added the db node clilist in desktop.lua using:
Code:function registerPublicNodes() if User.isHost() then DB.createNode("options").setPublic(true); DB.createNode("partysheet").setPublic(true); DB.createNode("calendar").setPublic(true); DB.createNode("combattracker").setPublic(true); DB.createNode("modifiers").setPublic(true); DB.createNode("effects").setPublic(true); DB.createNode("clilist").setPublic(true); end end
Code:DesktopManager.registerStackShortcut2("button_cas", "button_cas_down", "sidebar_tooltip_cas", "caslist");
<template name="button_iadd_cas">
<windowclass name="cassmall">
<windowclass name="caslist">
And from there on we go back up to the posts at the start of this thread.
Ruleset is here: https://www.dropbox.com/s/yovjrz7c68...eCore.pak?dl=0
Basic, basic dataset here: https://www.dropbox.com/s/gmccywjsrf...leset.zip?dl=0
How to recreate error:
Create a new MoreCore campaign or use MoreCoreRuleset campain.
Open console (/console)
Open CAS from Campaign Tools
Click Edit button and then Add
You will see the Nil result from Debug.console and the resultant FG error message.
-
May 22nd, 2016, 15:13 #8Private 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!
-
May 22nd, 2016, 18:05 #9Ruleset and much more content built for FGU.
Come join me on Twitter at: https://twitter.com/MadBeardMan to see what I'm up to!
-
May 22nd, 2016, 20:06 #10Private 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!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks