create your own type ? [Solved]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MakLinux

Is there a way to create your own type in GDScript like TSphaeren in the Pascal example?

TSphaeren = record
	physical, Fire, Cold, Lightning, Chaos :integer;

TArmour = record
	AntiCritical, Type, Num :integer;   
	Resistances :TSphaeren;

TWeapon =record
	Critical, Type, Num :integer;
	Damage :TSphaeren;
:bust_in_silhouette: Reply From: hilfazer

Using inner class:

class TSphaeren extends Reference:
	var physical : int
	var Fire : int
	var Cold : int
	var Lightning : int
	var Chaos : int

You can use it in other scripts by doing something like:

const ScriptWithTSphaeren = preload("res://")

var foo =