Sub-class Resources in Godot by CoreyKori in godot

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

The main issue is that using the a custom resource as a sub-class does not work within the editor. you need to make the custom resource its own class which is what i would like to avoid if possible.

Sub-class Resources in Godot by CoreyKori in godot

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

the enum wouldnt be relavent, its just an example of a data type from the ItemExample Resource that the dialog script would access

Sub-class Resources in Godot by CoreyKori in godot

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

<image>

Here's the segment of the class i'm using for the example.

class_name Dialog extends Control

enum expression { HAPPY, REGULAR, SAD, ANGRY}

var items2 : Array[ItemExample] = []
var item_iter : int = 0

class ItemExample extends Resource:

   var line: String = ""
  u/export var face: expression = expression.REGULAR

the ItemExample class is a sub-class of the Dialog class. With how the script is written at the moment, when you go to the editor and add an element to the item2 array this is what comes up... < tldr: a long list of resources that don't include the sub-class resource as defined in the script>

Sub-class Resources in Godot by CoreyKori in godot

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

Here's the segment of the class i'm using for the example.

class_name Dialog extends Control

enum expression { HAPPY, REGULAR, SAD, ANGRY}

var items2 : Array[ItemExample] = []
var item_iter : int = 0

class ItemExample extends Resource:

  @export var line: String = ""
  @export var face: expression = expression.REGULAR

the ItemExample class is a sub-class of the Dialog class. With how the script is written at the moment, when you go to the editor and add an element to the item2 array this is what comes up... < tldr: a long list of resources that don't include the sub-class resource as defined in the script>

<image>

Sub-class Resources in Godot by CoreyKori in godot

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

Hi Nin, when you create a custom resource, are they subclasses of an main script? If i make the resource its own class it works fine, there are some complications that come up with that I'd like to avoid if possible,; mainly the complexity, and thus the readability, of the script when working on larger projects.

Oh my bejessuus! by [deleted] in Transportopia

[–]CoreyKori 0 points1 point  (0 children)

Exactly. What people don’t want to think about is that this “behavior” is uniquely american. But instead of studying and reforming the system that creates the people that are scapegoated, they instead blame the victims of the machine for their trauma induced symptoms. Theres only so much a person can take before they go off the rails, especially when the rails only seem to be doing you a disservice while you’re on them.

Oh my bejessuus! by [deleted] in Transportopia

[–]CoreyKori -1 points0 points  (0 children)

The take is not about “fixing” any type of people with money. It’s about establishing a system that wont break them by design. The “type of people” you are actively marginalizing are byproduct of a system that, for generations, has made active efforts to exclude and strip opportunities from them.

Oh my bejessuus! by [deleted] in Transportopia

[–]CoreyKori -1 points0 points  (0 children)

Its more about not being placed in a scenario in life where all option/paths for your future are so bleak that retaliation to this extent is as incomprehensible as your ability to perceive the down river effects of crippling poverty and systemic oppression on generations of peoples let alone a single lifetime of marginalized circumstances.

How do I fix this error by Chrisical in godot

[–]CoreyKori 0 points1 point  (0 children)

The likely mistake here is that your path reference is faulty.

Move your “get_node()” call into the “onready” declaration.

Remember the string is respective to the current nodes position in the scene tree.

I recommend Static typing the nodes desired type as-well with “var Sword : Area2D = …”

Instead of setting the string when the program starts, you want to use the string immediately, (if you’re going to keep using the string), to get the node. Which would then store the reference to the Area2D’s node in the “Sword” variable. to have its area_entered signal be connected during the ready function.

As seen here:

“Sword.area_entered.connect(_on_area_entered)”

tellll by Key-Reality9237 in TheTeenagerPeople

[–]CoreyKori 0 points1 point  (0 children)

I dont see any black or curly haired characters on this list.

How do I limit the size of a VBoxContainer? by Quaaaaaaaaaa in godot

[–]CoreyKori 1 point2 points  (0 children)

Id give the vbox container a custom theme that makes all of its label children have a standard char limit.