RuneScript Reference/Scripting Tutorial
Disclaimer: this document is being written by a relative noob in an effort to document my findings and iron out any incorrect notions or faulty assumptions. It is not complete and may be (read: probably is) egregiously wrong in certain areas. Continue at your own peril!
Introduction
This document aims to acquaint new contributors with the basics of writing RuneScript as used by Lost City. Before reading, you are expected to have:
- Decent reading comprehension, go slowly and read each section multiple times if needed
- Willingness to ask for help, Lost City is learning community and we are here to help
- Most importantly - a winning attitude! If you get confused, ask a question and come back to the problem later
While not strictly required, having a working development environment set up on your computer would be a great advantage. You will be best able to follow along with the tutorial if you have:
- Lost City's server set up and running for development on your local machine
- Your preferred text editor installed and ready
- VS Code is recommended because there is an extension for RuneScript syntax highlighting available.
Knowledge of basic programming fundamentals (variables, functions) will also help but is by no means required.
RuneScript
RuneScript files are written as plain text with the extension . RuneScript files are placed under `./data/src/scripts` in the server's source tree and are further organized by various criteria (area, quest, skill, etc).
The Lost City game server is capable of hot-reloading RuneScript files as you change them, meaning you can follow along with this tutorial and see your changes appear in-game in real time!
To learn the basics of RuneScript, continue with the next page of the tutorial where we examine triggers.
Next Page || Go to the Table of Contents
Packaging
More in-depth on the server's directory structure. Now that the reader might possibly be capable of writing some RuneScript triggers, have them create a new .rs2 file in an appropriate location and add a test interaction.
Configurations
Zoom out from RuneScript and touch on configs, explain how they might add/change configurations for NPCs and locs, how to move a npc/loc/obj/seq from the `all.*` files into more appropriate locations