1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 08:39:30 +00:00
game scripting engine and language
Find a file
2022-10-03 14:43:48 +09:00
interpreter Code style cleaning 2022-10-03 14:43:48 +09:00
parser Add anonymous functions 2022-09-28 14:56:31 +09:00
stdlib Add anonymous functions 2022-09-28 14:56:31 +09:00
test Add anonymous functions 2022-09-28 14:56:31 +09:00
.gitignore Changed a few things 2021-06-03 15:29:25 +02:00
anselme.lua Bump version 2022-09-28 18:44:06 +09:00
anselme.md Add anonymous functions 2022-09-28 14:56:31 +09:00
common.lua Also copy keys when copying variables 2022-09-09 12:19:50 +09:00
init.lua Rewrite 2020-05-24 20:31:09 +02:00
LANGUAGE.md Add anonymous functions 2022-09-28 14:56:31 +09:00
LICENSE Updated documentation; added Lua API documentation 2022-01-20 01:49:52 +01:00
notes.txt Code style cleaning 2022-10-03 14:43:48 +09:00
README.md Update README, bump version 2022-09-13 19:34:34 +09:00
TUTORIAL.md Update README, bump version 2022-09-13 19:34:34 +09:00

Anselme

The overengineered dialog scripting system in pure Lua.

Whatever is on the master branch should work fine. Documentation and language are still WIP and will change. I am using this in a project and modify it as my needs change. Breaking changes are documented in commit messages.

Purpose

Once upon a time, I wanted to do a game with a branching story. I could store the current state in a bunch of variables and just write everything like the rest of my game's code. But no, that would be too simple. I briefly looked at ink, which looked nice but lacked some features I felt like I needed. Mainly, I wanted something more language independant and less linear. Also, I wasn't a fan of the syntax. And I'm a weirdo who make their game in Lua and likes making their own scripting languages (by the way, if you like Lua but not my weird idiosyncratic language, there's actually some other options (Erogodic looks nice)).

So, here we go. Let's make a new scripting language.

Anselme ended up with some features that are actually quite useful compared to the alternatives:

  • allows for concurently running scripts (a conversation bores you? why not start another at the same time!)
  • allows for script interuption with gracious fallback (so you can finally make that NPC shut up mid-sentence)
  • a mostly consistent and easy to read syntax based around lines and whitespace
  • easily extensible (at least from Lua ;))

And most stuff you'd expect from such a language:

  • easy text writing, can integrate expressions into text, can assign tags to (part of) lines
  • choices that lead to differents paths
  • variables, functions, arbitrary expressions (not Lua, it's its own thing)
  • can pause the interpreter when needed
  • can save and restore state

And things that are halfway there but should be there eventually (i.e., TODO):

  • language independant; scripts should (hopefully) be easily localizable into any language (it's possible, but doesn't provide any batteries for this right now). Defaults variables use emoji and then it's expected to alias them; works but not the most satisfying solution.
  • a good documentation (need to work on consistent naming of Anselme concepts, a step by step tutorial)

Things that Anselme is not:

  • a game engine. It's very specific to dialogs and text, so unless you make a text game you will need to do a lot of other stuff.
  • a language based on Lua. It's imperative and arrays start at 1 but there's not much else in common.
  • a high-performance language. No, really, I didn't even try to make anything fast, so don't use Anselme to compute primes.

Example

Sometimes we need some simplicity:

HELLO SIR, HOW ARE YOU TODAY
> why are you yelling
    I LIKE TO
    > Well that's stupid.
        I DO NOT LIKE YOU SIR.
> I AM FINE AND YOU
    I AM FINE THANK YOU

    LOVELY WEATHER WE'RE HAVING, AREN'T WE?
    > Sure is!
        YEAH. YEAH.
    > I've seen better.
        NOT NICE.

WELL, GOOD BYE.

Othertimes we don't:

TODO: stupidly complex script

See TUTORIAL.md for a short introduction (not yet done).

Reference

See LANGUAGE.md for a reference of the language.

See anselme.md for the Lua API's documentation.