Last active
June 2, 2025 22:52
-
-
Save alexanderson1993/0d946801668d321e765a3b12ebe3cbef to your computer and use it in GitHub Desktop.
Thorium Nova timeline example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addTimeline({ | |
name: "Shakedown", | |
steps: [ | |
{ | |
name: "Reactor", | |
execute(ctx) { | |
const shipName = getPlayerShipName(); | |
ctx.doAction("sendMessage", { | |
message: `${shipName}, be sure to activate your reactor before detaching docking clamps`, | |
}); | |
// Automatically goes to the next step | |
ctx.addCheck(() => isReactorActivated(), { | |
// The label is for the Flight Director's benefit so they know what checks are currently active | |
label: "Reactor Activated", | |
}); | |
ctx.addCheck(() => isClampsDetached(), { | |
label: "Docking Clamps Detached", | |
async onChecked() { | |
// If this function is defined, stay on this step unless it does an action to advance. | |
await wait(3000); // Wait for 3 seconds to let them reattach | |
if (isClampsDetached()) { | |
// If still detached, jump to the fiasco step | |
// Navigating to a new step automatically deactivates the checks from this step | |
ctx.doAction("goToStep", "Clamps Fiasco"); | |
} | |
}, | |
}); | |
}, | |
}, | |
{ | |
name: "Clamps", | |
execute(ctx) { | |
const shipName = getPlayerShipName(); | |
ctx.doAction("sendMessage", { | |
message: `${shipName}, now that your reactor is online, you can detach your clamps.`, | |
}); | |
ctx.addCheck(() => isClampsDetached(), { | |
label: "Clamps Detached", | |
onChecked() { | |
// Skip over the fiasco step | |
ctx.doAction("goToStep", "Thrusters"); | |
}, | |
}); | |
}, | |
}, | |
{ | |
name: "Clamps Fiasco", | |
execute(ctx) { | |
const shipName = getPlayerShipName(); | |
// Set a variable so we remember that this fiasco happened | |
ctx.doAction("setVariable", { name: "clampsThenReactor", value: true }); | |
ctx.doAction("sendMessage", { | |
message: `${shipName}, what are you doing? Get your reactor activated before you run out of reserve power!`, | |
}); | |
ctx.addCheck(() => isReactorActivated(), { | |
label: "Reactor Activated", | |
}); | |
}, | |
}, | |
{ | |
name: "Thrusters", | |
execute(ctx) { | |
const shipName = getPlayerShipName(); | |
const didFiascoHappen = getVariable("clampsThenReactor"); | |
ctx.doAction("sendMessage", { | |
message: `${shipName}, ${didFiascoHappen ? "that was a close one. Now" : "now"} that you're clamps are detached, use forward thrusters until you're clear of the docking bay.`, | |
}); | |
}, | |
}, | |
], | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment