Guide to the Godot game engine/The basics

Plugins are powerful. People have made image editors, spritesheet makers, height-map terrains and fog. With the right knowledge and skills, along with the right resources, you can make almost anything. And this guide will help with that.

First, let's start simple. To make a plugin, you need to create a script that extends EditorPlugin.

1. Go to the Script tab. Press "File", "New Script..." and a popup will appear.

2. Change "Inherits" to "EditorPlugin". Press the folder next to "Path". Create an "addons" folder (lowercase "a") in the "res" dir. If the folder already exists, just open it. Create a new folder. Call it "My plugin". Set the script name to "main.gd". Press "Open" and "Create".

3. Put tool at the very top of the script. Do not forget this! Then type the following code:

func _ready():
  print("Hello!")

4. Open a text file editor, and write this text:

[plugin]
name="My first plugin"
description="This is my first plugin!"
author="Your name"
version="0.0.1"
script="main.gd"

5. Save the file as "plugin.cfg" in the same folder as "main.gd".

6. Go to "ProjectSettings", open the "Plugins" tab and search for your plugin. If it is not there, press "Update". Check the box next to "Enable".

7. Check the "Output" dock. You should see "Hello!" printed on it.


Guide to the Godot game engine

Getting started [edit]
Installation
What is a node?
Programming
Resources and importing
Signals and methods
Your first game
Making it work
Debugging
Input
Physics
Saving and loading
Multiplayer
Making it look good
UI skinning
Animation
Advanced help
Servers (singletons)
Platform specific
Optimisation
Encryption
Exporting
Plugins
Miscellaneous
Helpful links
Authors and contributors
Print version


back to top next -->