|
Axe Software Forums
Quest Developer Forum a 'take all' command?
|
Author | Topic: a 'take all' command? |
MaDbRiT |
posted 24-01-2001 13:42 GMT
Hi Those testing my (still unfinished) Quest project asked 'why can't I just type take all to get everything in the room'.. Good question - I took a look at the example code for doing a 'take all' command posted on the 'Quest Tips & Tricks' page and though it works it is a LOT of work to set up! Following my policy of doing everything I can in re-usable 'libraries' of code, I have written my own 'take all' command that can be used by adding a single '!include command and pre-setting one string variable with a list of takeable items. It is 'intelligent' in the sense that it only collects those 'takeable' objects that are present, and provides a formatted confirmation of what happened, examples: With one item present it reports.. You take the item. With two items present it reports.. You take the item and item. With three (or more) it reports.. You take the item, item and item. This is (I hope) a reasonable format. The library (and a demo ASL file) will be on my website www.members.aol.com/agbampton/html/qtips.html shortly.. Al (a.k.a. MaDbRiT) |
MaDbRiT |
posted 25-01-2001 07:25 GMT
In my last posting I wrote:
quote: It would have been better had I uploaded the finished version... the one that actually works - ooops!! The library I did upload was devoid of code to handle the situation where there are no items to take present, I'd taken that out while I was testing the formatting routine and forgot to put it back. D'oh. A complete version is now uploaded, together with a new version of the ASL demo file. The demo was actually fine except that I'd used !include <standard.qlb&lgt instead of !include <standard.lib&lgt - this is because I now use TEXTPAD as an editor and the .lib file extension is associated with another programming language and displays in hexadecimal form! To get around this I am now using .qlb as a file extension for Quest libraries, Quest doesn't mind and it avoids confusion for Textpad users. Sorry for the confusion. Al a.k.a. MaDbRiT |
MaDbRiT |
posted 25-01-2001 07:31 GMT
having one of THOSE days... the paragraph above which reads:-
quote: SHOULD have read: The demo was actually fine except that I'd used !include <standard.qlb> instead of !include <standard.lib> - this is because I now use TEXTPAD as an editor and the .lib file extension is associated with another programming language and displays in hexadecimal form! If I get it wrong this time, I'll give up :-) Al |
MaDbRiT |
posted 25-01-2001 22:46 GMT
No sooner had I finished than I had a better idea... I've reworked 'takeall.qlb' completely. It now doesn't require any preconfiguration - a simple !include <takeall.qlb> will suffice, plus it provides a nicer format output and automatically deals with non-takeable objects in the room. It works with Quest 2.17 onwards and is a smaller file that its predecessor. Al |