More suggestions...

For help with creating games using Quest

Moderators: Pertex, Alex, sgreig, Cryophile

Re: More suggestions...

Postby The Pixie » Sat Aug 06, 2011 4:19 pm

Occasionally I get this error:
Code: Select all
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at AxeSoftware.Quest.EditorControls.WFEditorTree.AddNode(String key, String text, String parentKey, Nullable`1 foreColor, Nullable`1 backColor, Nullable`1 position)
   at AxeSoftware.Quest.Editor.m_controller_AddedNode(String key, String text, String parent, Boolean isLibraryNode, Nullable`1 position)
   at AxeSoftware.Quest.EditorController.AddElementToTree(Element o, Nullable`1 position)
   at AxeSoftware.Quest.EditorController.UpdateTree()
   at AxeSoftware.Quest.EditorController.Initialise(String filename, String libFolder)
  ...

It would be helpful if it stated the key it could not find, so I could search for it, and correct my XML.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Alex » Sat Aug 06, 2011 5:21 pm

What causes the error?
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby The Pixie » Sat Aug 06, 2011 8:31 pm

When an XML element has an unknown value for the name attibute, say for inherit, I think will do it.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby The Pixie » Tue Aug 09, 2011 6:57 am

A couple more minor suggestions:

Consistency in case sensitivity for function names. Most names seem to be insentitive, but a few, such as destroy, are not (I would prefer to use Destroy than destroy, so all function names are in title case, to differentiate from variables).

When in code view, pressing crtl-F opens up the search box. Would be nice if it moved the cursor there too. This seems to happen if the search box is already open, but in that case it would be nice if the existing search text was highlighted.

Some clues about where a syntax error might be. The system sometimes goves a line number, but it is usually line 1; even if it just said the function of object name, this would be helpful.

Also, suppurt for comments in the GUI (they can already go in the XML). In particular, functions would benefit from the ability to add a comment at the top. As functions are often CDATA, and comments must be outside the CDATA, I think that would restrict you to one comment as at the top of each script.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Alex » Tue Aug 09, 2011 8:42 am

"destroy" is not a function, it's a script command.

Functions are capitalised "LikeThis", and script commands are capitalised "like this".

This is the same convention typically used in C# code (script commands are like keywords).

I would treat everything as case sensitive. In fact I'd say case insensitivity is a bug as far as scripting goes (though FLEE may have other ideas, so I'm not sure how well this applies to expressions).

I agree it would be nice for Ctrl+F to set focus to the text box - I couldn't get it to work though. Focussing in WPF is a pain sometimes. If anybody wants to have a look into this, be my guest!

Syntax errors usually come from FLEE - each expression is compiled individually which is why the line is always 1. Logged http://quest.codeplex.com/workitem/864 for more error information.

Logged http://quest.codeplex.com/workitem/865 for script comments.
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby The Pixie » Tue Aug 09, 2011 11:17 am

I had totally missed the distinction between functions and script commands. Okay, could I then suggest that the script commands listed on these pages all be in lower case, and on the second page, a note added to explain this is consistent.

http://quest5.net/wiki/Category:Script_Commands
http://quest5.net/wiki/Category:All_Functions

I was doing XML comments by the way; these do survive the editor. It wuld just be nice to see them in thr GUI.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Alex » Tue Aug 09, 2011 12:05 pm

I agree, I think the Script Commands should be removed from the "All Functions" category... it wasn't my addition, and I don't really fancy going through them all to remove the category entry from each item... sigh.
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby The Pixie » Tue Aug 09, 2011 1:25 pm

I think it is useful having them on the same page, but perhaps in two sections. I refer to that page a lot. I will modify it that way myself if you would like.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Alex » Tue Aug 09, 2011 2:24 pm

The Category pages are automatically generated based on pages that have that have category tag, so you can't split it into two sections... unless there is such a thing as a sub-category, which may be the case. I don't know - MediaWiki has a lot of hidden depths. I'm happy for you to organise it this way if you can!
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby Pertex » Tue Aug 09, 2011 2:34 pm

Alex wrote:I agree, I think the Script Commands should be removed from the "All Functions" category...


No I do not agree with that. I added the "All Functions" category because I had to click through different pages to find a function or a command. Mostly I do know a piece of the name of a command or function so I find the right thing on this all-page really quick.
User avatar
Pertex
 
Posts: 1099
Joined: Fri Jul 09, 2010 9:52 am
Location: germany

Re: More suggestions...

Postby The Pixie » Tue Aug 09, 2011 2:43 pm

Pertex wrote:I added the "All Functions" category because I had to click through different pages to find a function or a command. Mostly I do know a piece of the name of a command or function so I find the right thing on this all-page really quick.

I agree. However, if I see an entry for "Destroy", then I am going to think that it should be in title case, and comment when Quest objects.

So how about changing the script commands to lower case on the relevant pages, will Wiki Media then update this page to show them in lower case? The title of the page can become All Functions and Script Commands, with a note at the bottom that functions are title case, script commands are lower case.


On a slightly related note, what is the deal with "Dictionary add"? Is that a function and a script command?
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Alex » Tue Aug 09, 2011 4:00 pm

MediaWiki seems to like having all entries with an initial capital letter - even e e cummings on WikiPedia doesn't get special treatment, he has to have a capital letter too - http://en.wikipedia.org/wiki/E_e_cummings
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby Alex » Tue Aug 09, 2011 4:01 pm

"dictionary add" is just a script command - is there anywhere that says otherwise?
User avatar
Alex
Site Admin
 
Posts: 2085
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: More suggestions...

Postby The Pixie » Wed Aug 10, 2011 8:37 am

Er, it starts with a capital in the Wiki...

I am coming round to thinking that all functions should have just functions and not script commands. I have added a comment to the script commands page that they should be lower case, but I wonder if a further note about the difference between script commands and functions is desirable. It is not somethig I was aware of until this discussion.
The Pixie
 
Posts: 391
Joined: Mon Aug 01, 2011 7:43 am

Re: More suggestions...

Postby Pertex » Wed Aug 10, 2011 2:36 pm

I dont understand the problem. This category should only view all functions or command or something else that can be used for scripting. Perhaps you want to rename it to "Glossary" or something. Then you can create a new category "all functions" with really only functions in it. And if you dont want to use "All functions" in the meantime you still can use the other links to the functions.

"(NB script commands should be in all lower case)" What does NB mean?
User avatar
Pertex
 
Posts: 1099
Joined: Fri Jul 09, 2010 9:52 am
Location: germany

PreviousNext

Return to Quest Forum

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest