I wonder if this is intent or not? So I have 2 scripts

#main script that attach to node
extends Object

export(Resource) other
#other script as resource for main script
class_name OtherClass extends Resource

export(String) var string: String
export(int) var num: int

func _init():
	print(string)
	# expect: value from inspector
	# result: empty
	print(num)
	# expect: value from inspector
	# result: 0 

But when _ready() from main script is executing, value from inspector is already assign to variables properly

So what is the problem? Export resources work fine for me.

Yeah, if there is a question in the OP then it is a very confusing one. Perhaps @sent44 can rephrase it?

@Megalomaniak Sorry for confuse question. I wonder if inspector value is intent to apply after after sometime after object is initialize or it is engine's bug? Proof

So you have a script extending resource. What is it supposed to to? What's the problem with it?

@Dschoonmaker Just make it so that I can attach class script in export array field at main script. I current plan to use it to store nodes that FSM can handle, also actions for GOAP, alternative way to attach multiply scripts like unity one without using many child node which I really dislike.

What are FSM and GOAP? If you need to export an array, you can declare that as the data type:

export(Array) var x = []

Multiple scripts would be very nice. I think you can actually do this if you programmatically create child nodes with each script, it shouldn't show those nodes the editor. The only problem with this approach is you would also have to change references to other nodes. You might be able to change a script in gdscript, I'm not sure. If you can, then you could add get_parent() before any references to other nodes. Sorry if this answer is unclear.

Finite State Machine and the other one is Goal Oriented Action Planning

Okay, thanks.

This is somewhat off topic, but it would also be nice if you could make scripts without saving them, kind of like shaders.(at least it's just inconvenient, unreal engine doesn't let you delete scripts)

3 years later