Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@

A timer for CrossCode! It can also be used as an AutoSplitter for LiveSplit.

## Installation
# Installation

1. Install [CCLoader](https://github.com/CCDirectLink/CCLoader).
2. Download and extract [CCTimer](https://github.com/CCDirectLink/CCTimer/archive/master.zip).
3. Put the timer directory in the `assets/mods` directory.
4. To connect LiveSplit to CCTimer to LiveSplit add an AutoSplitter to your layout and set the script path to `<CrossCode Root Directory>/assets/mods/timer/CrossCode.asl`.
2. Download CCTimer through the mod manager.

# Livesplit

Livesplit is only available on Windows.
To connect LiveSplit to CCTimer to LiveSplit add an AutoSplitter to your layout and set the script path to `<CrossCode Root Directory>/assets/mods/timer/CrossCode.asl`.

# Livesplit One

Livesplit One is a web version of Livesplit and works on any platform.

## Setup
1. Download [CCSpeedrunResources](https://github.com/CCDirectLink/CCSpeedrunResources), place it somewhere and unzip it
2. Copy all the contents of `CCSpeedrunResources/CATEGORY-OF-CHOISE/CCTimer Autosplitters` into `CrossCode/assets/mods/timer/`
4. Go to the [one.livesplit.org](https://one.livesplit.org) website
5. `Splits` -> `Import` -> `CCSpeedrunResources/CATEGORY-OF-CHOISE/Livesplit Blank Splits/CrossCode - CATEGORY`
6. Click the folder icon on the split after importing
7. `Back`

## Things to do every time
1. Launch the game
2. Go to the [one.livesplit.org](https://one.livesplit.org) website
3. `Connect to Server` -> paste `ws://localhost:5000`
4. A message saying `Connected to server` should pop up in the bottom left corner
5. The timer should start when you click `New Game` in CrossCode

# Creating splits

## Configuration

Expand Down Expand Up @@ -270,4 +294,4 @@ Note: Time and State settings will be derived from the main `settings.json` auto

A **Reset Splits** hotkey is also optionally included, which can be relevant in cases where you need a `"start"` condition to fire without relying on loading a preset or starting at New Game.

To make use of this, you'll need to install [input-api](https://github.com/CCDirectLink/input-api).
To make use of this, you'll need to install [input-api](https://github.com/CCDirectLink/input-api).
2 changes: 1 addition & 1 deletion ccmod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "timer",
"version": "3.0.2",
"version": "3.0.3",
"title": "CCTimer",
"description": "A speedrun timer for CrossCode.",
"repository": "https://github.com/CCDirectLink/CCTimer",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "esbuild --target=es2018 --format=esm --platform=node --bundle --sourcemap=inline --outfile=plugin.js src/plugin.js",
"watch": "esbuild --target=es2018 --format=esm --platform=node --bundle --sourcemap=inline --watch --outfile=plugin.js src/plugin.js"
},
"version": "3.0.2",
"version": "3.0.3",
"ccmodDependencies": {
"ccloader": "^2.19.0"
},
Expand Down
16 changes: 8 additions & 8 deletions src/livesplitone.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ export class LiveSplitOneServer {
});
}

_sendCommand(name) {
_sendCommand(command) {
if (this.wsList) {
for (const ws of Array.from(this.wsList)) {
ws.send(name);
ws.send(JSON.stringify(command));
}
}
}

sendStart() {
this._sendCommand('reset');
this._sendCommand('start')
this._sendCommand({ command: 'reset' });
this._sendCommand({ command: 'start' })

Utils.log('Sent start');
}
Expand All @@ -65,11 +65,11 @@ export class LiveSplitOneServer {
*/
sendIgt(value) {
console.log('sendIgt:', value)
this._sendCommand(`setgametime ${value}`)
this._sendCommand({ command: 'setGameTime', time: value.toString() })
}

sendSplit() {
this._sendCommand('split')
this._sendCommand({ command: 'split' })

Utils.log('Sent split');
}
Expand All @@ -80,9 +80,9 @@ export class LiveSplitOneServer {
*/
sendPaused(paused) {
if (paused) {
this._sendCommand('pausegametime')
this._sendCommand({ command: 'pauseGameTime' })
} else {
this._sendCommand('resumegametime')
this._sendCommand({ command: 'resumeGameTime' })
}
}
}