Custom Project Runner's icon

Custom Project Runner 1.1 Tools 3.4 Community

Submitted by user KoBeWi; MIT; 2022-01-27

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/" file, following the comments in the file. The interesting bit are 3 methods:

_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.

Check the repository page for more info and example project.

View files Download Submit an issue Recent Edits