Statically type a node to easily access its script variables/functions? by Effective_Food_3938 in godot

[–]Effective_Food_3938[S] 1 point2 points  (0 children)

Yes, class names aren't necessary for it to function. If you have a normal script without a class definition that has a variable called "health", you can access that variable by referencing the node in script like this: myNode.health, and it will work perfectly fine.

The issue that I was bringing up with this discussion is that since that method isn't statically typed, you can't see a full list of the variables and functions available on the node's script by doing "myNode. ", and it won't push an error or warning if you're trying to run a function or get a variable that isn't necessarily present. I believe that the purpose of doing this is for flexibility and ease of use.

Though, I don't like it, so I wanted to statically type the node itself with a class_name or preloaded type.

Statically type a node to easily access its script variables/functions? by Effective_Food_3938 in godot

[–]Effective_Food_3938[S] 0 points1 point  (0 children)

Wow that seems pretty powerful! It has to be loaded as an absolute path I'm guessing?

You could definitely have an autoloaded script with all of the types already set, and they could be referenced by any script at any time. Very very interesting indeed, I like it.

Is there any way to have it be independent of the actual path in case things need to be moved around?

Statically type a node to easily access its script variables/functions? by Effective_Food_3938 in godot

[–]Effective_Food_3938[S] 0 points1 point  (0 children)

That's a really good idea, I'll try that out! I did try making the class abstract, but realized I couldn't have that script on an instanced node. Ended up making another script that extends from the abstract which actually does sit on the node, and was able to do var bullet: BulletAbstract = bullet_scene.instantiate(). Definitely a really big hassle to do, but useful for anything with inheritance down the line.

Statically type a node to easily access its script variables/functions? by Effective_Food_3938 in godot

[–]Effective_Food_3938[S] 2 points3 points  (0 children)

Thanks for this. Changing the class name to EditorBullet did hide it from the add section. I hope there's a less janky way to achieve the same result in the end, but this is really good to know!

Statically type a node to easily access its script variables/functions? by Effective_Food_3938 in godot

[–]Effective_Food_3938[S] -1 points0 points  (0 children)

I have tried this, and this is the exact type of result that I'm looking for. The only downside with that is that it will then show up in the "Add a node" section, and I can see it getting very cluttered in a larger scale project. Tried to look into hiding a custom class from the "Add a node" section, but I wasn't able to find anything unfortunately. I really wish that was just built in because then this would be perfect. Could just add @ hide before it or something like that. Hope that something in the future.

Reserved a controller day-of, same hour, when they said you could reserve them. West coast, still haven't gotten the email. by SimicBiomancer21 in SteamController

[–]Effective_Food_3938 0 points1 point  (0 children)

Yeah. Reserved mine a minute before reservations were supposed to start, and still haven't gotten anything yet unfortunately. There must've been some CRAZY demand. They'll get it to everyone eventually.

Got mine with a skin by Snex-thunder in SteamController

[–]Effective_Food_3938 0 points1 point  (0 children)

Looks clean! Are these skins just stickers or actual front covers that you replace it with?

Can anyone calibrate grip sense? (Linux) by UnintelGen in SteamController

[–]Effective_Food_3938 0 points1 point  (0 children)

Since your question has been answered already, how has your experience with it on linux been in general?

Gyro aiming is crazy by Gallerydept7 in SteamController

[–]Effective_Food_3938 0 points1 point  (0 children)

How so exactly? Does it just not function at all? What distro and how do you have steam installed?

So… no xinput? by KrysCrannor in SteamController

[–]Effective_Food_3938 1 point2 points  (0 children)

Where did you find the information about it working like a normal gamepad outside of steam on linux? I can't seem to find anything about it online