I want to understand what a piece of code meaans

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Juan

What does this piece of code mean?

func add_command(name, target, target_name = null):
emit_signal(“command_added”, name, target, target_name)
return self._command_service.create(name, target, target_name)

I’d like to add a command to an in-game command console that will allow me to execute certain functions, in the open source game. This is a snippet of code from a template. I’d like to know what it means. Also, how can I use this to add my own command.

It looks like you need a parser.

codelyok13 | 2022-03-16 13:21

:bust_in_silhouette: Reply From: Inces

all You can read from pieces of code like this is:

this is a custom function to trigger custom action and send information about it by signal.

I guess You only thought it is useful, because it had “command” word in it. I doubt You will find recipe for your idea searching like this.