Refx - A library for Replicating Visual Effects in Roblox

so i am going with OnConstructServer() to make the effect exist and start bla bla bla. and i need to pass the player argument to Effect.new() so how do i get the player arg in OnConstructServer() or can it even get the player arg?

nvm i read the api for wcs

30charlim

When I try to install the wally package I get this error:

A dev dependency cannot be dependened upon by a non-dev dependency

Do you know what this is referring to?

Also seems to be a typo: Canoot

If you have testez installed, put it under dev-dependencies

Love the library!

I have a cart control system that is running on the client and I listen to run service Heartbeat to get physical changes on the assembly and apply effects based on the context of the velocity, angular velocity or input, etc. and the client sends that through the server for replication. Security was not my main priority because all of the effects do not affect any gameplay just visuals and for immersion.

I really love to use this. However, I cannot do it on the server it would take a toll running heartbeats on the server reading for the cart’s physical changes for all players.

do you have any suggestions on how would I go about this? or if its even possible with this library.

refx offers only server -> client communication, so you would have to implement that yourself

1 Like

Can you call Start multiple times and pass more players? I have a table of current players that are detected this updates frequently and If the effect is already running I want to start the effect for newly added players from the updated table.

you can’t, i’d suggest to make a new effect each time. what’s your usecase?

I am not actually kind of using the library’s intended purpose, especially for just particle effects only, lol but it works but probably not the best way.

Here’s the game:

This is a 2 player-teamwork esque game. We are planning to implement interactable objects through levers, pressure plates, buttons, etc. Multiple teams of 2 players are going through the same obstacle. we wouldn’t want to replicate every button and every object that activates from a button to other players who are not their teammates.

This eliminates spoiling the puzzle for other teams. It will only replicate to their teammate/partner.

The way it works right now is we track all teams in a dictionary and every new team is created we create a button “Effect” to every single button in the level and as well as passing the button object model as a parameter so we can change visual/effects when pressed on the client and will only replicate to their teammate. I disabled all automatic destruction since we only want to destroy it once they die/reset at the same time resetting the state of the button or an activatable object eg: door to close.

I don’t know if its going to take so much memory or we’d have to make our own replication. Since right now every single effect is created and started for a single player.

Right now I plan to make the effect created only one time for each team so we don’t have to create 2 effects object for each team since each team has 2 players.

Please let me know if there is a better way to do this. Thanks!

Would it be okay if i use this for replication of more advanced visual effects?, i dunno if what i am trying to do counts as so, but i am trying to do a projectile on client, and then make a hitbox to fllow that projectile, would it be a “okay” use case?

yeah, this usecase is competely fine

what i would do is create a seperate effect for each “action”, e.g: button press, level pull, etc.
and start this effect for the teammates.

each effect won’t take much memory and will get garbage collected when completed.

1 Like

Created a pulll request to allow effect classes to extend from other effects: implement extendsFrom by offad ¡ Pull Request #7 ¡ wad4444/refx ¡ GitHub
Let me know what you think

1 Like

Left a review under the pull request.

1 Like

how would I go about using two copies of the same effect at the same time?
like if two different characters using the same attack call the .new() method on the attack’s FX at the same time, then both :Start() or :Destroy(), the two instances of FX clash with each other because they’re trying to use the same module. is there anyway to create separate instances of the same FX?

they won’t clash with eachother, because .new() returns a new instance of FX type

1 Like

you’re correct, i was mistakenly storing variables normally rather than using self

Hey there, I think the wally package has broken types, when running wally-package-types this is what happens.

If the DestroyOnEnd or MaxLifetime is reached and cleaned up on the client. Is the server-side effect object that has been created with .new will be cleaned up as-well?