Skip to content

Commit

Permalink
feat: Added print command to print output at any debug level (#564)
Browse files Browse the repository at this point in the history
Co-authored-by: Balloonpopper <[email protected]>
  • Loading branch information
balloonpopper and Balloonpopper authored Apr 5, 2022
1 parent 27c15d7 commit 3e80abf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions addons/escoria-core/game/core-scripts/esc/commands/print.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `debug string [string2 ...]`
#
# Prints a message to the Godot debug window.
# Use this for debugging game state.
#
# **Parameters**
#
# - *string*: The string to log
#
# @ESC
extends ESCBaseCommand
class_name PrintCommand


# Return the descriptor of the arguments of this command
func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new(
1,
[TYPE_STRING],
[""]
)


# Run the command
func run(command_params: Array) -> int:
print(command_params[0])
return ESCExecution.RC_OK
1 change: 1 addition & 0 deletions game/rooms/room10/esc/room10.esc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

:setup
print "This is room 10"

> [eq ESC_LAST_SCENE room9]
teleport player r10_l_exit
Expand Down

0 comments on commit 3e80abf

Please sign in to comment.