Inheritance and Dictionaries

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ogrotten
:warning: Old Version Published before Godot 3 was released.

Inheritance:

starting here as my nodetree, I assume that the Play button node could use data from the Root node. How would it refer to it? In js/python, there’s no special thing to refer to in-scope data from a parent, you just use it.

Dictionaries:

var DRUGS={
    "Stimulator": [1000,
        4400,
        .8,
        .3,
        2.5,
        "Heals "],

what’s the notation to refer to, say, the .8 entry in the dictionary?

Last question:

I don’t want to have to keep dropping in here to find clarification of such simple things. are either of these put concretely in the docs or someplace official?

I don’t see inheritance in that scene tree other than all the controls that are Control (plus all the classes in between) and the scripts that extend a Control too.


Could be better (for you and the possibility to get answers) to make a single question per post, some people may prefer not to answer if has something to say about one thing out of 3.

eons | 2017-07-25 21:42

:bust_in_silhouette: Reply From: DrPlamsa

Hello!
I can’t answer question #1, about inheritance. As far as I know it’s not possible. Try defining the data globally or passing it to the button in a function?

To answer question #2, the notation is DRUGS[“Stimulator”][2].

To answer question #3, the answer is not really. I’m sure you’ve heard the spiel before; this is a free and open source project with heavy community involvement etc. Sorry.

My technical questions were answered, and quite clearly, on Reddit. You might try there yourself for future questions. It’s highly unlikely the same people will see questions posted in multiple places. I’ve never been derided for it in other environments.

2ndly, I don’t buy the explanation of why the docs are lacking. One-off frameworks with more methods and fewer developers hit the ground running with complete documentation. “We’re small” is a frame of mind.

ogrotten | 2017-07-26 01:51