-
Notifications
You must be signed in to change notification settings - Fork 17
Template ‐ ROPE
A rope is an object that can be attached at one or both ends. It can be "tethered", in which case one end is permanently attached to something. The ROPE template includes the TAKEABLE template.
Ropes are tricky things, and it is worth mentioning how they are implemented, if only to ensure it is documented somewhere. A rope has two ends, designated 1 and 2 - but they are assumed to be identical and interchangeable. If a rope is tied to something, then either "tiedTo1" or "tiedTo2" will be set to its name. If both ends are tied to objects, then both "tiedTo1" and "tiedTo2" will be set. In addition, the "locs" is an array of locations the rope passes through, starting at the 1 end and terminating at the 2 end.
Be aware that if you try doing anything weird with a rope, you find you need to do a lot of coding. In particular, ROPE objects have no "moveFromTo", so if you start moving the rope - or an end of it - in your custom code, you have some extra work to do.
This example gives a rope that will stretch between 7 rooms.
createItem("rope", ROPE(7), {
loc:"hallway",
pronouns:lang.pronouns.massnoun,
indefArticle:'some',
})
By default a rope can be attached to any object that has "attachable" set to true
, but you can give a rope its own "canAttachTo" to make it more discerning. In the example, the rope is a cable that can only be attached to items where "socket" is true
.
canAttachTo:function(item) {
return item.socket
},
You might also want to have your own "attachTo" and "detachFrom" function attributes. Both are sent the character and the item the rope is to be tied to or untied from. If these tell the user what happened, you should set "suppessMsgs" to true
to stop the default messages getting printed too. Bear in mind that you will need to work out which end of the rope to handle in both of these.
Life is a little easier if the rope is tethered - i.e., permanently attached at one end. We then know "attachTo" and "detachFrom" concern only end 2.
This example shows a tethered rope; in this case some wire permanently fixed to a strange device. Note also custom "msgUnwind" and "msgWind" messages; these are used as the rope is played out and picked up again.
createItem("wire", ROPE(7, "strange_device"), {
loc:"mad_science_lab",
alias:"wire",
parserAltNames:['coil'],
pronouns:lang.pronouns.massnoun,
indefArticle:'some',
msgUnwind:"The wire trails behind as Mandy unwinds it.",
msgWind:"Mandy coils up the wire.",
})
Tutorial
- First steps
- Rooms and Exits
- Items
- Templates
- Items and rooms again
- More items
- Locks
- Commands
- Complex mechanisms
- Uploading
QuestJS Basics
- General
- Settings
- Attributes for items
- Attributes for rooms
- Attributes for exits
- Naming Items and Rooms
- Restrictions, Messages and Reactions
- Creating objects on the fly
- String Functions
- Random Functions
- Array/List Functions
- The
respond
function - Other Functions
The Text Processor
Commands
- Introduction
- Basic commands (from the tutorial)
- Complex commands
- Example of creating a command (implementing SHOOT GUN AT HENRY)
- More on commands
- Shortcut for commands
- Modifying existing commands
- Custom parser types
- Note on command results
- Meta-Commands
- Neutral language (including alternatives to "you")
- The parser
- Command matching
- Vari-verbs (for verbs that are almost synonyms)
Templates for Items
- Introduction
- Takeable
- Openable
- Container and surface
- Locks and keys
- Wearable
- Furniture
- Button and Switch
- Readable
- Edible
- Vessel (handling liquids)
- Components
- Countable
- Consultable
- Rope
- Construction
- Backscene (walls, etc.)
- Merchandise (including how to create a shop)
- Shiftable (can be pushed from one room to another)
See also:
- Custom templates (and alternatives)
Handing NPCs
- Introduction
- Attributes
- Allowing the player to give commands
- Conversations
- Simple TALK TO
- SAY
- ASK and TELL
- Dynamic conversations with TALK TO
- TALK and DISCUSS
- Following an agenda
- Reactions
- Giving
- Followers
- Visibility
- Changing the player point-of-view
The User Experience (UI)
The main screen
- Basics
- Printing Text Functions
- Special Text Effects
- Output effects (including pausing)
- Hyperlinks
- User Input
The Side Panes
Multi-media (sounds, images, maps, etc.)
- Images
- Sounds
- Youtube Video (Contribution by KV)
- Adding a map
- Node-based maps
- Image-based maps
- Hex maps
- Adding a playing board
- Roulette!... in a grid
Dialogue boxes
- Character Creation
- Other example dialogs [See also "User Input"]
Other Elements
- Toolbar (status bar across the top)
- Custom UI Elements
Role-playing Games
- Introduction
- Getting started
- Items
- Characters (and Monsters!)
- Spawning Monsters and Items)
- Systema Naturae
- Who, When and How NPCs Attack
- Attributes for characters
- Attacking and guarding
- Communicating monsters
- Skills and Spells
- Limiting Magic
- Effects
- The Attack Object
- [Extra utility functions](https://github.com/ThePix/QuestJS/wiki/RPG-Library-%E2%80%90-Extra Functions)
- Randomly Generated Dungeon
- Quests for Quest
- User Interface
Web Basics
- HTML (the basic elements of a web page)
- CSS (how to style web pages)
- SVG (scalable vector graphics)
- Colours
- JavaScript
- Regular Expressions
How-to
Time
- Events (and Turnscripts)
- Date and Time (including custom calendars)
- Timed Events (i.e., real time, not game time)
Items
- Phone a Friend
- Using the USE verb
- Display Verbs
- Change Listeners
- Ensembles (grouping items)
- How to spit
Locations
- Large, open areas
- Region,s with sky, walls, etc.
- Dynamic Room Descriptions
- Transit system (lifts/elevators, buses, trains, simple vehicles)
- Rooms split into multiple locations
- Create rooms on the fly
- Handling weather
Exits
- Alternative Directions (eg, port and starboard)
- Destinations, Not Directions
Meta
- Customise Help
- Provide hints
- Include Achievements
- Add comments to your code
-
End The Game (
io.finish
)
Meta: About The Whole Game
- Translate from Quest 5
- Authoring Several Games at Once
- Chaining Several Games Together
- Competition Entry
- Walk-throughs
- Unit testing
- Debugging (trouble-shooting)
Releasing Your Game
Reference
- The Language File
- List of settings
- Scope
- The Output Queue
- Security
- Implementation notes (initialisation order, data structures)
- Files
- Code guidelines
- Save/load
- UNDO
- The editor
- The Cloak of Darkness
- Versions
- Quest 6 or QuestJS
- The other Folders
- Choose your own adventure