Control type dropdown issue

Avantar
17 Dec 2013, 17:58I am adding a dropdown control type for an attribute called weapon type and it looks like this:
When I try to run the game the following error:
System.Exception: Unknown source list for dropdown
at TextAdventures.Quest.EditorControls.DropDownControl.m_helper_Initialise()
at TextAdventures.Quest.EditorControls.ControlDataHelper`1.DoInitialise(EditorController controller, IEditorControl definition)
at TextAdventures.Quest.EditorControls.ElementEditor.InitialiseEditorControl(IEditorControl ctl)
at TextAdventures.Quest.EditorControls.ElementEditor.AddControlToGrid(Grid grid, IEditorControl ctl, Boolean firstControl)
at TextAdventures.Quest.EditorControls.ElementEditor.InitialiseTab(IEditorTab tab)
at TextAdventures.Quest.EditorControls.ElementEditor.Initialise(EditorController controller, IEditorDefinition definition)
at TextAdventures.Quest.WPFElementEditor.Initialise(EditorController controller, IEditorDefinition definition)
at TextAdventures.Quest.Editor.AddEditor(String name)
at TextAdventures.Quest.Editor.SetUpEditors()
at TextAdventures.Quest.Editor._Closure$__1._Lambda$__4()
Not sure why it says unknown source list - there shouldn't be a source list. I have taken this from the wiki:
http://quest5.net/wiki/More_on_Tabs_%28Advanced%29
What am I doing wrong.
Please be so kind and help me.
<control>
<controltype>dropdown</controltype>
Weapon Type
<attribute>weapon_type</attribute>
<validvalues type="list">Dagger;Arming Sword;Short Sword;Long Sword;Great Sword;Handaxe;Battleaxe;Greataxe;Light Flail;Heavy Flail;Light Mace;Heavy Mace;Short Bow;Long Bow</validvalues>
<freetext/>
</control>
When I try to run the game the following error:
System.Exception: Unknown source list for dropdown
at TextAdventures.Quest.EditorControls.DropDownControl.m_helper_Initialise()
at TextAdventures.Quest.EditorControls.ControlDataHelper`1.DoInitialise(EditorController controller, IEditorControl definition)
at TextAdventures.Quest.EditorControls.ElementEditor.InitialiseEditorControl(IEditorControl ctl)
at TextAdventures.Quest.EditorControls.ElementEditor.AddControlToGrid(Grid grid, IEditorControl ctl, Boolean firstControl)
at TextAdventures.Quest.EditorControls.ElementEditor.InitialiseTab(IEditorTab tab)
at TextAdventures.Quest.EditorControls.ElementEditor.Initialise(EditorController controller, IEditorDefinition definition)
at TextAdventures.Quest.WPFElementEditor.Initialise(EditorController controller, IEditorDefinition definition)
at TextAdventures.Quest.Editor.AddEditor(String name)
at TextAdventures.Quest.Editor.SetUpEditors()
at TextAdventures.Quest.Editor._Closure$__1._Lambda$__4()
Not sure why it says unknown source list - there shouldn't be a source list. I have taken this from the wiki:
http://quest5.net/wiki/More_on_Tabs_%28Advanced%29
What am I doing wrong.
Please be so kind and help me.


jaynabonne
17 Dec 2013, 19:42The bare "Weapon Type" looks odd to me. Do you mean:
?
Edit: Yes, the Wiki page has a problem. In the source, there are "caption" tags around those strings, but the Wiki itself is swallowing them. So add them yourself as shown above.
<caption>Weapon Type</caption>
?
Edit: Yes, the Wiki page has a problem. In the source, there are "caption" tags around those strings, but the Wiki itself is swallowing them. So add them yourself as shown above.

jaynabonne
17 Dec 2013, 19:48I've fixed the Wiki page.

