STAC - Getall Routine contributed by Darrel O'Neil The following getall routine is a much more flexible version than the one supplied with STAC, which I am sure most of you have already altered in one way or another. But if you haven't then this could be of interest to you. To avoid clashing message numbers etc, it would be best if you loaded the QSTART.ADV file first and try the example I have provided. Then you can go about changing it to fit in with your own adventure. Special condition ( number 10 ). Leaving line 1, delete line 2 and enter the following commands: 2. 0 setcntr 50 repeat caps 3. if weight firstob room + amount <= stren? message firstob room + 1000 message 2004 then get firstob room inc 50 lf 4. if zero? firstob room then special 20 5. if weight firstob room + amount > stren? and weight firstob room <> 500 message 2002 message firstob room + 1000 message 2001 then firstob room to 9999 lf 6. if zero? firstob room then special 20 7. if weight firstob room = 500 message 2000 message firstob room + 1000 message 2003 then firstob room to 9999 lf 8. if zero? firstob room then special 20 9. until zero? firstob room Now enter the following in special condition ( number 20 ). 1. setturn counter 50 + turns - 1 2. if zero? firstob room then newcom 3. repeat 4. bring firstob 9999 until zero? firstob 9999 newcom The conditions should be easy enough to follow but I'll explain at the end what they actually do. Now create the following objects: NUMBER - WEIGHT - ROOM - SHORT DESC. 1 2 1 a small iron key 2 8 1 a glass bottle 3 500 1 a large wooden chest 4 11 1 a brass lantern 5 1 1 a feather and the messages. represents a space. No. Message 1001 iron key 1002 glass bottle 1003 wooden chest 1004 brass lantern 1005 feather 2000 The 2001 . 2002 You are carrying too much already to get the 2003 steadfastly refuses to be moved. 2004 taken. Finally, create a room in room ( number 1 ) and enter setstr 11 in special condition 17. What now? Enter the adventure and type "get all". You will notice in condition 10 the command, MESSAGE FIRSTOB ROOM + 1000. This works in the same way as the command MESSAGE ROOM when you want to use extended room descriptions. If you are not going to use extended room descriptions then omit the + 1000 and begin your object messages at message 1. For picking up single objects you will have to write similar checks in the low priority conditions. The command MESSAGE NOUN1 will have to be incorporated as you will be pointing to a specific object and not just the first object in the room. The noun numbers and the object numbers must be the same for this to work though. You can also use MESSAGE NOUN1 in other conditions... I can't see that here. You already have that. Can easily be changed to... I can't see any glass bottle here. You already have the feather. Again, the object number and the noun number must be the same for this to work. Now for a more detailed look at the routine and how it works. * * * CONDITION 10 * * * LINE 2. Counter 50 is set up to keep track of the turns. When an object is taken this will be incremented by one. LINE 3. ( OBJECT CAN BE TAKEN ) Your strength ( in the example this is 11 ) is first checked against the combined weight of the first object in the room and your amount. The amount being the total weight of all the objects you are carrying. If you are carrying nothing, then the amount will be zero. If this number is less than or equal to your strength the object is taken. LINES 4, 6 AND 8. Easy enough. If there are no more objects in the room then special condition 20 is executed. LINE 5. ( CARRYING TOO MUCH ALREADY ) Similar to LINE 3 but checks for 'greater than' your strength and also to see if the objects weight is 500 ( see LINE 7 ). This does not mean the object is too heavy to lift, but too heavy to lift with your present load. If this is the case the object cannot be taken, so it is stored in room 9999. LINE 7. ( OBJECT TOO HEAVY ) This line deals with heavy objects. Objects which cannot be taken regardless of what you are carrying. They are given a weight of 500. You could use this for cupboards, chests, tables etc. Any objects you don't want the player to be able to move. If there is a heavy object present ( an object with a weight of 500 ) it is stored in room 9999. * * * SPECIAL 20 * * * When there are no more objects in the room, special condition 20 is called. We may have been able to take every object, so room 9999 should be empty. Line 2 checks this and ends the condition if room 9999 is empty. Line 1 sets the turns that were stored in counter 50 and the repeat until loop returns the objects.