Skip to content

Instantly share code, notes, and snippets.

@Not-A-Normal-Robot
Last active January 18, 2023 11:22
Show Gist options
  • Save Not-A-Normal-Robot/82ddc1d13474193194f5b45c1692717b to your computer and use it in GitHub Desktop.
Save Not-A-Normal-Robot/82ddc1d13474193194f5b45c1692717b to your computer and use it in GitHub Desktop.
Techmino Development Guide

Introduction

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.

1. Basics

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.

1.1. Lua

  • 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 of list[0].
  • Lua's "not equal to" operator is ~= instead of the usual !=. To do normal not operators, just use the word not followed by the variable/boolean function.

1.1.1. Lua's data types

Lua has only a few types. Here are some of the notable ones:

  • nil - holds no data. Known as null 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 becomes Infinity. The decimal separator is a ., regardless of your region. Also known as a double 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"}

1.2 Modes and Eventsets

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.

2. Getting the source code of Techmino

There are 2 good ways to do this:

2.1. Using GitHub Desktop

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 click Clone 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.

It should look something like this: image

  • 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 on Clone 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 into C:\Techmino_Code\Zframework. It should look something like this: Tutorial

Another way of getting the source code is by...

2.2. Extracting the .exe

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

3. Running the source code

Okay, so you got your source code. Here's how you can run it.

Here's a handy description of what the stuff on the left does:
image

Click the Explorer tab. You should see this pop up on the left:
image

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:
image

It should now look a little something like this:
image 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:
image (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment