Godot: Base type is not EditorPlugin

Created on 2 Aug 2018  路  8Comments  路  Source: godotengine/godot

Godot version:

3.0.5.stable.custom_build

OS/device including version:

Linux 4.17.4-1-ARCH x86_64 GNU/Linux

Issue description:

Following the plugin tutorial, I get the error:

Unable to load addon script from res://addons/my_custom_dock/custom_dock.gd Base type is not EditorPlugin.

The script does extend EditorPlugin.

Steps to reproduce:

  1. Creat a new project
  2. Creat a plugin.cfg containing:
[plugin]

name="My Custom Dock"
description="A custom dock made so I can learn how to make plugins."
author="Your Name Here"
version="1.0"
script="custom_dock.gd"
  1. Create addons/my_custom_dock/my_dock.tscn with a single button as the root node
  2. Create addons/my_custom_dock/custom_dock.gd with:
tool
extends EditorPlugin

var dock # A class member to hold the dock during the plugin lifecycle

func _enter_tree():
    # Initialization of the plugin goes here
    # First load the dock scene and instance it:
    dock = preload("res://addons/my_custom_dock/my_dock.tscn").instance()

    # Add the loaded scene to the docks:
    add_control_to_dock(DOCK_SLOT_LEFT_UL, dock)
    # Note that LEFT_UL means the left of the editor, upper-left dock

func _exit_tree():
    # Clean-up of the plugin goes here
    # Remove the scene from the docks:
    remove_control_from_docks(dock) # Remove the dock
    dock.free() # Erase the control from the memory
  1. Go to Project Settings - Plugins and enable the plugin
  2. See the error

I wrote the script with an external editor.

Minimal reproduction project:

example.zip

bug editor usability

Most helpful comment

The issue is just the message that is misleading. The problem is that the plugin script couldn't be loaded, likely because a fail in compilation caused by some syntax error.

All 8 comments

Reloading the project resolved the issue.

In my situation (using alpha 1 build) problem still exist, even after restarting project.

Here is reproduce plugin:
https://drive.google.com/file/d/1SYA8wujVZEvuE7NvAqGvTKPTklVWz9Ch

This error breaks one of the best addons for Godot, hope it can get looked at ASAP :/

I did a git bisect and found the commit that made this start happening (at least for the Tiled importer plugin):

7f6f9abb2ffd43d81272fffff22896becdb7bd48 is the first bad commit
commit 7f6f9abb2ffd43d81272fffff22896becdb7bd48
Author: George Marques <[email protected]>
Date:   Sun Nov 11 01:42:20 2018 -0200

    Make enum values not be script constants if enum is named

    Anonymous enums still creates script constants.

    Also add a check to see if name used for enum is already defined.

:040000 040000 7ac64e1984f710b0b0c015e2239df3cb82f2df5d 981670918f06c26b63ab1fd2d01fb44d1c11ceca M      modules

@rosshadden I don't thin this is related. This issue is from Godot 3.0.5 and was open way before I made this change (which will not be backported to the stable branch).

The issue is just the message that is misleading. The problem is that the plugin script couldn't be loaded, likely because a fail in compilation caused by some syntax error.

Oh sorry, my bad!

Fixed by #22983.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RayKoopa picture RayKoopa  路  3Comments

nunodonato picture nunodonato  路  3Comments

mefihl picture mefihl  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments

gonzo191 picture gonzo191  路  3Comments