Skip to content

Getting started ​

This guide takes you from a fresh GRC install to your first working script: a weapon that talks to the server and gets an answer back. It takes about 10 minutes.

How it works ​

Your server is hosted for you. You never run or install server software. You work on it through two apps:

AppWhat you use it for
GRC (Remote Control)Everything a developer does: writing scripts, editing levels, uploading images and animations, managing players, server options, databases and collections.
The game clientPlaying on your server to test what you've built.

Everything you write lives on the server. You write scripts in TypeScript in GRC's editors. When you save, the server compiles them and runs them. Serverside code runs on the server; clientside code (*.client.ts) is sent to each player's game client and runs there.

What you need ​

  • GRC and the game client, installed. Download both from the Mytharyn website's Download page.
  • An account. Create one on the game client's sign-in screen. The same email and password sign in to GRC.
  • Your server's address (host and port), from your host.
  • Staff access. Your account must be on the server's staff list. Ask whoever owns the server, or your host for a brand-new server. Staff rights decide which GRC windows you can open. See Staff rights & server options.

1. Sign in to GRC ​

Open GRC and fill in the sign-in form:

FieldValue
ServerYour server's host and port
Auth serviceLeave the default unless your host gives you a different one
Email / PasswordYour account

Once connected, the main window shows the live server log and staff chat. The toolbar along the top opens GRC's other windows:

WindowUse it to
PlayersSee who's online; right-click a player to warp, kick, grant or revoke weapons, or edit their attributes
File BrowserBrowse, upload, download, rename and delete the server's files (levels, images, sounds, …)
Server OptionsEdit the server's name, start level and position, staff list, startWeapons and custom options
Folder ConfigChoose which folders hold levels, animations, images and sounds
Scripts / Weapons / Classes / LibScript editors (see below)
GANI EditorCreate and edit character animations
Level EditorPaint levels and place NPCs (and edit their scripts)
SQL ExplorerInspect and edit the server's SQLite databases
CollectionsDefine and inspect replicated collections
AI AssistantConnect an AI coding assistant to your server's scripts. See Debugging & tooling

Buttons you don't have the rights for are greyed out.

2. Join your server in the game client ​

Sign in to the game client. You land on the Login Server, the lobby every player passes through. Pick your server from the server list, and you'll spawn at its start level. Keep the game client open next to GRC: most changes you save in GRC show up in the game straight away.

3. The script editors ​

Scripts are grouped into four editors, one per script family. Each opens on its own folder:

EditorFolderHolds
Scriptsscripts/Plain server scripts such as login.ts
Weaponsscripts/weapons/Weapons, the main building block for player features
Classesscripts/classes/Shared behaviour that scripts and NPCs join()
Libscripts/lib/Shared modules you import

See Script types & project layout for what each family is for.

The editors are full TypeScript editors: IntelliSense, hover docs and type errors for the whole scripting API. They use the same typings as the API reference on this site.

When a script has a serverside file and a clientside file with the same name (hello.ts and hello.client.ts), GRC shows them as one entry with Serverside and Clientside tabs.

4. Your first weapon ​

A weapon is the basic unit of player-facing scripting. It has up to two halves with the same name:

  • hello.ts runs on the server. There is one instance, shared by every player who has the weapon.
  • hello.client.ts runs on each player's client, for that player only.

The two halves talk with triggerServer and triggerClient. Let's make /hello ask the server to count greetings and answer back.

Create the files ​

  1. Open the Weapons editor.
  2. Right-click the folder at the top of the file tree and choose New file…. Name it hello.client.ts.
  3. The file opens on its Clientside tab. Its Serverside tab (hello.ts) is created the first time you save something in it.

Clientside half ​

Paste this into the Clientside tab:

ts
// Clientside half of the hello weapon: runs on the player's own client.

export function onCreated() {
    echo(`hello weapon loaded for ${player.account}`)
    this.greeted = 0
}

export function onPlayerChats(who: ChatPlayer, chat: string) {
    // Only react to our own chat, not to other players in the level.
    if (who.id !== player.id || chat !== '/hello') return
    triggerServer('weapon', this.name, 'hello')
}

export function onActionClientSide(action: string, count: number) {
    if (action === 'greeted') {
        this.greeted++
        player.chat = `The server has greeted ${count} player(s)!`
    }
}
  • onCreated runs when the weapon loads on the client. State you keep on this (like this.greeted) stays there between handler calls.
  • onPlayerChats fires for chat in your level. Chat that starts with / never leaves your client, which makes it a good place for commands.
  • triggerServer('weapon', this.name, …) calls the serverside half of this weapon. this.name is the weapon's name, "hello".

Serverside half ​

Paste this into the Serverside tab:

ts
// Serverside half of the hello weapon: runs once on the server, shared by
// every player who has the weapon.

let greetings = 0

export function onActionServerSide(player: Player, action: string) {
    if (action !== 'hello') return
    greetings++
    echo(`${player.account} said hello (${greetings} so far)`)
    // Answers the clientside half of this weapon on the same player's client.
    triggerClient('weapon', this.name, 'greeted', greetings)
}
  • onActionServerSide(player, ...params) receives every triggerServer aimed at this weapon, with the calling Player first.
  • Module-level variables like greetings live as long as the script, and every player shares them.
  • triggerClient answers the current player, the one whose event is being handled, on the clientside half's onActionClientSide.
  • echo prints a line to the server log in GRC's main window.

Handlers must be function declarations

Handlers run with this bound to the script. Arrow functions ignore that binding, so always write function onCreated() {} rather than const onCreated = () => {}.

Save ​

Click Save. With Reload on save ticked (the default), the server recompiles just this weapon and hot-swaps it. Nobody has to reconnect. The bar above the editor shows what was swapped, plus any compiler messages.

Compile errors

Type errors are reported but don't block loading, so read the messages under the reload bar and in the server log. A script with a syntax error fails to build and isn't swapped in, while every other script still compiles. See Debugging & tooling.

Grant the weapon ​

Players only run weapons they've been granted. Give it to yourself now:

  1. Open the Players window.
  2. Right-click your account and choose Grant weapon….
  3. Enter hello.

The weapon loads in your game client right away. To give it to every player when they join, open Server Options, add it to startWeapons ("startWeapons": ["hello"]) and click Apply.

Try it ​

In the game client, open the chat bar (Tab or Enter) and type /hello. Your player says "The server has greeted 1 player(s)!", and GRC's log shows the echo line.

Now change the reply text in the Clientside tab and save again. The next /hello uses the new text. This is the loop you'll use for everything: edit, save, test in the game client.

Where to next ​

  • Execution model: batching, this, timers and await. Read this before writing anything big.
  • Events & triggers: every event handler, by script type.
  • Tutorials: complete systems built step by step (chat commands, HUD, shops, guns, NPCs, lighting, particles, leaderboards).
  • API reference: every function, global and interface.