-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the K2 Scripting Framework wiki!
The idea behind this project is to create an efficient and stable code pattern for the K2 script language. If you have already written a script for Savage 2, then you know that there are a lot coding pitfalls and annoyances. For instance, there are only 3 options to structure and organize your code: scripts, world triggers and labels. Another major downside is that you cannot create your own functions and that everything is non-object-oriented.
This is where the K2 framework comes to help by creating a code pattern which mimics basic features known from other scripting languages (eg. PHP) such as classes and methods. To achieve this, the framework consists of two components: the script compiler and the script modules. The compiler takes the code of all the modules and converts them into a single K2 script file so that it can be used in your Savage 2 map. Modules are essentially a number of scripts and variables, formed into a single class (upon compilation) within the framework script.
Recommended to read in the provided order.
- Compiler Setup
- Introduction to Modules
- Framework Routing
- Command Shorthands
- Module Tutorial
- Got Questions?
Detailed information about classes, their config vars and methods including code examples.