0 votes

Hi,

I'm a DM using Godot to create an application to improve my DnD campaigns.

In the actual stage, I'm still developing the class diagrams and so on, but I found an error that is not, actually, an error (if I can put it like this).

I have this class called Character, which have some attributes, and its child called Dwarf.

The issue shows up when I try to use any of the Character's attributes on Dwarf's functions.

extends Character

class_name Dwarf

func _init().():
   Name = "Test" # just an example

The error then shows up, pointing to the line, but the code works still run fine.

There're anyway to ignore those errors or I'm making a huge mistake that I didn't saw yet?

Godot version 3.3
in Engine by (12 points)

What's with

func _init().():

Is that a typo?

exuin, this is valid syntax to pass arguments to the parent constructor: https://docs.godotengine.org/en/3.3/getting_started/scripting/gdscript/gdscript_basics.html#class-constructor

However, you don't need to do this if the parent constructor doesn't take any arguments.

I see it's like super

I'm leaving this way because it will have some arguments, I'm just very confused with the error showing. ^^'

I had a similar strange error in the class inherited from a class inherited from the Node. The error claimed that the get_node function was not found. The solution was to fix all the errors of the parent classes

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.