Command Console

# Course Introduction

You can use various commands from the Command Console to execute specific actions. You can search all entities using specific properties or use them for debugging. Let's learn how to use the Command Console.

# Command Console Introduction

Open the Command Console window by clicking Panel - Command Console. [png](17307099056193c94fbbdb3df4c6fb3c5047b65b20282)

#### Screen Intro

[png](1730788005872cf5bfbc44751472087b21b2871280fc4)

[{"Number":"!","Name":"Result Window","Description":"Displays the executed command's results."},{"Number":"!","Name":"Input Window","Description":"This is where you input commands. Execute the function by pressing 'Enter' after inputting a command."}]

# Using Commands

After inputting a command, the resulting value after the execution will be output in the Command Console result window or in the console window as a log.

#### Types of Commands

Only commands that were pre-set in MSW can be used. When using a command, the proper command and parameter variables must be input. When inputting the parameter variables, the proper order must be observed. The following commands can be used in the console. Each command's parameter variables and options can be seen from [Console Command](/docs?postId=1195%7B%22target%22:%22_blank%22%7D).

[{"Command Name":"help","Description":"Output the available commands and their descriptions."},{"Command Name":"echo","Description":"Output the entered message as-is in the results window."},{"Command Name":"export","Description":"Send the file to the set path. You can only send out scripts, code blocks, data sets, and user data set entries."},{"Command Name":"import","Description":"Load the file to the set path."},{"Command Name":"findentity","Description":"Search for a specific entity from the hierarchy. You can search entities on all maps."},{"Command Name":"findcomponent","Description":"Search for specific components from the hierarchy. You can search across all maps."},{"Command Name":"findproperty","Description":"Search for specific properties in the hierarchy. You can search across all maps."},{"Command Name":"play","Description":"Play the world. Execute in debug mode or add a virtual player."}]

> Tip You can execute the 'help command name' if you want to view directly from the Command Console.
> 
>   * Command List Search Example: help all, help findentity
> 


# Basic Syntax

Basic syntax is categorized as commands, parameter variables, and options. Only spaces are used to categorize them. An error will trigger if a ',' or another symbol is used. '[]' signifies a parameter variable or option that the creator can use selectively. Command syntax is comprised as follows.
    
    
    @Component
    script BaseBehavior extends Component
    end
    

### Parameter Variables

Parameter variables must be input and must follow the set sequence. For example, src_path are dest_path parameter variables for export, so to use export, you would need to type export "MyDesk/NewComponent" "C:\Test".

### Options

Provides various options for each command. Options can be freely selected based on the creator's intentions for the command. There are no rules for the order of writing options, so the creator can set the order as they deem fit. A '-' should be placed in front of the option name when using options. Options can also have parameter variables. In this case, an option's parameter variable must be written and used in order. For example, for - debug for the play command, since it has no variable, you only have to enter 'play -debug' to execute debug mode. However, using -virtual will require parameter variables, so it must be written like 'play -virtual_player 5' to add 5 virtual players.

# stream

You can use stream as an option parameter variable. Stream is used when sending or loading values from specific files. The results can be ouput in the form of a file as well. The command's results log and error log will be output as a file if stream is passed over with '-out' or '-err' option parameter variables. A '$' needs to be attached in front of the path to ouput as a file. For example, if you enter 'echo $"C:\Test/file.txt"', the file path's value will pass to an argument. On the other hand, when 'echo "C:\Test/file.txt"' is entered, the whole input will be passed to an argument. When you write a command like the following, the results log and error log files will be ouput as a file following the file path set as the parameter variable.
    
    
    @Component
    script GenericComponent extends Component
    end
    

# Path

The file path and maker entry path need to follow the rules below when using commands.

  * File Path: Follow the file path notation system under policy.
  * Workspace Path : Enter in order starting from MyDesk. 
    * Example: MyDesk/Images/Test_Sound_01.ogg
  * Hierarchy Path: Categorize in order starting from World. 
    * Example: World/ui/UIGroup/UIEmpty



# Log

When executing a command written by the creator, the results will be shown in the form of a log in the console window. Logs that are ouput by command use results are categorized as normal logs, command result logs, and error logs.

#### Normal Logs

Normal logs are logs that are delivered to the creator like command execution results. For example, when using the import command, a log that indicates completion will display when the file is loaded.

#### Result Logs

Results that can be obtained from commands are categorized as result logs. For example, when using the findentity command, the found entities will be shown as a result log.

#### Error Logs

Logs that display when an issue arises while a command is executed are classified as error logs. For example, if there are any invalid paramter variables for a command, an error log will be triggered.