Skip to content

Instantly share code, notes, and snippets.

@BrastenXBL
Last active June 16, 2025 02:04
Show Gist options
  • Save BrastenXBL/0bf2d7cd9c20662a70960131481cf08b to your computer and use it in GitHub Desktop.
Save BrastenXBL/0bf2d7cd9c20662a70960131481cf08b to your computer and use it in GitHub Desktop.
Action Game Marker, Visual Script debugging, GDScript tools

This Gist is an initial collection of in progress tools for debugging the Visual Scripting language in GotchaGotchaGames' Action Game Maker fork of the Godot Editor.

These GDScripts extension that can be assigned to the Script property for VisualScriptAction (States) and VisualScriptActionLink (Links) to add additional debugging and execution tracking options. This is not yet a full plugin repository because this very much in rough Alpha state. The public knowledge of avaliable AGM APIs is limited https://guild.rpgmakerofficial.com/t/topic/35 .

If you have suggestion or would like to contribute, the current working thread is on https://guild.rpgmakerofficial.com/t/topic/213 . The goal is to either demonstrate or create debugging tools that no/limited coding designers can use to troubleshoot their Visual Scripts.

Check Gist commit history for changes.

AGM API assumptions:

GameObject that executes VisualScripts is a CharacterBody2D. It is unknown how or if VisualScript is split between _process and _physics_process. For safety modifying Conditions and Actions arrays should be done by call or set deferred. Same for directly modifying Condition and Action resources. Let AGM finish the frame, then update any arrays or properties. If dynamic changes are executed from a Node, use _physics_process.

AGM API facts:

https://guild.rpgmakerofficial.com/t/topic/35

extends VisualScriptAction
## Enabled: Adds a PrintMessageToConsole
@export var debug_action : bool = true :
set(v):
if v:
_add_print_action.call_deferred()
else:
_remove_print_action.call_deferred()
debug_action = v
var _print_action : Actions = PrintMessageToConsole.new()
var _print_action_at_index : int = -1
func _init() -> void:
_print_action.print_message = visual_script_node_title + " entered."
func _add_print_action() -> void:
other_actions.append(_print_action)
_print_action_at_index = other_actions.size() - 1
func _remove_print_action() -> void:
if _print_action_at_index > -1 and other_actions.size():
if other_actions[_print_action_at_index] == _print_action:
other_actions.remove_at(_print_action_at_index)
else:
push_warning("Could not find action at last know index " + str(_print_action_at_index) + ". Searching other_actions arry.")
for i in other_actions.size():
if other_actions[i] == _print_action:
other_actions.remove_at(i)
return
push_error("Could not remove debug _print_action action.")
# debug_vsal.gd
extends VisualScriptActionLink
# Todo: move State entering detection to Links? Register link Conditions to a Debugger?
# Not possible. VisualScriptActionLink have no API methods for reporting they've been evaluated.
# An alternate solution is needed or additions to the AGM APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment