Tavern system
From NWNWiki
The tavern system for OSRS will implement a variety of important tavern functions automatically, and will be suitable for use in single-player, multiplayer session-based, and persistent world applications. Features currently planned and in progress are:
- A system that allows different "casts of characters" to be present in the tavern's common room depending upon the time of day.
- A simplified room-rental system allowing rooms to be rented for the night
or by the week. - Waitress and Bartender scripting that allows a merchant GUI to open directly from the conversation with waitress or bartender.
- This is the initial functionality. An option that allows the waitress to "take the order", walk to the bar to "collect" it, and return to "deliver" it, is also planned but is not a top priority at this time.
- Plenty of ambient animations
Critical to the value of this system is that it should not be [b]tied down[/b] to a particular area. The module builder must be able to simply import the .erf and apply the scripts and NPCs to whichever area he or she desires.
Contents |
[edit] Shift-change system
- Under construction
[edit] Room-rental system
- Must be open-ended. The module builder should be able to use this system regardless of the number of rooms or their type/cost. To this end, we are using a simple system. The room is identified by its door, which is given a tag resembling this one for Room No. 1: os_room_XXX_YYY where XXX is replaced by the unique inn id (allows more than one inn to the module) and YYY is replaced by the room number. This feature otherwise follows the OSRS naming rules. The key for this room bears the same tag, so the key always matches it's room. The cost of the room is determined by the key, by editing it's properties. This way, instead of needing complex scripting and a ridiculous lot of local variables, you use the NWN Merchant GUI spawned from a conversation and "sell" the key.
- Rooms are rented on a "pay-in-advance-per-night" system. Each key, when purchased, gets a local variable set on it which identifies it's "expiration date". Initially, it was thought to just make the key automatically disappear, returning to the innkeeper-merchant's "store" inventory. More realistic would be to have someone spawn in nearby when a PC tries to use an expired key, offering them the opportunity to pay another night or nights rents, and taking the key back if they do not or cannot do so.
- Scripts needed:
- On each room door opening, check current day and time against expiration stored in local variable on key. If expired, spawn in appropriate inn official and start conversation.
- Inn official conversation and scripting to offer PC opportunity to purchase more room time or to re-possess key if unwilling or unable to do so.
[edit] Waitress/bartender scripts
- Under construction
[edit] Waitress fetch-and-retrieve scripting
- Proposed
[edit] Patron and staff ambient animation scripting
- Under construction
[edit] Technical notes
- The main area, which comprises the tavern main floor with common room. The rental rooms can either be in a separate "upstairs" area or on the same main floor, provided all the rental rooms are present with appropriately-tagged locked doors on each.
- The doors will be tagged with a coded tag that indicates the system (nrs_tavern_room_) and the room number. The corresponding keys need to also be created and tagged to match (nrs_tavern_room_ plus room number). Thus, door and key will always have the same tag.
The special object "nrs_keybox" will contain all the keys- There is no upper limit, technically, to how many rooms there can be.
- Room quality (and appropriate price) will be features of the KEY not the ROOM. Thus, the value assigned to the KEY determines the room price. The key's name and description will identify for the player and, thus, the rooms are "sold" via a standard merchant GUI. This will reduce the need for special scripting.
- A scripting solution WILL be needed, however, to make the key disappear and return to the bartenders "store" the next morning. This will allow unlimited use of the key between rental and expiry. Any ideas on how to do this welcome.
- A set of special, inaccessible (except to DMs) areas where the different shifts' "personnel" are when not "on stage" in the tavern. The DM or module designer can thereby set up the cast any way he or she chooses, provided the NPCs are tagged properly. They will be spawned in where they should be, when they should be, automatically.
- Tags to be used are nrs_tavern_bartender, nrs_tavern_waitress, nrs_tavern_regular, and nrs_tavern_irregular
- Irregulars will have special handling in the script that transfers them from the "waiting" area to the "onstage" area. There will be a "die roll" determining their appearance on stage. This random probability will be adjustable from NPC to NPC.
[edit] Goals
- The system must be easily portable from area to area
- The system must be easy to understand and modify to taste
- The system must be very flexible.
