Services not showing

No description
49 Replies
Tester
Tester4mo ago
npm i @rbxts/services
Acurrz
AcurrzOP4mo ago
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
Acurrz
AcurrzOP4mo ago
No description
Acurrz
AcurrzOP4mo ago
this is what im trying to achieve the ActorForClient contains a localscript with code in it
Tester
Tester4mo ago
clone them?
Acurrz
AcurrzOP4mo ago
i was hoping to keep the instance count as low as possible
No description
Acurrz
AcurrzOP4mo ago
this is how i have it set up currently
Tester
Tester4mo ago
why init.lua?
Acurrz
AcurrzOP4mo ago
No description
Tester
Tester4mo ago
yes?
Acurrz
AcurrzOP4mo ago
because the base module is in lua
Tester
Tester4mo ago
you still can do index.ts oh
Acurrz
AcurrzOP4mo ago
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
Tester
Tester4mo ago
can you create 1 instance of the script and then just clone it?
Acurrz
AcurrzOP4mo ago
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
Acurrz
AcurrzOP4mo ago
No description
Tester
Tester4mo ago
...(ReplicatedStorage.WaitForChild() as ModuleScript)
Acurrz
AcurrzOP4mo ago
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
PepeElToro41
PepeElToro414mo ago
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.
PepeElToro41
PepeElToro414mo ago
maybe this is better
Tester
Tester4mo ago
Imagine if we were able to avoid this bullshitt And just do something like task.RunParallel(() => {})
wAD
wAD4mo ago
this wouldn't work because this function can't access upvalues
Tester
Tester4mo ago
wdym
wAD
wAD4mo ago
let i = 1;
task.RunParallel(() => {
print(i) // invalid, can't access upvalue i
})
let i = 1;
task.RunParallel(() => {
print(i) // invalid, can't access upvalue i
})
Tester
Tester4mo ago
why would they make that possible? c# i think you can do that and like in any other language
wAD
wAD4mo ago
it runs in a different thread bruh
Tester
Tester4mo ago
@wAD
wAD
wAD4mo ago
i don't use c#
Tester
Tester4mo ago
and esp you have lock function that prevents any other parallel threads from accessing the variable
wAD
wAD4mo ago
i don't know how this is implemented
Tester
Tester4mo ago
so have you heard about the problem called race condition?
Tester
Tester4mo ago
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
wAD
wAD4mo ago
i don't know hows that related to that convo
Tester
Tester4mo ago
No description
Tester
Tester4mo ago
SendJob
wAD
wAD4mo ago
that was initially a hypothetical suggestion
Tester
Tester4mo ago
if that was possible it would be still easier to do than the stuff that they have i think 😔
wAD
wAD4mo ago
see the convo below on why not
Tester
Tester4mo ago
No description
Tester
Tester4mo ago
they mentioned everything we've talked about now probably
wAD
wAD4mo ago
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
Tester
Tester4mo ago
oh interesting
PepeElToro41
PepeElToro414mo ago
not as easy you cant run luau like that you need an entirely new luau instance
Tester
Tester4mo ago
unfortunately, i have already tried
No description
Tester
Tester4mo ago
freaky
PepeElToro41
PepeElToro414mo ago
yeah, you need a new vm for it no way around it
Tester
Tester4mo ago
intended as "single thread"
PepeElToro41
PepeElToro414mo ago
and the easiest way to do that, was to forcing you to duplicate the script

Did you find this page helpful?