Avantar
17 Dec 2013, 20:38Thank you, Jaynabonne.
Thing is; I have tried it with <caption></caption> tags.
I still get the same error with the following control type:
It still wants a source for the list?
If I use a text type or basically any other type - it seems to be fine. Even dropdowntypes work. Something I am missing in what I am typing.
I have uploaded my tab library..maybe something else wrong in there, but everything work except for adding the dropdown control type.
Thing is; I have tried it with <caption></caption> tags.
I still get the same error with the following control type:
<control>
<controltype>dropdown</controltype>
<caption>Weapon Type</caption>
<attribute>weapon_type</attribute>
<validvalues type="list">Comedy;Educational;Fantasy;Historical</validvalues>
<freetext/>
<mustinherit>weapon</mustinherit>
</control>
It still wants a source for the list?
If I use a text type or basically any other type - it seems to be fine. Even dropdowntypes work. Something I am missing in what I am typing.
I have uploaded my tab library..maybe something else wrong in there, but everything work except for adding the dropdown control type.
HegemonKhan
18 Dec 2013, 05:57as Jayna already pointed out:
you need the " <caption>(the tab's label-"name" as seen in the GUI~Editor)</caption> " tags. I actually made the same mistake myself, when I was briefly trying to understand magic+equipment through Pixie's libraries~guides. I should have known that it was missing the tags, as code requires the tags for the quest engine~computer to recognize and act upon it. I guess it hasn't been corrected since I messed up on it way back when, as you made the same mistake as I had done "long ago" (1/2 year to 1 year ago), only just now being corrected by Jayna (if I had the time, I would add and fix things with the wiki, but I'm just too busy in real life right now to help with fixing up and adding to the wiki).
Oops, just read Jayna's post, I forgot this as well (my bad about saying it hasn't been corrected, that's totally incorrect!):
it's a problem with the wiki, so it's not that it hasn't been correct in the wiki, but the wiki messes up the wiki post of the code, not showing the "caption" tags.
------------------------------------
I just noticed another quick problem (we'll see if this fixes the problem~s you are having entirely or not) that you have:
you used the "list" TYPE attribute (the "tab" section of the wiki hasn't been updated to the new syntax~format ~ not your fault, Avantar). this was a very early syntax for earlier quest versions, but it's no longer useable now.
"list" = was a code-shortened-and-understood-by-quest form of "stringlist" (as opposed to using an "objectlist")
"dictionary" = was a code-shortened-and-understood-by-quest form of "stringdictionary" (as opposed to using an "objectdictionary" or "scriptdictionary")
Incorrect: <validvalues type="list">Comedy;Educational;Fantasy;Historical</validvalues>
Incorrect: <validvalues type="dictionary">Comedy=blah_1;Educational=blah_2;Fantasy=blah_3;Historical=blah_4</validvalues>
So, instead, type this in, instead of "list" (or "dictionary"):
type="simplestringlist"
type="simplestringdictionary"
Correct: <validvalues type="simplestringlist">Comedy;Educational;Fantasy;Historical</validvalues>
Correct: <validvalues type="simplestringdictionary">Comedy=blah_1;Educational=blah_2;Fantasy=blah_3;Historical=blah_4</validvalues>
----------
otherwise, if you don't use this (type="simplestringlist", or: type="simplestringdictionary") form, you've got to code it in the new-consistant long-form way:
http://quest5.net/wiki/Stringlist
and, for stringdictionaries:
----------------------------
unfortunately, when you start~play your game file, it will convert your "shortened" (horizontal format) "simplestringstringlist" or "simplestringdictionary" to the "elongated" (vertical format) automatically, so if you want to keep this "shortened" format unchanged for copying and pasting... have it placed in a separate document~file, such as that of a "library" file, or you could just use notepad (.txt) file too, if you don't want to mix up what are your actual library files with just your own notes~backup of info~data of code.
----------------------------
lastly, do note that the "simple..." format is ONLY for *STRING* lists~dictionaries, and NOT for "Object" lists~dictionaries, or nor for "Script" dictionaries. These you have to (can only) use the elongated (vertical) code format for them.
----------------------------
here's the documentation of the change in syntax~format from v5.3 to v5.4+:
http://quest5.net/wiki/Stringlist
http://quest5.net/wiki/Stringdictionary
--------------------------
if this doesn't fix your problems, then you've got some other error in your "tab" code and~or also within the rest of your game code (make sure your attributes actually exist, you created~added them onto their objects, for the "tab" code to be able to act upon them, and thus no error due to them not existing).
you need the " <caption>(the tab's label-"name" as seen in the GUI~Editor)</caption> " tags. I actually made the same mistake myself, when I was briefly trying to understand magic+equipment through Pixie's libraries~guides. I should have known that it was missing the tags, as code requires the tags for the quest engine~computer to recognize and act upon it. I guess it hasn't been corrected since I messed up on it way back when, as you made the same mistake as I had done "long ago" (1/2 year to 1 year ago), only just now being corrected by Jayna (if I had the time, I would add and fix things with the wiki, but I'm just too busy in real life right now to help with fixing up and adding to the wiki).
Oops, just read Jayna's post, I forgot this as well (my bad about saying it hasn't been corrected, that's totally incorrect!):
it's a problem with the wiki, so it's not that it hasn't been correct in the wiki, but the wiki messes up the wiki post of the code, not showing the "caption" tags.
------------------------------------
I just noticed another quick problem (we'll see if this fixes the problem~s you are having entirely or not) that you have:
you used the "list" TYPE attribute (the "tab" section of the wiki hasn't been updated to the new syntax~format ~ not your fault, Avantar). this was a very early syntax for earlier quest versions, but it's no longer useable now.
"list" = was a code-shortened-and-understood-by-quest form of "stringlist" (as opposed to using an "objectlist")
"dictionary" = was a code-shortened-and-understood-by-quest form of "stringdictionary" (as opposed to using an "objectdictionary" or "scriptdictionary")
Incorrect: <validvalues type="list">Comedy;Educational;Fantasy;Historical</validvalues>
Incorrect: <validvalues type="dictionary">Comedy=blah_1;Educational=blah_2;Fantasy=blah_3;Historical=blah_4</validvalues>
So, instead, type this in, instead of "list" (or "dictionary"):
type="simplestringlist"
type="simplestringdictionary"
Correct: <validvalues type="simplestringlist">Comedy;Educational;Fantasy;Historical</validvalues>
Correct: <validvalues type="simplestringdictionary">Comedy=blah_1;Educational=blah_2;Fantasy=blah_3;Historical=blah_4</validvalues>
----------
otherwise, if you don't use this (type="simplestringlist", or: type="simplestringdictionary") form, you've got to code it in the new-consistant long-form way:
http://quest5.net/wiki/Stringlist
<mylist type="list">
<value>one</value>
<value>two</value>
<value>three</value>
</mylist>
and, for stringdictionaries:
<statusattributes type="stringdictionary">
<item>
<key>turns</key>
<value>You have taken ! turns</value>
</item>
<item>
<key>health</key>
<value>Health !%</value>
</item>
</statusattributes>
----------------------------
unfortunately, when you start~play your game file, it will convert your "shortened" (horizontal format) "simplestringstringlist" or "simplestringdictionary" to the "elongated" (vertical format) automatically, so if you want to keep this "shortened" format unchanged for copying and pasting... have it placed in a separate document~file, such as that of a "library" file, or you could just use notepad (.txt) file too, if you don't want to mix up what are your actual library files with just your own notes~backup of info~data of code.
----------------------------
lastly, do note that the "simple..." format is ONLY for *STRING* lists~dictionaries, and NOT for "Object" lists~dictionaries, or nor for "Script" dictionaries. These you have to (can only) use the elongated (vertical) code format for them.
----------------------------
here's the documentation of the change in syntax~format from v5.3 to v5.4+:
http://quest5.net/wiki/Stringlist
http://quest5.net/wiki/Stringdictionary
--------------------------
if this doesn't fix your problems, then you've got some other error in your "tab" code and~or also within the rest of your game code (make sure your attributes actually exist, you created~added them onto their objects, for the "tab" code to be able to act upon them, and thus no error due to them not existing).

Avantar
18 Dec 2013, 06:45Fantastic!!
Thank you, thank you, thank you!!!
This fixed it: <validvalues type="simplestringlist">
Thank you, thank you, thank you!!!
This fixed it: <validvalues type="simplestringlist">
HegemonKhan
18 Dec 2013, 07:17chuckles, if I understand this stuff right, Alex doesn't have input validation, ie error exception handling, built into this aspect of quest's coding, as I think you're seeing the actual code of the quest engine trying to work on (your incorrect syntax of) "list", through the error message, which confuses people (who don't know coding~programming at all) in what is wrong with what they have with their code line(s).
Input Validation ~ Error Exception Handling, would give you a message like:
if (Name_Attribute_of_Thing type <> "simplestringlist") {
-> msg ("That is the wrong syntax, please type in the syntax correctly for quest to be able to work ~ act upon this code of yours")
}
but, instead you're seeing the actual code~processii of how quest tries to handle~run your code input. This is a big deal for security and thus for software coders, such as OS (operating systems, ie: windows 7), as hackers can take advantage of this, using it to get control of a user's computer. Email too, networking~routers~ports~firewalls~IPS~IDS, and etc, lots of coding areas~methods that must be protected from: SQL injections, Command Line injections, XSS, and etc.
----------------
a huge chunk of programming is coding for input validation ~ error exception handling, as every wrong input by the user has to be accounted for, that's why software has so many patches (and tens of millions of code lines ~ well for OS' at least), to block these openings for hackers, and why patching~updating your applications~software, OS software, and etc computer stuff, is so important.
-------------
here's an example of a (lack of) an in-game error exception handling:
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <age type="int">0</age>
</object>
<function name="age_character_creation_function">
-> msg ("What is your age?")
-> msg ("Please type in a number value")
-> get input {
->-> // (but, the user types in: "twenty years old", instead of a number value)
->-> player.age = result
-> }
</function>
this would produce an error, as "player.age" is set to being an "integer" type, whereas the user's input is that of a "string" type.
It's a real pain to code in all these exceptions... and not easy to code either, as well... lol (at least for me).
ya, it's easiest to assume~hope, that someone will type in a number value ("20"), but what if they don't? You need to have code to address this problem, especially from a security standpoint, to prevent~block the actual program coding processii from being revealed~shown, as it tries to search for a way to act upon the user's invalid input.
-------------
here's what the (quasi) code should look like:
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <age type="int">0</age>
</object>
<function name="age_character_creation_function">
-> msg ("What is your age?")
-> msg ("Please type in a number value")
-> get input {
->-> // (but, the user types in: "twenty years old", instead of a number value)
->-> if (contains (result, "a,b,c,...,z, !, @, and etc non-numerical symbols") {
->->-> msg ("Use numerical symbols ~ number values, only please!")
->->-> age_character_creation_function // this code line calls upon this function again (they have to do it over again)
->-> } else if (contains ( - ..., -100, - ..., -1, 0, 1, ..., 100, ...) {
->->-> player.age = result
->-> }
-> }
</function>
Input Validation ~ Error Exception Handling, would give you a message like:
if (Name_Attribute_of_Thing type <> "simplestringlist") {
-> msg ("That is the wrong syntax, please type in the syntax correctly for quest to be able to work ~ act upon this code of yours")
}
but, instead you're seeing the actual code~processii of how quest tries to handle~run your code input. This is a big deal for security and thus for software coders, such as OS (operating systems, ie: windows 7), as hackers can take advantage of this, using it to get control of a user's computer. Email too, networking~routers~ports~firewalls~IPS~IDS, and etc, lots of coding areas~methods that must be protected from: SQL injections, Command Line injections, XSS, and etc.
----------------
a huge chunk of programming is coding for input validation ~ error exception handling, as every wrong input by the user has to be accounted for, that's why software has so many patches (and tens of millions of code lines ~ well for OS' at least), to block these openings for hackers, and why patching~updating your applications~software, OS software, and etc computer stuff, is so important.
-------------
here's an example of a (lack of) an in-game error exception handling:
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <age type="int">0</age>
</object>
<function name="age_character_creation_function">
-> msg ("What is your age?")
-> msg ("Please type in a number value")
-> get input {
->-> // (but, the user types in: "twenty years old", instead of a number value)
->-> player.age = result
-> }
</function>
this would produce an error, as "player.age" is set to being an "integer" type, whereas the user's input is that of a "string" type.
It's a real pain to code in all these exceptions... and not easy to code either, as well... lol (at least for me).
ya, it's easiest to assume~hope, that someone will type in a number value ("20"), but what if they don't? You need to have code to address this problem, especially from a security standpoint, to prevent~block the actual program coding processii from being revealed~shown, as it tries to search for a way to act upon the user's invalid input.
-------------
here's what the (quasi) code should look like:
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <age type="int">0</age>
</object>
<function name="age_character_creation_function">
-> msg ("What is your age?")
-> msg ("Please type in a number value")
-> get input {
->-> // (but, the user types in: "twenty years old", instead of a number value)
->-> if (contains (result, "a,b,c,...,z, !, @, and etc non-numerical symbols") {
->->-> msg ("Use numerical symbols ~ number values, only please!")
->->-> age_character_creation_function // this code line calls upon this function again (they have to do it over again)
->-> } else if (contains ( - ..., -100, - ..., -1, 0, 1, ..., 100, ...) {
->->-> player.age = result
->-> }
-> }
</function>