Getting Started
Welcome to Loki Getting Started! This page will guide you through the process of setting up Loki and writing your first Loki script.
Prerequisites
Before you start, make sure you have the following:
- A text editor or an integrated development environment (IDE) that supports Markdown.
- VSCode is reccomended as it has full language integration with syntax highlighting and its own language server.
- A basic understanding of programming concepts, such as variables, functions, and control structures.
Setting Up Loki
Download the latest compiler from the Official Loki Releases page. Follow the installation instructions for your operating system.
Once installed, you can verify that Loki is working correctly by running the following command in your terminal:
loki --version
This should display the version of Loki you just installed.
Next, you'll want to install the integration package for your chosen game engine. You can find more info at the Integration Packages Site
Follow the installation instructions for your target game engine.
Writing Your First Script
There are several ways to use loki and this may change depending on the integration package you are using. This guide assumes for learning purposes that you will be using the built in command line tool to write and compile your loki projects. To learn more about each Integration Package, visit the Integration Packages Site
Step 1: Create a New Project
To start open your command line tool and enter the commands
mkdir my-loki-project
cd ./my-loki-project
loki new my-loki-project
This will create a new loki project in your local user directory
Step 2: Creating Your First Loki File
Open the my-loki-project folder in your chosen text-editor/IDE and create a new file called MyFirstLoki.loki.
In this file write:
#HelloWorld:1
Hello, World!
Step 3: Build the Loki Project
Open your command line tool and navigate to your project directory. Run the following command:
loki build
This will create a file called my-loki-project.lid under the bin/output/ directory in your loki project. This is the file that you will use in your chosen game engine.
Conclusion
Congrats! You have written your first loki file and are ready to create high quality interactions in your games!
Go fourth and create!