Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

DokiVN - Visual Novel Lib

An asset by QJPG
The page banner background of a mountain and forest
DokiVN - Visual Novel Lib hero image

Quick Information

0 ratings
DokiVN - Visual Novel Lib icon image
QJPG
DokiVN - Visual Novel Lib

DokiVN is inspired by the "renpy" language, making it easy to program dialogues and interactions of a Visual Novel using only GDScript

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

DokiVN is inspired by the "renpy" language, making it easy to program dialogues and interactions of a Visual Novel using only GDScript.

README image

  • Hello, World w/ DokiVN Lib:
extends Node

var s := Scripted.new()
var e : VNChar

@export var text : RichTextLabel
@export var author : Label

func _init() -> void:
    s.from = self
    e = s.character().name("Eileen").color(Color.GREEN)

func _on_name(response : String) -> void:
    s.layer_init()
    s.alert("Hello, %s!" % response)
    s.layer_start()
    return

func _on_yes() -> void:
    """
    Layers are needed to create coroutines in the main routine.
    """
    
    s.layer_init()
    e.says("[b]Nice!![/b]")
    e.says("...")
    s.entry("What is your name?", "", "Insert your name:", true, _on_name)
    e.says("Hehe......")
    s.layer_start()
    s.resume()

func _on_no() -> void:
    s.layer_init()
    e.says("Sorry! :(")
    s.layer_start()
    s.resume()

func _ready() -> void:
    s.says("This is a dialogue without an author!")
    s.hide()	#Set Opacity to 0
    s.wait(1.5)
    e.says("Hello, [wave]Stranger![/wave]")
    s.choices("All good?")\
        .option("Yes!", _on_yes)\
        .option("Leave me alone! :(", _on_no)
    s.pause()	#Wait until a routine unpauses the current routine with ".resume()"!
    s.says("END")
    s.start()

func _process(delta: float) -> void:
    if Input.is_action_just_pressed("ui_accept"):
        s.confirm.emit()	#Skip Dialogs
    
    text.text = s.text_output
    text.modulate.a = s.opacity_output
    text.visible_ratio = s.vrat_output
    
    author.text = s.get_character().attr_name if s.get_character() != null else ""
    author.modulate = s.get_character().attr_color if s.get_character() != null else Color.WHITE
    author.modulate.a = s.opacity_output

DokiVN is inspired by the "renpy" language, making it easy to program dialogues and interactions of a Visual Novel using only GDScript

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
DokiVN - Visual Novel Lib icon image
QJPG
DokiVN - Visual Novel Lib

DokiVN is inspired by the "renpy" language, making it easy to program dialogues and interactions of a Visual Novel using only GDScript

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers