As of 3.1 you can do this by adding _get_configuration_warning to your GDScript:
tool # must be a tool script to work
extends Node
export(String) var name:String
func _get_configuration_warning():
if not name:
return 'Name not set'
return ''
For anyone finding this as of today, things changed slightly.
Use _get_configuration_warnings to return an PackedStringArray of additional warnings (besides the one the Node you extended already returns)
func _get_configuration_warnings() -> PackedStringArray:
var warnings: PackedStringArray
if not is_okay:
warnings.append("is not okay")
return warnings
The script still has to be in @tool mode.
When variables like is_okay are changed, call update_configuration_warnings() to update them. They are also updated when you move the node in the scene tree or enter the scene again, but that’s obviously unreliably and annoying.