#Cyclic type notation

1 messages · Page 1 of 1 (latest)

coral jackal
#

I'm having trouble creating a type notation system for my game.
lets say we have these two types

export type A = {
etc:number,
B:B,
text:string,
}

(and in a different module)
export type B = {
thing:Vector3,
A:A,
value:boolean,
}

to make type A access type B to use in itself i'll need to require the module containing type B, but the same applies to type B's table. This will create a Cyclic dependency and i don't really want to place them inside the same module or else it would be unorganised because they are two completely different concepts and this problem appears a lot in my game.

i don't know how to organise it and place it in different modules in a way that i don't have a gigantic module with all my types inside of it, i searched a bunch of creator forums and i found no post on this topic please help.

pallid lodge
#

maybe you can create a difrent scrpt from these two modules where you can acess and edit both of them

#

if I'm not wrong changes you make on a module in a script changes the table in the module for other scripts to access

#

so you could make module script 1, module script 2 and a module access script