-
September 4th, 2019, 06:40 #11
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
LordEntrails,
In the CoreRPG record_char_inventory there is a field idelete_header, in fact there are a few headers. See below.
Code:<genericcontrol name="idelete_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-5" /> </anchored> <disabled /> </genericcontrol> <genericcontrol name="shortcut_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-2" /> </anchored> <disabled /> </genericcontrol> <genericcontrol name="carried_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-5" /> </anchored> <icon>char_inv_carried_header</icon> <tooltip textres="char_tooltip_itemcarried" /> </genericcontrol>
<windowclass name="charsheet_inventory">. Read what follows that. It sets up the window information that will house the list. The headers are contained there. If you have a custom window to display your list in, then add the headers above and should work.
-
September 7th, 2019, 17:37 #12
Thanks, so here's my new code (with line numbers);
Code:71 function update() 72 local bEditMode = (window.defenselist_iedit.getValue() == 1); 73 Debug.chat("bEditMode: ", bEditMode ); 74 window.idelete_header.setVisible(bEditMode); 75 for _,w in ipairs(getWindows()) do 76 w.idelete.setVisibility(bEditMode); 77 end 78 end
s'bEditMode: ' | bFALSE
s'bEditMode: ' | bFALSE
Here's what the console give me when I open a charactersheet;
Script Error: [string "isidentified"]:1: attempt to index field 'nonid_name' (a nil value)
Script Error: [string "campaign/scripts/ship_defenses.lua"]:74: attempt to index field 'idelete_header' (a nil value)
Script Error: [string "campaign/scripts/ship_defenses.lua"]:74: attempt to index field 'idelete_header' (a nil value)
I'll work on what Paul suggested next as I don't quite get what this means or if the debug statement is actually working or is telling us.
Thanks again.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
September 7th, 2019, 17:49 #13
Thanks Paul, I think I understand that part and what you are saying/suggesting. Or atleast I think I know what I need to modify to get the fields I need/want. Not sure I know just what changes to make there yet. If it helps and anyone has time to actually look, I will attached the current version of the ruleset (looks like I will have to restart, 7-Zip is not behaving).
But here's the windowclass that I'm working on defining in the 'record_char_defenses.xml file;
Code:<windowclass name="ship_defenseitem"> <margins control="0,0,0,2" /> <script> function onInit() getDatabaseNode().onDelete = onDelete; end function onDelete(node) ItemManager.onCharRemoveEvent(node); end </script> <sheetdata> <hidden_record_isidentified name="isidentified"><class>item</class><ignorehost /></hidden_record_isidentified> <number_charinv name="count"> <bounds>5,2,20,20</bounds> <tabtarget next="name" /> <default>1</default> </number_charinv> <genericcontrol name="rightanchor"> <anchored width="0" height="0"> <top /> <right /> </anchored> <invisible /> </genericcontrol> <button_idelete name="idelete"> <anchored width="20" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-5" /> </anchored> </button_idelete> <linkcontrol_id name="shortcut"> <anchored width="20" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-2" /> </anchored> <class>item</class> <readonly /> </linkcontrol_id> <button_char_inv_carried name="carried"> <anchored width="20" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-5" /> </anchored> </button_char_inv_carried> <!-- <number_charinv name="weight"> <anchored width="30" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-10" /> </anchored> <delaykeyupdate /> <tabtarget prev="location" /> </number_charinv> --> <number_defenseuses name="uses"> <anchored width="30" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-10" /> </anchored> </number_defenseuses> <string_charinvloc name="location"> <anchored width="80" height="20"> <top offset="2" /> <right parent="rightanchor" anchor="left" relation="relative" offset="-10" /> </anchored> <tabtarget next="weight" prev="nonid_name" /> </string_charinvloc> <string_charinvname name="name"> <anchored position="insidetopleft" offset="35,2" height="20"> <right parent="rightanchor" anchor="left" relation="current" offset="-5" /> </anchored> <tabtarget next="nonid_name" prev="count" /> </string_charinvname> </sheetdata> </windowclass>
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
September 7th, 2019, 20:34 #14
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
LordEntrails,
You should have something like this. I am not sure the layout works, this is from the base CoreRPG
First
Code:<genericcontrol name="idelete_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-5" /> </anchored> <disabled /> </genericcontrol> <genericcontrol name="shortcut_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-2" /> </anchored> <disabled /> </genericcontrol> <genericcontrol name="carried_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-5" /> </anchored> <icon>char_inv_carried_header</icon> <tooltip textres="char_tooltip_itemcarried" /> </genericcontrol>
Code:<list_defenses name="defenselist"> <anchored to="defensesframe"> <top offset="40" /> <left offset="15" /> <right offset="-20" /> <bottom offset="-15" /> </anchored> </list_defenses> <scrollbar> <anchored to="defenselist" /> <target>defenselist</target> </scrollbar> <button_iedit name="defenselist_iedit"> <anchored to="defenselist" position="aboveright" offset="5,10" /> <target>defenselist</target> </button_iedit> <button_iadd name="defenselist_iadd"> <anchored to="defenselist_iedit" position="lefthigh" offset="5,0" /> <target>defenselist</target> </button_iadd>
71 function update()
72 local bEditMode = (window.defenselist_iedit.getValue() == 1);
73 Debug.chat("bEditMode: ", bEditMode );
74 window.idelete_header.setVisible(bEditMode);
75 for _,w in ipairs(getWindows()) do
76 w.idelete.setVisibility(bEditMode);
77 end
It can't find the "idelete_header" in order to setVisible and continue the script. Adding the .xml above should take care of that.
If you are using shortcuts and carried in a similar fashion, then add the carried and shortcut headers above as well or you will get errors too.Last edited by Paul Pratt; September 7th, 2019 at 20:44.
-
September 8th, 2019, 00:49 #15
Thanks Paul. I will investigate and let you know what I find. I finally got back and attached is the ruleset if desired. Will post once I get this resolved or get more info etc.
(edit, file too large. Will figure that out later. Back to coding!)
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
September 8th, 2019, 01:02 #16
So Find In Files shows that idelete_header is defined in 2 locations. Might that be the problem? One is in 'record_char_inventory.xml' and the other in 'record_char_defenses.xml'
Both show the same code;
Code:<genericcontrol name="idelete_header"> <anchored to="rightanchor" width="20" height="20"> <top /> <right anchor="left" relation="relative" offset="-5" /> </anchored> <disabled /> </genericcontrol>
Now I don't really understand the edit mode, but if the value of bEditMode is false, then ...?
Maybe do I need to initialize the value of idelete_header so the console error of a nil value doesn't happen?
I'm going to work on the fields for the frame for now and will get back to this error later (or when someone can point me in another direction or re-point me to what I'm missing!)
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
September 8th, 2019, 05:28 #17
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
LE, I haven't followed this whole discussion, but what Paul is telling you is correct. You cannot rely upon a declaration of idelete_header in another file unless you are using a template, which Idelete_header is not: it is a control in those other two declarations and not a template. Assuming you put Paul's xml into your window xml code, that will define your own idelete_header which you can then reference as your own window control. That should get you in business.
-
September 9th, 2019, 23:09 #18
As has been mentioned - the name of a FG control is unique purely within a specific <sheetdata> section of a windowclass. Only templates can be re-used - and the template name becomes the XML tag of the control within <sheetdata>.
Secondly, if FG is reporting "nil" error, then it means that specific named object (control, variable, etc.) doesn't exist within the scope of the script that is running. What scope does the LUA that raises the error execute with? That is, does it execute within the <windowclass> (the LUA is associated with the windowclass via a <script> entry) or is the scope within a specific control (the <script> entry is within the XML of a control) or outside of the GUI (a global script package)? How/where does the actual code run? Identify where the code is actually running and then look why the code is reporting the "nil" error - in your case this is the code not being able to access a named control, if that named control can't be accessed within the scope of the code then it won't be able to find it, and hence raise the "nil" error.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!
-
September 12th, 2019, 00:08 #19
Thanks all. life has kept me from getting back to this, but what you are all saying makes sense. I'll let you know either way once I do get back to it (probably tomorrow or this weekend).
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks