|
Axe Software Forums
Quest Developer Forum Question regarding Al's q3ext library===>
|
Author | Topic: Question regarding Al's q3ext library===> |
Mega |
posted 30-10-2001 21:40 GMT
I decided to try out the new "container" object type. However, I soon found that it wasn't complete. Although it does store one object inside another, it doesn't allow for manipulation of the container's contents. Say, for example, you were in the same room as a "bag" object, and the bag had as its contents a "coin". Because the bag's contents need their own room (bag_inventory), Quest thinks that the coin is in a completely different room than you. So typing "take coin", "look at coin", etc. results in "I don't see that here." In fact, a list of the bag's contents aren't even displayed anywhere; looking at the bag simply prints the bag's description. Therefore, you have to write your own code to display the contents, to look at each item in the bag, to take each item, etc., each time you make a new container object. This really defeats the whole idea of having a nice, convenient Container type in the first place. |
Computer Whizz |
posted 30-10-2001 23:54 GMT
Think logically! What do you do to see inside a bag? You don't walk into a room and IMMEDIATLY know what is inside the bag, nor do you SEE what is in the bag..... what do you do? Look in bag then to use things inside, the things are STILL in the bag. So when you want to get the money, the money isn't inside the ROOM, nor is it IMMEDIATLY accessable.... you have to: get money from bag to look at it you'd have to effectivly get it, then look at it - but I suppose you could put: look in bag at coin just wondering if these work - if not I suggest that this would be nice for the library! Computer Whizz |
MaDbRiT |
posted 31-10-2001 11:31 GMT
Mega - it sounds like you are not using my library properly, it certainly DOES provide most of the obvious functions of a container without having to write any extra code! Here's a bit of game output, the bag is a container set up as per my instructions...
quote: While I agree 'look at' doesn't list contents, that's because I deliberately set it up that way - 'look' being a casual once over, 'examine' being used to give a more detailed examination that shows the contents. If you want a 'look' to show the contents - just set up an override command and force use of examine instead - it's quite simple. As you can see, manipulating objects (here the gloves) by putting them in the bag and taking them out etc is all dealt with quite automatically, so I don't really understand your comments. Obviously the library cannot deal with EVERY eventuality, but it does provide useful default behaviour to use 'as is' or develop for more sophisticated contianer objects. Al |
MaDbRiT |
posted 31-10-2001 11:36 GMT
Oh yes.. obviously the locker is also a container object in the above extract. Without ANY extra code, you can manipulate ALL the objects in the locker, it's contents list etc are all automatically managed. Obviously I have no idea what you are trying to do with the code so I can't comment on why you seem to be having trouble with it. Al |
Mega |
posted 31-10-2001 17:36 GMT
You're right, my apologies. The problem seems to be conflicts with the various procedures. Basically, in order to do verb synonyms ("look at ball" and "look ball" doing the same thing) I wrote several procedures, one for each of the common verbs (look, go, get, open, close, etc), and one last procedure called "miscproc" for any leftover or unusual verbs. That's worked great so far, until I tried the Container class. Because it has special code for "examine" that's different from "look", it screws something up in my code. Depending on what I've changed in my debugging, "examine bag" either tells me 'I don't see that here' or prints the normal "look" description without listing the contents. Here's all the code from my game that is relevant to the problem. '-------------------------------------------- 'in game definiton block: command <look at #verbtarget#> do <lookproc> command <look #verbtarget#> do <lookproc> command <look> exec <look;normal> command <examine #verbtarget#> do <examineproc> command <#miscverb# at #verbtarget#> do <miscproc> command <#miscverb# to #verbtarget#> do <miscproc> command <#miscverb# on #verbtarget#> do <miscproc> command <#miscverb# in #verbtarget#> do <miscproc> command <#miscverb# with #verbtarget#> do <miscproc> command <#miscverb# #verbtarget#> do <miscproc> ................................... define room <southeast courtyard> define object <castle8> define object <skeleton> define object <dirt> define object <handbag> end define end define define room <handbag_inventory> define object <hairpin> end define 'relevant procedures: define procedure <lookproc> define procedure <examineproc> define procedure <miscproc> 'And finally, the Resolve function: define function <resolve>
Sorry for such a long code snippet :-) |
MaDbRiT |
posted 31-10-2001 21:07 GMT
Hi Mega.. Well I looked through your code briefly, and although I've not actually tested it, I'm sure the problem lies with the fact you are adding 'look' and 'examine' routines that effectively replace those my library adds - this means mine won't ever get called of course, which makes the library code sort of redundant! If you want to have your routines 'pre-parse' the input before passing the results to my library so that containers get dealt with, I think that rather than call exec <look;normal> etc. you need to experiment with calling my library's procedures instead. I'm probably missing the point, but why are you writing code to handle 'look at' and 'examine' at all? Is there something in Quest's default way of dealing with these that doesn't work for you? My library obviously has to 'tweak' these because of the requirements of containers and clothes, I presume there is some conflicting requirement in your game? Al |
MaDbRiT |
posted 31-10-2001 21:19 GMT
Hmmm... It occurs to me that my library could (and probably should) automatically deal with the 'look at ball / look ball' issue, I deal with it in my external ASL code at present, but it would be a doddle to make q3ext.qlb deal with this internally. One for the 'fix' list for the next release - LOL. Al Mega - if I tweak the lib to sort the 'look at ball/ look ball' issue, would you like to test drive it and see if it helps you? |
Mega |
posted 31-10-2001 21:36 GMT
Absolutely! Writing all those procedures gets annoying REAL fast :-) Of course, it can't JUST be 'look/look at'. We also need 'go/go to', 'sit/sit on', and any other miscellaneous verb that might need an extra word tacked on. And also, the 'look' verb actually has THREE parts: 'look at something', 'look something', and just 'look' on its own. |
MaDbRiT |
posted 01-11-2001 07:36 GMT
quote: Yes I did 'get' that part of the equation... I'm likely just to deal with all the things my library uses, so that there's no need to modify / amend code that might cause problems to it, but obviously the same principle can be extended to deal with the other areas. My lib should deal with look/ look at (etc) ALL objects in the game that you want handled normally. i.e. there should be no need to write specific look /look at commands for any objects except those you want handled differently from normal. The trick here is that my lib provides default 'catch all' functionality, if you want to add a specific handling routine you have to put it a lib and include that AHEAD of the lib so that Quest checks your specific before dropping through to my 'catch all' code. Al |
Mega |
posted 01-11-2001 19:41 GMT
No no, that's not what I meant. For the most part, I won't need specialized look/get/go functions. What I want is simply for the compiler to recognize 'look object' and 'look at object' as the same command (and different from simply 'look'), 'go place' and 'go to place' as the same command, etc, and then to execute that command as it normally would. |
MaDbRiT |
posted 04-11-2001 09:56 GMT
quote: As of release 5 of my library - I have added the required tweaks to do exactly the above. You can now expect look object, look at object, look at the object even look the object to work 'normally' - that is as my library would funtion with "look at object". I have also tweaked 'examine" a bit ('look inside of' now equating to examine and so on) and the 'go /go to' - though strictly speaking that last one has nothing to do with my library at all :-) Hope this helps... Al |
MaDbRiT |
posted 04-11-2001 10:03 GMT
Oh yeah... Because my lib doesn't deal with sitting on things - I'd rather not have it pre-guess how others would want to deal with coding the commands to deal with those possibilities. However I have e-mailed you an example of how I'd code a command and set of synonyms to deal with the possibles in sit/ sit in /sit on etc. Al |