Skip to content

Commit

Permalink
Clarified expected path value for --script
Browse files Browse the repository at this point in the history
Clarified the kind of paths expected by `--script` and how they are interpreted. [Silent errors in recent Godot versions (regressions)](godotengine/godot#96691) made this even more confusing.
  • Loading branch information
Klaim committed Sep 7, 2024
1 parent 72afe8c commit e3cb078
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tutorials/editor/command_line_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ given build type.
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Command | Description |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``-s``, ``--script <script>`` | |release| Run a script. |
| ``-s``, ``--script <script>`` | |release| Run a script. ``<script>`` must be a resource path relative to the project (``myscript.gd`` will be interpreted as ``res://myscript.gd``) or an aboslute filesystem path (for example on Windows ``C:/tmp/myscript.gd``) |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``--check-only`` | |release| Only parse for errors and quit (use with ``--script``). |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -288,15 +288,15 @@ For example, the full command for exporting your game (as explained below) might

godot --headless --path path_to_your_project --export-release my_export_preset_name game.exe

When starting from a subdirectory of your project, use the ``--upwards`` argument for Godot to
When starting from a subdirectory of your project, use the ``--upwards`` argument for Godot to
automatically find the ``project.godot`` file by recursively searching the parent directories.

For example, running a scene (as explained below) nested in a subdirectory might look like this
For example, running a scene (as explained below) nested in a subdirectory might look like this
when your working directory is in the same path:

::

godot --upwards nested_scene.tscn
godot --upwards nested_scene.tscn


..
Expand Down Expand Up @@ -353,7 +353,7 @@ Otherwise, an error will be thrown upon opening the project.
Running the game
----------------

To run the game, execute Godot within the project directory or with the project path as explained above.
To run the game, execute Godot within the project directory or with the project path as explained above.

::

Expand Down Expand Up @@ -453,6 +453,11 @@ And how to run it:
If no ``project.godot`` exists at the path, current path is assumed to be the
current working directory (unless ``--path`` is specified).

The script path will be interepreted as a resource path relative to
the project, here ``res://sayhello.gd``. You can also use an absolute
filesystem path instead, which is useful if the script is located
outside of the project's directory.

The first line of ``sayhello.gd`` above is commonly referred to as
a *shebang*. If the Godot binary is in your ``PATH`` as ``godot``,
it allows you to run the script as follows in modern Linux
Expand Down

0 comments on commit e3cb078

Please sign in to comment.