FYI --- Microsoft Copilot can write .aslx files and has found errors

Here are a few errors that Microsoft Copilot has caught. The codebase and the .asxl file are out of date, I didn't use 580 for this, will get that exported eventually, but here is the general result.

ME: Are you famliar with the interactive fiction generator program Quest?

Yes, I'm familiar with Quest! It's a fantastic tool for creating interactive fiction and text adventure games. With Quest, you can build games similar to classics like Zork and The Hitchhiker's Guide to the Galaxy, without needing to know how to program. It offers a visual script editor, so you can pick commands from a list, making it accessible even for beginners2.

You can create games that include text, images, music, and even videos. Plus, it's open-source and free to use, so you can modify the source code and share your creations with others1.

Are you thinking about using Quest to create your own interactive fiction?

I've done so a few times in the past, I'm wondering if you can write scripts for the desktop standalone version. There are certain routines / scripts I want that I don't know how to program myself.
I'd love to help you with that! If you describe the specific routines or scripts you need for your Quest project, I can definitely assist you in crafting them. Whether it's for handling player input, creating complex conditions, or managing inventory, just let me know the details, and we'll get started on writing those scripts together.

What do you have in mind?

This is my part of quest file so far.

 <!--Saved by Quest 5.7.6404.15496--> <asl version="550"> <include ref="English.aslx" /> <include ref="Core.aslx" /> <game name="World Template"> <gameid>1508bec4-6d7d-4fac-b10e-e9a8e2662cc1</gameid> <version>1.1.2</version> <firstpublished>2017</firstpublished> <author>xordevoreaux</author> <attr name="autodescription_description" type="int">2</attr> <attr name="autodescription_youcansee" type="int">3</attr> <attr name="autodescription_youcango" type="int">4</attr> <feature_limitinventory /> <feature_lightdark /> <feature_asktell /> <appendobjectdescription /> <attr name="wt_worldclock_hour" type="int">0</attr> <attr name="wt_worldclock_min" type="int">0</attr> <attr name="wt_worldclock_str" type="string"></attr> <attr name="wt_worldclock_darktime" type="int">20</attr> <attr name="wt_worldclock_lighttime" type="int">6</attr> <attr name="wt_InitError" type="boolean">false</attr> <statusattributes type="stringdictionary"> <item> <key>wt_worldclock_str</key> <value>Time: !</value> </item> </statusattributes> <description><![CDATA[Updated for use for version 5.7 of Quest.<br/>Provides additional functionality for manipulating physical processes:<br/>a) flammability and burning objects<br/>b) fragility and how a fragile item breaks (whether it "shatters" and is removed from the game)<br/>c) a generic book-making function<br/>d) ambience and a sense of time<br/><br/>Manipulatable things fall into one of 3 categories:<br/>wt_obj (object, facilitating flammability, fragility, and books)<br/>wt_env (environment, such as land, sea, or sky, facilitating ambience)<br/>wt_spc (space, existing within an environment).<br/>Do not modify or directly use the object types wt_objmod_burn, wt_objmod_fragility, and wt_objmod_book. They are collections of attributes rolled into the wt_obj mod and separated for the sake of programmability.<br/>]]></description> <setbackgroundopacity type="boolean">false</setbackgroundopacity> <defaultwebfont>Lora</defaultwebfont> <gridmap type="boolean">false</gridmap> <commandpane type="boolean">false</commandpane> <customstatuspane type="boolean">false</customstatuspane> <shadowbox type="boolean">false</shadowbox> <cover>worldtemplateimg.png</cover> <attr name="wt_CurrentBook" type="object">wt_defaultObject</attr> <Home type="object">Area_01</Home> <pov type="object">player</pov> <start type="script"><![CDATA[ game.wt_worldclock_hour = 5 game.wt_worldclock_min = 50 wt_fn_worldclock wt_fn_env // All wt_spc objects must be nested in either another wt_spc or in an wt_env. A top-level wt_spc (whose parent = game) is not allowed. // We loop through all objects. For any space objects, we test that they're properly nested. If not, the game aborts. game.wt_InitError = False foreach (item, AllObjects()) { currentObject = item if (currentObject.name <> "wt_defaultObject" and currentObject.name <> "wt_defaultEnv") { if (HasAttribute(currentObject, "IsWorldSpace")) { if (HasAttribute(currentObject, "parent")) { if (HasAttribute(currentObject.parent, "IsWorldSpace")) { } else if (HasAttribute(currentObject.parent, "IsWorldEnv")) { } else { msg ("<b>Game configuration error:</b>") msg ("Please set the parent for [" + currentObject.name + "] to be either a space or an environment by assigning either the wt_spc or wt_env attribute to the object.") game.wt_InitError = True } } else { msg ("<b>Game configuration error:</b>") msg ("The top-most object in any heirarchy must be an environment, but a non-environment object was detected instead.") msg ("Object: [" + currentObject.name + "]") msg ("<br/><b>Solutions:</b>") msg (" Change it from a space to an environment by removing the wt_spc attribute and <br/> adding the wt_env attribute.") msg (" <br/> Nest it farther down the hierarchy, either in an environment or another space.") game.wt_InitError = True } } } } // We have not found any errors in the configuration, so we can continue with initialization: if (game.wt_InitError=False) { foreach (item, AllObjects()) { if (HasAttribute(item, "IsWorldSpace")) { do (item, "GetEnv") } else if (HasAttribute(item, "IsWorldObject")) { if (item.IsIgnitable=True or item.IsFlammable=True) { item.feature_lightdark = True if (item.lightstrength="") { item.lightstrength = "weak" } } } } } else { msg ("<br/>Game aborted.<br/>") finish } ]]></start> <roomenter type="script"> </roomenter> <object name="wt_defaultObject"> <inherit name="editor_object" /> <inherit name="wt_obj" /> </object> <object name="wt_defaultEnv"> <inherit name="editor_room" /> <inherit name="wt_env" /> <EnvironmentName>Default</EnvironmentName> </object> </game> <command name="lookat"> <pattern>look at #object#; x #object#; examine #object#; exam #object#; ex #object#</pattern> <script> if (GetBoolean(object, "hidechildren")) { object.hidechildren = false } if (TypeOf(object, "look") = "script") { do (object, "look") } else { lookdesc = "" if (HasString(object, "look")) { lookdesc = object.look } if (LengthOf(lookdesc) = 0) { lookdesc = Template("DefaultObjectDescription") } if (GetBoolean(object, "switchedon")) { if (HasString(object, "switchedondesc")) { lookdesc = lookdesc + " " + object.switchedondesc } } else { if (HasString(object, "switchedoffdesc")) { lookdesc = lookdesc + " " + object.switchedoffdesc } } isDark = CheckDarkness() if (isDark and not GetBoolean(object, "lightsource")) { lookdesc = DynamicTemplate("LookAtDarkness", object) } msg (lookdesc) } ListObjectContents (object) if (HasAttribute(object, "IsWorldObject")) { if (object.IsBroken=true) { msg ("The " + object.alias + " appears broken.") } else if (object.IsBroken=False and object.IsFragile=True) { msg ("The " + object.alias + " appears fragile.") } if (object.IsIgnitable = True and object.IsBurning = False) { msg ("It looks like you could light or ignite the " + object.alias + " on fire.") } else if (object.IsBurning=True) { msg ("The " + object.alias + " is currently burning.") } } </script> </command> <command name="look"> <pattern type="string">^look$|^l$</pattern> <script><![CDATA[ ShowRoomDescription if (HasAttribute(player.parent, "IsWorldSpace")) { if (player.parent.IsOutside=True) { if (game.wt_worldclock_hour < game.wt_worldclock_lighttime or game.wt_worldclock_hour >= game.wt_worldclock_darktime) { msg ("It's dark out here.") } } } ]]></script> </command> <command> <pattern>test</pattern> <script> MoveObject (player, testroom) </script> </command> <command name="douse"> <pattern>douse #object#</pattern> <script> if (HasAttribute(object, "IsWorldObject")) { do (object, "OnDouse") } </script> </command> <command name="burn"> <pattern>burn #object1# with #object2#; burn #object1#; light #object1# with #object2#; light #object1#; ignite #object1# with #object2#; ignite #object1#</pattern> <script><![CDATA[ if (not IsDefined("object2")) { object2 = null } if (HasAttribute(object1, "IsWorldObject")) { if (object1.IsFlammable=False) { msg ("That doesn't seem to want to burn.") } if (object1.IsIgnitable=True and object2=null and object1.parent = player) { do (object1, "OnIgnite") } else if (object1.IsIgnitable=True and object2 = null and object1.parent <> player) { msg ("But you're not holding that to ignite it.") } if (object1.IsIgnitable=False and object2=null) { msg ("You'll need something to light or ignite that with. The " + object1.alias + " won't ignite by itself.") } if (object1.IsFlammable=True and object2<>null) { if (HasAttribute(object2, "IsWorldObject")) { if (object2.IsBurning=False) { msg ("But the " + object2.alias + " isn't on fire.") } if (object2.IsBurning=True) { do (object1, "OnIgnite") } } else { msg ("Using the " + object2.alias + " to burn the " + object1.alias + " doesn't seem to work.") } } } else { msg ("You're not quite sure how you'd go about burning the " + object1.alias + ".") } ]]></script> </command>

Your Quest file is shaping up nicely! Here are a few tweaks and a script that might help:

Tweak for Conditional Check
In your start script, there's a small typo in the conditional check for game.wt_InitError. It should use == for comparison, not = for assignment:

quest
if (game.wt_InitError == False) {
  // Rest of the script
}

Sample Script: Resetting an Object's State
Here's a sample script for resetting an object's state, which might be useful for your project:

Add a Command to Reset an Object:

quest

<command name="reset">
  <pattern>reset #object#</pattern>
  <script>
    if (HasAttribute(object, "IsWorldObject")) {
      do (object, "OnReset")
    }
    else {
      msg ("You can't reset that object.")
    }
  </script>
</command>

Define the OnReset Script for Your Objects: You can create a default OnReset script that objects inherit:

quest

<object name="wt_defaultObject">
  <inherit name="editor_object" />
  <inherit name="wt_obj" />
  <script name="OnReset"><![CDATA[
    // Reset attributes
    object.IsBroken = False
    object.IsBurning = False
    // Add more attributes to reset as needed
    msg ("The " + object.alias + " has been reset.")
  ]]></script>
</object>

Bah, the code was deleted by the forum. I'm thinking some of the errors it caught were part of the codebase itself and not my game, so it would be interesting to take a raw game, unedited, and cut & paste it into Microsoft Copilot to see what errors it catches.


NOTE FROM THE MODERATOR: I fixed the formatting to display the code in that post.


Hello.

The codebase and the .asxl file are out of date, I didn't use 580 for this, will get that exported eventually, but here is the general result.

I think Alex Warren created the ASLX file extension when he created Quest.

...and the current ASL version (as you say) is 580. So, maybe that program is simply comparing the 550 ASL version from your file to the current file in the GitHub repo and declaring yours out of date?

What other errors did it find?


Stuff like this, which I don't understand would be an error. Maybe it's hallucinating?

In your start script, there's a small typo in the conditional check for game.wt_InitError. It should use == for comparison, not = for assignment:

quest
if (game.wt_InitError == False) {
// Rest of the script
}


It wrote this suggestion as an example to reset an object's state:

<command name="reset"> <pattern>reset #object#</pattern> <script> if (HasAttribute(object, "IsWorldObject")) { do (object, "OnReset") } else { msg ("You can't reset that object.") } </script> </command>

Ugh the forum keeps stripping out the code.


<command name="reset"> <pattern>reset #object#</pattern> <script> if (HasAttribute(object, "IsWorldObject")) { do (object, "OnReset") } else { msg ("You can't reset that object.") } </script> </command>


I think the idea of using AI to write the code might be good, but the results would need to be assessed closely.


if (game.wt_InitError == False) {

Well, it seems to be trying to help, but Quest scripts never use ==. It's always =.

JavaScript has ==, but not Quest.


I edited this post of yours to illustrate how to post that code.

So it says:

<command name="reset">
  <pattern>reset #object#</pattern>
  <script>
     if (HasAttribute(object, "IsWorldObject")) {
      do (object, "OnReset")
    }
    else {
      msg ("You can't reset that object.")
    }
  </script>
</command>

If IsWorldObject is a boolean attribute I'd probably change that line to if (GetBoolean(object, "IsWorldObject")) {.

That way, it will not throw an error if the attribute does not exist. It will only return true if it is a boolean attribute that is set to true. Otherwise, it would return false.

I'd have to see all the code to approve of this line: do (object, "OnReset")

I think the idea of using AI to write the code might be good, but the results would need to be assessed closely.

Exactly. :)


PS

Sorry about editing your posts. I was too interested to stop myself, and the forum is funny when it comes to sharing code with <>.


Log in to post a reply.

Support

Forums