-
September 3rd, 2019, 00:24 #1
Creating a New List Type/Class/etc
So I've got the need to create a couple of new sets of lists in my ruleset. I'm basing this off the Inventory lists system in CoreRPG, but am stuck due to my lack of coding knowledge.
I starting by duplicating the "<list_charinv", "<button_iedit" & "<button_iadd" sections from "record_char_inventory.xml" to "record_char_main.xml" and editing as follows (and putting them inside a frame);
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>
I then duplicated the "record_char_inventory.xml" file to "record_char_defenses.xml" file and changed the windowclass name as follows;
Code:<windowclass name="ship_defenseitem"> ...
Code:function update() local bEditMode = (window.defenseslist_iedit.getValue() == 1); window.idelete_header.setVisible(bEditMode); for _,w in ipairs(getWindows()) do w.idelete.setVisibility(bEditMode); end end
I added the includefile to base.xml;
Code:<includefile source="campaign/record_char_defenses.xml" />
I added the "list_defense" windowclass template to the "template_char.xml" as follows;
Code:<template name="list_defenses"> <windowlist> <child></child> <child><backcolor>1A40301E</backcolor></child> <datasource>.defenses</datasource> <class>ship_defenseitem</class> <allowdelete /> <script file="campaign/scripts/ship_defenses.lua" /> </windowlist>
Script Error: [string "campaign/scripts/ship_defenses.lua"]:72: attempt to index field 'defenseslist_iedit' (a nil value)
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 3rd, 2019, 01:50 #2
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
LordEntrails,
(window.defenseslist_iedit.getValue() == 1);
should be:
(window.defenselist_iedit.getValue() == 1);
extraneous "s"
-
September 3rd, 2019, 04:19 #3
*lol* Thanks Paul. See I would never make it professionally!
I corrected that, but I'm still getting the error. Entries are created, so that is good (not sure it was doing that before). But the console still throws that error every time I click or add. I'll go back through and check it all and see if I can find whatever mistakes I made.
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 3rd, 2019, 05:09 #4
Use Find in Files and search for:
defenseslist
defenseslist_iedit
_iedit
and see if you can track it down.
-
September 3rd, 2019, 06:16 #5
- Join Date
- Apr 2009
- Location
- Fullerton, CA.
- Posts
- 625
Is the script error still :Script Error: [string "campaign/scripts/ship_defenses.lua"]:72: attempt to index field 'defenseslist_iedit' (a nil value)
or
did it at least change to: Script Error: [string "campaign/scripts/ship_defenses.lua"]:72: attempt to index field 'defenselist_iedit' (a nil value)
?
Just curious. If it changed then we need to figure out why the defenselist_iedit is returning nil and not a value as expected. If it is the same error, then as damned said, there is another misspelling somewhere.
-
September 3rd, 2019, 15:40 #6
Should have clarified. It's the same message except it's now line 73. i.e.
Code:window.idelete_header.setVisible(bEditMode);
Appreciate it
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 4th, 2019, 04:23 #7
I can't figure it out, but I do have a thought that maybe someone can help me figure out.
The error is;
Script Error: [string "campaign/scripts/ship_defenses.lua"]:73: attempt to index field 'idelete_header' (a nil value)
Script Error: [string "campaign/scripts/ship_defenses.lua"]:73: attempt to index field 'idelete_header' (a nil value)
Code:function update() local bEditMode = (window.defenselist_iedit.getValue() == 1); window.idelete_header.setVisible(bEditMode); for _,w in ipairs(getWindows()) do w.idelete.setVisibility(bEditMode); end end
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> <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> <string_charinvname name="nonid_name"> <anchored position="insidetopleft" offset="35,2" height="20"> <right parent="rightanchor" anchor="left" relation="current" offset="-5" /> </anchored> <empty textres="library_recordtype_empty_nonid_item" /> <invisible /> <tabtarget next="location" prev="name" /> </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 4th, 2019, 04:41 #8
When you cant see it in the files you think it is - use find in files
Things like button_idelete have a definition somewhere else - so find in files on that and see what comes up.
And somewhere else might be in your code or in anything it is layered on.
-
September 4th, 2019, 05:27 #9
I did Find in Files, I swear
But I will look again tomorrow to see if I can find where it's defined
Thanks for keeping me pointed in the right direction!
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 4th, 2019, 05:57 #10
lets try another possible tack...
is this your code?
Code:function update() local bEditMode = (window.inventorylist_iedit.getValue() == 1); window.idelete_header.setVisible(bEditMode); for _,w in ipairs(getWindows()) do w.idelete.setVisibility(bEditMode); end end
Debug.chat("bEditMode: ", bEditMode );
at line 73.
is it bEditMode that is nil?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks