Skip to content

Bobbin VS Code Extension v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Feb 17:09
· 2 commits to main since this release
Immutable release. Only release title and notes can be modified.

Full Changelog: vscode-v0.3.0...vscode-v0.3.0

What's New

Commands System

Dialogue scripts can now trigger game effects through commands — fire-and-forget function calls from dialogue to your game:

extern give_item(name, count)
extern play_sound(name)

You found a treasure chest!
give_item("gold_coin", 50)
play_sound("chest_open")
Take these coins as a reward.

Commands are declared with extern (like host variables) but include parameters. The runtime validates arity at compile time — calling give_item("sword") when it expects 2 arguments produces a clear error.

GDScript Integration

Pass command handlers to Bobbin.create():

var runtime = Bobbin.create(
    "res://dialogue/quest.bobbin",
    {},  # saved_variables
    {"player_name": "Hero", "gold": 100},  # host_state
    {    # commands
        "give_item": func(args): inventory.add(args[0], int(args[1])),
        "play_sound": func(args): AudioManager.play(args[0]),
    }
)

Live Host State

Changes to the host_state dictionary are now immediately visible to the runtime. When a command handler updates host state, subsequent dialogue lines see the new values without explicit sync:

func _on_give_gold(args):
    var amount = int(args[0])
    _host_state["gold"] += amount  # Runtime sees this immediately
give_gold(100)
You now have {gold} gold.  # Shows updated value

Other Changes

  • Syntax highlighting for command invocations in Godot editor
  • Improved error messages for command-related issues
  • Fixed WASM build compatibility with recent Rust toolchain changes

Upgrade Notes

This release is backwards compatible. Existing scripts without commands continue to work unchanged.