This guide will teach you how to code modes, eventsets, language files, and more.
Knowing the basics of programming logic is recommended before developing in Techmino.
Feel free to suggest ideas. If you need help, you should use #ask-for-help-read-pins.
This guide is currently in development. Last updated 18 Jan 2023
.
Migrated from the Discord in 14 Nov 2022
.
The game uses a scripting language called Lua
.
It uses a game engine called LÖVE
, also commonly referred to as LOVE
or love2d
.
You can get a guide for Lua
in https://www.lua.org/manual/5.1/manual.html.
You can also get a guide for love2d
in https://love2d.org/wiki/Main_Page.
- Lua's tables start with an index of 1 instead of 0. Because of this, to get the first element of an array, you use something like
list[1]
instead oflist[0]
. - Lua's "not equal to" operator is
~=
instead of the usual!=
. To do normal not operators, just use the wordnot
followed by the variable/boolean function.
Lua has only a few types. Here are some of the notable ones:
nil
- holds no data. Known asnull
in other programming languages.boolean
- is either true or false (1 or 0). Usually used for storing conditions.number
- 64 bit floating point number.
It goes until around
1e308
, and after that, it becomesInfinity
. The decimal separator is a.
, regardless of your region. Also known as adouble
in other programming languages.
string
- contains text. You can make one using either"
s or'
.
Example:
"testing"
,'info'
function
- is a variable containing code.
You can run it by putting the variable name, followed by
(
, some parameters if necessary (separated by commas), and then closing it off with a)
. Example:math.floor(5.2)
table
- contains other variables. You can think of it as a list. You can even put tables in a table!
To make a table, just put a
{
followed by its elements (optional) separated by commas, then close it off with a}
. You can even put custom values as the index if you do something like Example 2. Example 1:{0, 1, 2, 3, 4, 5}
Example 2:{[3]=0, [5]=1, [test]="none"}
Eventsets contain most of the core logic of a mode. It's also commonly referred to as a ruleset. You can even change your eventset in Custom Game; look for the Rule Set
setting!
You can think of eventsets as the "core" of a mode.
Modes usually contain the grading system (e.g. how many seconds do you have to complete the mode to get X rank?), among a few other things, like the starting state of the game, and the starting music of the game. You can think of a mode as the "shell" of an eventset.
There are 2 good ways to do this:
Doing this is a bit more complex but usually worth it if you want to contribute.
Pros:
- You can easily upload your work into GitHub.
- You can have multiple branches so you can work on multiple features.
- You can update the source code easily.
Cons:
- You have to have a GitHub account.
- It can be more complex (you can get used to it; don't worry. Feel free to ask for help in the Discord.)
Click here to reveal the steps.
- Sign up on GitHub, if you don't have an account.
- Sign in on GitHub.
- Download GitHub Desktop on https://desktop.github.com/.
- While it's downloading, fork Techmino:
- Go to https://github.com/26F-Studio/Techmino/.
- Click the
Fork
button near the top right of your screen. - Create the fork.
- After it downloads, install GitHub desktop by opening the
.exe
file you got from the GitHub Desktop website. Don't worry, it assists you on installing. If you ever need help, you can ask in the Discord. - After installing GitHub Desktop, sign in to it.
- After that, click on
File
, then clickClone repository
.
Cloning means downloading the source code.
- Then, find your fork/repository, click on it, and optionally select the directory you want to clone to.
- After that, you can click
Clone
and it will clone the repository. - While waiting for it to complete, clone Zframework with the steps below.
- Click on
File
, then click onClone repository
. - Near the top of the pop-up, click on
URL
. - Input
26F-Studio/Zframework
into the "repository name" text box. - Clone into
[Techmino source code directory] > Zframework
.
Example: if you cloned Techmino into
C:\Techmino_Code
, clone Zframework intoC:\Techmino_Code\Zframework
. It should look something like this:
Another way of getting the source code is by...
Pros:
- Slightly easier to do
Cons:
- You can't contribute to the repository immediately
- You need to redo this again if you want to update; there's no 1-click solution
- Takes a while to download
- In the long run, worse than using GitHub Desktop
Click here to reveal the steps.
Steps:- Download Techmino if you haven't:
Latest release version: https://github.com/26F-Studio/Techmino/releases/latest Snapshot version: https://github.com/26F-Studio/Techmino/actions (needs GitHub account) To download the snapshot:
- click on the topmost entry in the list (the one that has a checkmark/X sign and has text saying something along the lines of
Techmino Develop CI
)- scroll down and download the artifact that matches your current OS
Okay, so you got your source code. Here's how you can run it.
- Download and install love2d from https://love2d.org/
- Then, install Visual Studio Code from https://code.visualstudio.com/
- Then, install these Lua and Love2D extensions:
- https://marketplace.visualstudio.com/items?itemName=sumneko.lua - for colorcoding the code, auto-correct and other features
- https://marketplace.visualstudio.com/items?itemName=pixelbyte-studios.pixelbyte-love2d - so you can automatically run the game when you save for debugging purposes (toggleable). Also includes a "run game" hotkey.
- In the "main menu" of Visual Studio Code (which we'll call VSCode to save time from now on), click on Open Folder:
- Navigate to where the source code of the game is. It should look something like this:
- Click "Select Folder".
- It will look a little something like this:
Here's a handy description of what the stuff on the left does:
Click the Explorer tab. You should see this pop up on the left:
We're gonna get to what those files do in the future. For now, we're going to demonstrate how to open Techmino from within VSCode.
Open up main.lua
by clicking on the main.lua
file:
It should now look a little something like this:
Note the
Debug
and RunOnSave
buttons.
Debug
: Whether or not to launch Techmino with an attached cmd-like console. Useful for debugging. Text is outputted there whenever the print()
function is called in-game.
RunOnSave
: You guessed it; whether or not to launch Techmino whenever you save a file. Useful for checking out if your code actually works quickly.
Now that we know how stuff works, let's actually turn on RunOnSave
and press Ctrl+S
to save the main.lua
file. You don't even need to edit the script.
After you do that, your screen should look a little something like this:
(ignore the "happy chinese new year" notification on the top-left.)
To be continued...
If you need any help, go ask in Techmino's official Discord server.