feat: Added print command to print output at any debug level (#564)
Co-authored-by: Balloonpopper <balloonpopper@git.com>
This commit is contained in:
27
addons/escoria-core/game/core-scripts/esc/commands/print.gd
Normal file
27
addons/escoria-core/game/core-scripts/esc/commands/print.gd
Normal file
@@ -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,5 +1,6 @@
|
||||
|
||||
:setup
|
||||
print "This is room 10"
|
||||
|
||||
> [eq ESC_LAST_SCENE room9]
|
||||
teleport player r10_l_exit
|
||||
|
||||
Reference in New Issue
Block a user