Coder Social home page Coder Social logo

novelogic's Introduction

Novelogic

Create interactive fictions in your Godot games.

VSC Extension

Get Started

Enable Novelogic in Project Settings > Plugins.

func _ready():
    ... # Novelogic.signal_name.connect(...)
    var timeline = Novelogic.load_timeline("/path/to/file")
    Novelogic.start_timeline(timeline)
...
func _on_button_pressed():
    Novelogic.handle_next_event()

Label

Novelogic uses four whitespaces at the beginning of a line to create or increase the indentation level.

@label
    ...
    @sub_label
        ...
    <> label_call
-> label_jump

@label_call
    ...
# Return where label called.
<-

@label_jump
-> timeline_jump

@timeline_jump
-> timeline@label

@timeline_jump_with_variables
<> timeline@label

Assignment

# Timeline variables
hp_max = 100
# hp = hp_max if hp is not defined
hp ?= hp_max
rate = 150
damage = randi_range(10, 20)
hp -= damage * rate / 100
game_over = hp <= 0
log = "HP: {hp}/{hp_max}"

# Global variables
player.name = "You"
count.game_over = 0
flag.stage_clear = true

Condition

if a > 0:
    a is greater than 0.
elif a < 0:
    a is less than 0.
else:
    a is 0.

Text

signal text_started(text: String)
Hello world!

Hello,
{player.name}!

Dialogue

signal dialogue_started(dialogue: String, who: String)
"Hello, {player.name}!"

player: "Hi!"

Choice

signal choice_started(choices: PackedStringArray)
...
func handle_choice(choice: String):
* "I have no choice.":
...

* "No thanks.":
    ...
* "Buy it!" when money >= 10000:
    ...
...

Input

signal input_started(prompt: String)
...
func handle_input(text: String, escape: bool = true):
player.name = ? "What's your name?"

Call

class_name MyExtension extends ExprExtension
...
func do_something(...):
    ...
func _ready():
    Novelogic.ext = MyExtension.new()
do_something(...)

novelogic's People

Contributors

aistra0528 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.