49 Replies
npm i @rbxts/services
do you know how to or if you can create instances other than scripts and modules? Im trying to implement this module loader with actors into the ts world but im a bit confused

this is what im trying to achieve
the ActorForClient contains a localscript with code in it
clone them?
i was hoping to keep the instance count as low as possible

this is how i have it set up currently
why init.lua?

yes?
because the base module is in lua
you still can do index.ts
oh
im trying to get the actors as a child of the Loader module
but in the vs project
and have the scripts under those actors
can you create 1 instance of the script and then just clone it?
i've fixed that issue but how can you require a module thats in the game already? Using require() only supports ModuleScript or number and .WaitForChild() is casted as an Instance

...(ReplicatedStorage.WaitForChild() as ModuleScript)
That’s what I thought, my vs code is wonky right now and isn’t updating error interface right away so it stayed the same
I’m gonna just restart vsc
npm
@rbxts/luau-thread
Parallel Luau library designed for simplicity and ease of use.. Latest version: 1.0.1, last published: 2 years ago. Start using @rbxts/luau-thread in your project by running
npm i @rbxts/luau-thread
. There are no other projects in the npm registry using @rbxts/luau-thread.maybe this is better
Imagine if we were able to avoid this bullshitt
And just do something like task.RunParallel(() => {})
this wouldn't work
because this function can't access upvalues
wdym
why would they make that possible?
c# i think you can do that
and like in any other language
it runs in a different thread bruh
@wAD
i don't use c#
and esp you have lock function that prevents any other parallel threads from accessing the variable
i don't know how this is implemented
so have you heard about the problem called race condition?
that means if a couple of parallel operations are trying to read and to write the same variable
and to prevent that c# added lock
c++ has mutex
but usually you're able to access the same variable from multiple threads
you cannot only if they decide to run separate vm 😨
like they do
and it makes things harder
that i tried but it doesnt work in parallel since you're sending the function
you cannot send the function to the script inside of the actor to execute apparently
and it's going to run but not in parallel
i don't know hows that related to that convo

SendJob
that was initially a hypothetical suggestion
if that was possible it would be still easier to do than the stuff that they have i think 😔
see the convo below on why not

they mentioned everything we've talked about now probably
brother i've read it, they're literally explaining why this suggestion sucks
thats why i referred you to that conversation
because you suggested the same thing
oh
interesting
not as easy
you cant run luau like that
you need an entirely new luau instance
unfortunately, i have already tried

freaky
yeah, you need a new vm for it
no way around it
intended as "single thread"
and the easiest way to do that, was to forcing you to duplicate the script