Custom Project Runner's icon

Custom Project Runner 1.3.1 Tools 4.0 Community

Submitted by user KoBeWi; MIT; 2023-04-16

Plugin that can run your project and pass some data from editor to your game. For example, you can run the game and spawn player at the position of cursor in the editor to quickly test parts of a level.

Before using the plugin, you need to configure it first by editing "addons/CustomRunner/Config.gd" file, following the comments in the file. There are 3 methods to change:

_can_play_scene() - called when pressing the plugin shortcut (F7 by default). The current scene is passed to that method and if it returns true, the plugin will run the project. You can for example check if this scene is a Level class (if you have one).

_gather_variables() - called before running the project from the plugin. Use add_variable() to add variables that you want to pass from editor to the game. By default it passes "scene" variable, which contains filename of the current scene. There's also an example line that adds current cursor position.

_get_game_scene() - return the main scene you want to run. This should be your "game" scene, i.e. scene that has player, HUD and instantiates the level etc. Leave empty to run the currently opened scene instead.

After the project is started using the plugin, use CustomRunner.get_variable(variable_name) to retrieve the data passed from the editor. You can also use CustomRunner.is_custom_running() to check if the game is running using the plugin and data is available.

You can use Shift + F7 to repeat the last custom run, in case you want to test the same scene multiple times.

Check the repository page for more info and example project. The CustomRunner class also has a documentation.


View files Download Submit an issue Recent Edits