short descriptions vs long ones?

shadowphile
10 Jun 2013, 05:06
This is a feature I like from the Infocom games:
-enter a room for the first time, get a long description.
-after that, get a short description.
If I type 'look', I get the long description.

Seems pretty straight-forward and useful but it's escaping me how to do this without a bunch of repetitive scripting for every single room! Besides, the 'look' command is already taken, which brings up my next question:
Where can I access the built-in commands and see how they operate, maybe modify their behavior?
thanks

edit: somewhat later...I've got a system working, not the greatest but manageable
-each room has a new attribute called 'longdesc', have to add those by hand, would like to find a way to add it by default to new rooms
-the regular description attribute has a First Time script. Initially call -print expression player.parent.longdesc-, otherwise -print message "your short description"-.
-Overload the 'look' command with a new one; it doesn't seem to mess with other uses like 'look north', etc.
The new look command also does a -print expression player.parent.longdesc- action.

Anybody got a better approach? This actually works rather well, the only way it could be easier is if it was built into the GUI. (hint hint)

HegemonKhan
10 Jun 2013, 06:34
open~start up any game in the GUI~Editor, and then in the bottom left corner, click on "Filter", and then click on the "Show Library Elements", to see the core game engine code stuff. It's a bit difficult to get the "Show Library Elements" to appear, due to the blow-up small box that appears and gets in the way, as you try to click on "Filter". To modify them, just click on what you want, and then in the upper right, just click on "Copy". This keeps the core game library protected while allowing you to change it too.

Pertex
10 Jun 2013, 06:36
Look in the core directory of the Quest installation. There you wil find files like Corecommands.aslx or Coredescriptions.aslx

shadowphile
12 Jun 2013, 04:55
Well cool! I was trying to get to the core scripts and didn't even notice that Filter button, I think I can work with this, although my solution might actually be easier. Either way I have to create a new attribute called 'long description' and use the regular description attribute for the short description.

BTW, how do I revert back to the original command? I made a copy of look, then I deleted it because I didn't want to make a custom version, but the original ghosted look command did not reappear. Although if I restart quest it does show again like normal, so this must be a minor bug in Quest.
Having to save and restart just to have access to it again isn't nice...

Thanks again, because now I have found the place to put a 'long description' as a new default attribute in the 'defaultobject' type! Yay!
Now I need to do is script a new field in the room tab to allow instant GUI field for entering the text.
Wait...I want to write, not code...not again!!!!! (I always get drawn into improving my tools instead of using them, dammit!)
Just because I"m curious: if I modify the GUI to add a new feature, anybody can still play my games on a normal copy of Quest, right?
And.. is there a distribution channel for custom Quest code, if I feel I've added a worthy feature? (not the java/VB deep stuff, just the script code used to make the GUI.)
thanks!

HegemonKhan
12 Jun 2013, 05:58
I haven't messed with this stuff myself yet, so I'm sorry about not being able to answer your question about how to revert back to the original core quest coding.

as to your second question, oh yes, people can play with modified quest core code, as the core code is just a library, you can design your own entire quest engine core code if you want, and all you got to do is to add it into your code (and also include it in the DL for others to play, as they need the library file for the quest game to access it via the code).

You can add any library (your own library or a modified quest core library) in the GUI~Editor or via Code. I'm not exactly sure how to do it in the GUI~Editor, but I'd imagine there's some option to "add a library" or whatever, and as for with the code:

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>79aa8756-8d11-431b-a716-812f8403ede7</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


if you notice the:

<include ref="English.aslx" />
<include ref="Core.aslx" />

these are libraries, one is the core game engine library~coding and the other is for the english language library~coding. so to add, just write in your own library's (-ies') names in the same syntax~format~way within your game code

and for both the GUI~Editor and Code way, you need the actual library file itself to be in the same folder as the quest .exe file, for it to be able to use~include ("reference") it.

-----------

there's documentation on how to make and use libraries, though if you can't find it, let me know, and I'll find it and provide the links for you to it.

----------

There's also a little tidbit about libraries, if I remember correctly, the game engine reads the libraries from top down, so you'll need to place your own libraries in the correct spot (after the default libraries ~ I think if I remember correctly) if you plan on using the default libraries along with your libraries (which would build upon, add to, or change aspects, of the default libraries).

----------

while it's a bit more complicated in how to code all your stuff in, the basic start method for creating a library is simply:

1. open up a new notepad, wordpad, or (best) notepad++
2. then just do ~ type in this:

<library>
(your mass of coding)
</library>


3. last is to save it, name it, make sure it is a quest file, " .aslx ", and make sure it is in the same place as your game file, that will be using it.

----------

here's where you can submit your own quest code (ie library files and instructions~explanations, or just directly as code too)

viewforum.php?f=18 (Libraries and Code Samples)

index.php -> Libraries and Code Samples

take a look in the links above, to see how others present their code stuff, to get an idea at how you should do it for your own.

enjoy ;)