Loreline, a modern and open-source scripting language for writing interactive fiction

Loreline v0.6.0 is out! It’s a modern and open-source scripting language for writing interactive fiction.

With it is coming a documentation to use it as well as a playground to try it. It is written in Haxe, and can be used from Haxe projects, but is also intended to be integrated on non-Haxe project using C#, C++, JS/TS, Python etc… A lot of work and care has been put into this, and there is more to come in the future, I hope you like it!

https://loreline.app/

I think this project is a good use case of using Haxe for delivering tools outside of its own ecosystem. It shows how the toolkit can be used to support many different language and platforms. Feel free to continue the thread here if you want to discuss more about these details, or just want to give some thoughts and feedback!

11 Likes

Interesting project! Much cleaner than Ink and especially Yarn, the number of special symbols in Ink/Yarn make eyes bleed very fast when reading raw script :slight_smile: And not only eyes, as a *really strange* side note regarding syntax (you are warned): I have an experience of writing IF-scripts on mobile devices while travelling, etc… the need to constantly switch for ‘<%@#’/etc special chars on mobile keyboard instantly drains any patience battery in the writer :slight_smile:

Funny, you are the second person today mentioning mobile devices for writing IF. Looks like it could be interesting to explore this use case further :smiley:

1 Like

I like this one. Its grammar looks very easy to learn. :grin:

My child is probably very interested in writing this type of language, and I would recommend it to my child to play with.

1 Like

Cool! If a child can pick up loreline, it would be a very good sign regarding the clarity of the syntax, let me know how it goes :smile:


// character barista
//   name: Barista

// The warm aroma of coffee fills the café.

// barista: Hi there! How are you doing today?

// choice
//   Having a great day
//     barista: Wonderful! Coffee will make it even better.

//   Need caffeine...
//     barista: Say no more! Let me help with that.

//   Your name is Alex, right?
//     barista.name = "Alex"
//     barista: Oh, I didn't expect you'd remember it!

state
  hp: 100
  coin: 1000
  life: [{
    name: 霸王龙,
    hp: 100,
    skill: ["重力咬合", "撕破"]
    lv: 10
  }]

character player
  name: 无名

character loong
  name: 恐龙
  hp:80

现在你在荒郊野岭

这时候出现了一个恐龙,你要使用【${life[0].name}】与它战斗吗?

choice
  开始战斗
    -> Fighting
  逃跑
    if(random(1,100) > 50)
      逃跑成功
    else
      逃跑失败

beat Fighting
  sequence
    战斗已经开始打响,请选择一个技能使用。
  --
    又轮到你选择技能了
  choice
    ${life[0].skill[0]}
      loong.hp -= 30
      if loong.hp < 0
        loong.hp = 0
      对${loong.name}造成了30点伤害,还剩下${loong.hp}点生命值
      if loong.hp == 0
        -> Fightend
      else 
        -> Fighting
    ${life[0].skill[1]}
      没有任何效果
      -> Fighting

beat Fightend
  战斗已结束,获得100经验值

I tried to start doing something!

1 Like

Indeed, it is very suitable for migration to games to achieve a free dialogue system.

1 Like