Checkbox not working in library

I'm putting together my own library for a questing system which is in its final stages. I'm very new to using the

The function for ending a quest requires a bool, for which I'm trying to use the following control tag

<control>
 <controltype>checkbox</controltype>
 <caption>Quest Failed?</caption>
 <attribute>1</attribute>
</control>

But trying it out in the editor, leaves me with a greyed out box that can't be used and I have no idea why...


"1" isn't a valid attribute name.


In this case it is, since it's for adding a new Function to the visual Programming list and "1" references the second variable for said Function

Aka in the case of

Quest End (Name, Failed)

"1" tells Quest to give the value of the Checkbox to the "Failed" variable, while the here unseen Attribute "0" successfully gives it's String to the "Name" variable.


Alright, it took some digging through files, namely to find the "ShowMenu" function (CoreEditorScriptsOutput.aslx btw), I found out that it should instead look like this:

<control>
  <controltype>expression</controltype>
  <attribute>1</attribute>
  <simpleeditor>boolean</simpleeditor>
</control>

Since checkboxes just seem to plain not work for this type in general. You should also set the corresponding default value to true/false so it doesn't start out on the expression tab.

On top of that, numbers (and likely others) only work if set as:

<control>
  <controltype>expression</controltype>
  <attribute>2</attribute>
  <simple>Number</simple>
  <simpleeditor>number</simpleeditor>
</control>

With a number already set as default (likely 0) to avoid the dreaded expression.

The documentation on library functions should probably be extended a little as the current version only shows a very basic example and tells you a list of controltype tags which plainly do not work if used as instructed.


Thank you for sharing that page!

I either didn't see it before, or was too green to recognize what it was the first time I saw it.

This looks like instructions for how to add our own functions into the GUI for non-coder types to be able to use them.

How to edit the editor itself.

I may be wrong, because I'm still extremely new here and only learning rapidly because of great minds like Pixie and Mrangel who have shared so much.

But it looks to me as if Pixie, for example, could have used these instructions to add a choice in the editor here for something like:

"Add a Conversation Topic"

If you were using ConversationLib.aslx

And if it were set up, a non-coder could click the "+" sign to choose dropdowns and checkboxes, etc. to create a topic object and set attributes.

Or maybe it could be set up to merely modify the attributes of a topic object.

The current solution everyone has been using for their own libraries is making new editor tabs. But these instructions look like how to add those elements directly into the "+" area of the editor itself?

Is that right?


I mean, it looks like if you went into the "CoreEditor.aslx" code, and added this code in the right places... assuming your functions for updating objects are added to the game...

You'd create the ability to use your library for other folks by simply using that "+" box beginners use.


Yeah… it looks like that page is a little confused. The <control> element is used both for adding form fields and checkboxes to the editor for attributes of a custom object; and for adding parameters to functions in the GUI editor; but the structure is quite different. And that page seems to have a significant amount of content which is only correct for the other usage.


Mrangel, you should make some tutorials for us newbies!


Yeah, that's about right from what I gathered, the page seems to try and teach you how to add your own functions to a library, which is what I wanted to do so fair enough. But it then turns around and list off a bunch of things that will just plain not work for functions and are only used for tabs...

And I wasn't really looking to edit the core functions - I only did that to remove "take" from the default verb list so far - I just looked for the "ShowMenu" function to see how a binary choice was handled there!


@ThatGoddess and Mrangel

I just discovered someone called EightOne in the "libraries" forum that seems to have spent a great deal of time making libraries that edit the editor. Since it was relevant to this above conversation, if you're curious to see how his library codes work, they're here https://github.com/8ne/quest_libraries

Or pop on over to the other forum. Here's one that takes two separate editor selections from the dropdown and makes them one that does both in the GUI for the non-coder Quest authors.

So it creates a GUI to enter what you want to have happen to the object and what it should say when that happens with less GUI clicks basically.

https://textadventures.co.uk/forum/samples/topic/e_3ynebweuco1ze6yplpfq/8ne-setobjectcase-1-5-script-add-on-with-which-it-is-possible-to-set-common-o


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums