prev | toc | next
 

2.7 Setting up Sources

Defining objects, as discussed on the last several pages, makes entries in the Argo database, but does not in itself make the objects available to players. This is done through a separate command, +source.

Like +define, the +source command is prompt driven: you can simply enter the command and respond to prompts to set up a source. The +source command does accept an optional argument, however, for the object which is to be a source. The default source object is the current room. So, to make a room a source, you can either go to the room and type +source, or remotely set it up by typing +source <room #dbref>. The primary use of the object argument, though, is to configure non-room objects as sources... If you wanted to create a vending machine, for example, or let a player supply objects, you would supply the name or dbref of the vending machine or player as an argument to the +source command.

As an example, let's say we are configuring a room called Old Ned's Shop as a source location for a few different types of weapons, including hatchets. We will set it up so that players can both buy and sell hatchets at the shop. Note that in this case — as with all sources — players are not really buying from or selling to an actual player... There does not have to be an Old Ned character running the shop, though we might want to create a puppet object named Ned or Old Ned that can be controlled by staff, or by both staff and players, to make the shopping experience more interactive... Or we could be setting up a shop for an actual merchant player character named Ned. Regardless of these choices, though, when players use the +buy, +get, or +sell commands to purchase or sell objects at this location, they are interacting directly with the Argo system: objects are created or recycled on the fly, as needed, and the player is automatically charged or credited the appropriate amount. (If Ned were a player character, these `automatic' transactions would be provided as supplemental material, so that characters could do business at the shop, even when Ned isn't online... When Ned is online, it would be better for him and the customer to roleplay the transaction.)

Typing +source, without arguments, while in the shop, produces the following prompts:

====================================
>>  Do you want to add or remove an object from Old Ned's Shop's source list ?
>> [Enter 'add', 'remove', or .q to quit]
>>  Do you want to add information for players to buy or sell objects?
>> [Enter 'buy', 'sell', or .q to quit]
====================================

When setting up the source, we would enter `add' at the first prompt. To make an object no longer available, we would enter `remove'. You can abbreviate this entry to a leading portion of the word, including just `a' and `r'.

Then we specify whether we are setting up configuration for buying or selling objects at this source. We can set up a source as a location where an object can be both bought and sold; to do this, we configure the source twice, entering `buy' one time and `sell' the other. Again, you can abbreviate your entry at this prompt.

Let's do `buy' first, entering the information that will be necessary for characters to be able to buy hatchets at Ned's shop.

====================================
>>  What object to buy do you want to add for Old Ned's Shop?
>> [Enter the name of an object, .l to list choices, or .q to quit]
====================================

This prompt is pretty self explanatory: enter the name of an object that has already been set up in the database with the +define command.

====================================
>>  The book price for Hatchet is 15 coppers.
>>  Is this the price to be charged at Old Ned's Shop? (y/n)
>>  How much should Hatchet cost at this source?
>> [Enter price in coppers, or .q to quit]
====================================

The system will then display the `book price' of the object — the standard price set when the object was defined — and ask if you want to charge this price at the current source. Let's say that Ned's is a small shop: he doesn't have very many different kinds of weapons, but his prices are pretty good on those he does have. Hatchets are a little cheaper here than elsewhere: we enter `14' at this prompt. Note that the price is in small coins. Multiply large coin prices by 100 to convert to small coins: a suit of nice armor that costs 3 silver and 50 copper would be entered as `350'.

====================================
>>  Is this object always available at this source? (y/n)
>>  What is the percent chance that Hatchet will be at this source?
>> [Enter a number between 1 and 100, or .q to quit]
>>  How often can Hatchet be obtained at this source?
>> [Enter a time, or .h for help, or .q to quit]
====================================

You can specify that objects are always available at the source, or are only available on an intermittent basis. If you say `no', the object is not always available here, then you will be prompted for a percentage chance that it will be available at any given time, and an amount of time that has to pass between transactions. If we wanted to set it up so that Ned usually, but not always, has a hatchet to sell players, and has to replenish his stock when he sells one (goes down to his friend the armorer and gets another one), we could enter values such as `90' and `1 hour' here. In the discussion of Defining Objects, we gave the example of Faerie Dew, which perhaps could be perchased somewhere, but more likely would be collected by enterprising characters who go to the Hidden Dell on misty mornings and see if they can find some drops of dew glistening on grass where the faeries danced. To set up a source like this, we might use values such as 80% (the faeries dance most nights), and a time window of `1 day' (you can only collect dew once a day... in the morning, actually; but we won't make people log on at a specific time; limiting dew collection to once per day is realistic enough). The +get command is essentially an alias of +buy, with a name that makes more sense when no money is changing hands... to try to collect Faerie Dew, the playes would go to the dell and type +get faerie dew.

====================================
>>  What message should be shown to players when they successfully obtain 
    Hatchet from this source?
>> [Enter message, or .n for none, or .q to quit]
>>  What message should be shown to other players when someone obtains 
    Hatchet from this source?
>> [Player's name will be prepended to message]
>> [Enter message, or .n for none, or .q to quit]
>>  What message should be shown to players when they fail to obtain 
    Hatchet from this source?
>> [Enter message, or .n for none, or .q to quit]
>>  What message should be shown to other players when someone fails to obtain 
    Hatchet from this source?
>> [Player's name will be prepended to message]
>> [Enter message, or .n for none, or .q to quit]
====================================

The final step is to set messages to be shown, to the player and to other players, when they successfully purchase or unsuccessfully attempt to purchase objects at this source... equivalents, in other words, of @succ, @osucc, @fail, and @ofail messages.

As with @succ and @fail messages, the messages `to players' are shown in their entirety, only to the acting player. As with @osucc and @ofail messages, the `to other players' messages are shown to everyone else in the room, and are prepended with the acting player's name. So, entries like the following could be used for buying a hatchet at Ned's:

        You pay Ned and pick up a new hatchet.
        buys a hatchet.
        Ned says, "Sorry, I'm out of hatchets right now.
        asks Ned about hatchets.

====================================
>>  Hatchet added to Old Ned's Shop's source list.
====================================

At this point, the shop has been configured as a source for buying hatchets. If players type +buy or +browse, they will be shown a list of objects available for purchase at the shop, including the hatchet. If they type +buy hatchet, the system checks to make sure they have enough money, checks to make sure that enough time has passed since the last hatchet was sold, and rolls to see if Ned has one in stock... If the result in all three cases is `yes', then 14 small coins will be deducted from the amount they are carrying, and Argo will emit a notice and put a hatchet object in the player's inventory. If the player cannot afford a hatchet, the system will tell him so. If no hatchets are available, Ned will just say he's sorry, he's out.

====================================
>>  Do you want to add or remove something else for Old Ned's Shop? (y/n)
====================================

After one object has been configured, a prompt asks if you want to configure another. Type `no' to exit the +source prompts, or `yes' to keep going. In this case, we would enter `yes', so we can set up the shop as a place where hatchets can be sold as well...

====================================
>>  Do you want to add or remove an object from Old Ned's Shop's source list ?
>> [Enter 'add', 'remove', or .q to quit]
>>  Do you want to add information for players to buy or sell objects?
>> [Enter 'buy', 'sell', or .q to quit]
>>  What object can be sold here?
>> [Enter name of object, .l to list choices, or .q to quit]
====================================

This time we will say that we are going to `add' information that allows users to `sell' objects here... a `hatchet' in this case. If characters come into funds, or increase their strength to the point where it makes sense to move up to a larger weapon, or find a hatchet that they don't need in their adventures, they can come to Ned's shop and sell the weapon.

====================================
>>  The book price for Hatchet is 15 coppers.
>>  What is the *most* that will be paid for Hatchet at this source?
>> [Enter an amount in coppers, or .q to quit]
>>  What is the *least* that will be paid for Hatchet at this source?
>> [Enter an amount in coppers, or .q to quit]
====================================

You can enter a range of prices that will be offered for a given object... to reflect the proprietor's varying moods and reaction, or to reflect the fact that different instances of an object will be in varying condition... or, for that matter, just because. For ordinary second-tier objects, a range from just under half the new price to just under the new price is suggested. For rare third-tier objects, the price offered should stay close to `book price'. The hatchets Ned sells (and soon will buy) are ordinary weapons... he sells them at 14 small coins. Something like `6' for the minimum and `13' for the maximum would be good here.

If you want the source to offer a fixed price for an object, just enter the same amount for minimum and maximum.

====================================
>>  With different maximum and minimum prices, players could keep trying
    the command until they get a higher price. Do you want to configure
    a time period for which the price is frozen? (y/n)
>>  For how long should the price stay the same?
>> [Enter a time, or .h for help, or .q to quit]
====================================

As the prompt indicates, if you do enter a range of prices, players could just keep entering +sell hatchet until they get the price they want (players selling objects have a chance to confirm whether or not they accept the offered price). This would pretty much defeat the purpose of having a range of prices. For this reason, you can set a `time window' in which an offered price is frozen. If you enter `1 hour' here, and (the virtual) Ned offers someone 8 coins for a hatchet, then the going rate for hatchets will remain fixed at 8 coins for 1 hour.

====================================
>>  What message should be shown to players when they sell 
    Hatchet at this source?
>> [Include the string '%price' where you want the price paid to appear.
>> [Enter message, or .n for none, or .q to quit]
>>  What message should be shown to other players when someone sells 
    Hatchet at this source?
>> [Player's name will be prepended to message]
>> [Include the string '%price' where you want the price paid to appear.
>> [Enter message, or .n for none, or .q to quit]
>>  Hatchet added to Old Ned's Shop's source list.
>>  Do you want to add or remove something else for Old Ned's Shop? (y/n)
>>  Done.
====================================

Again, the last step is to set messages. Here no @fail and @ofail type messages are needed: if an object can be sold at a source at all, it can always be sold (though not always at a price the player would like). Another difference with this set of messages is that you can include the string %price in the messages. At run time, this string will be replaced by the amount actually paid for the object... `Ned gives you %price for the hatchet' would display as something like `Ned gives you 8 coppers for the hatchet.'

Setting up a location as a source for multiple objects is a fairly time consuming affair. Two scripts, ascr-comsup and ascr-magesup, are available to set up a well stocked weapons & armor shop and magical supplies shop. Both have fairly terse, generic, but serviceable messages. Both offer most of the standard objects mentioned in the discussions of combat and spells, though some `high end' items (larger weapons, plate mail, components for very powerful spells) are either available only occassionally or not at all. Both scripts work by setting properties on `here', so go to the room that will be the source object before uploading them.

prev | toc | top | next