generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

How to save on RemoteEvents?

Previous Thread :: Next Thread 
AxFx is not online. AxFx
Joined: 14 Aug 2009
Total Posts: 518
26 Jan 2016 06:12 PM
I'm working on a full fledged racing game, and so far have 18 remote events and 5 remote functions. Is that bad?

I was wondering if there was a way I could combine these events somehow, some of them go to the same GUI's.

Any help/recommendations is appreciated.


Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
26 Jan 2016 06:16 PM
there's probably a way to combine them, but you've given us no information on the different events/functions you have making it near impossible to help you

there's also a chance combining them makes your code too messy or unorganized depending on what you're trying to do
Report Abuse
AxFx is not online. AxFx
Joined: 14 Aug 2009
Total Posts: 518
26 Jan 2016 06:42 PM
Yea.. I was expecting an answer like that.

I was thinking maybe you could forward a tag for the event or function to do a different thing, for example adjusting the visibility of different GUI pieces.

If I have this many events, will lag start to become an issue? None of them are being constantly activated, only once upon pressing a button or having a script issue another.

I'd imagine the "listening" function of 18 events might start to cause a lag related problem. Maybe I'm wrong?


Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
26 Jan 2016 06:46 PM
You could add extra parameters to your event/function that changes what it does, but it shouldn't cause any lag. It's also not like it's a while loop constantly checking for an event to fire, think of it as code that's inactive and only turns on or becomes noticeable once invoked or fired.
Report Abuse
AxFx is not online. AxFx
Joined: 14 Aug 2009
Total Posts: 518
26 Jan 2016 07:01 PM
So it would be normal to have a high count of remote events for a game with a lot of function and complexity? I know optimization is part of that, but you can only go so far with optimizing without compromise of functions.

For example, I've got two buttons. One says Ready, the other says Not Ready. Each one has their own events that they fire, and their functions are obvious due to their names. Can't really do much there can I...


Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
26 Jan 2016 07:52 PM
That could easily be merged into one event by using a variable to declare which type it is.
Report Abuse
AxFx is not online. AxFx
Joined: 14 Aug 2009
Total Posts: 518
26 Jan 2016 08:27 PM
Example?


Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
26 Jan 2016 08:33 PM
-- on client
event:FireServer(btnType); -- btnType being a bool of whether it's ready or not

-- on server
event.OnServerEvent:connect(function(player, btnType)

if btnType == "ready" then

print("ran code for btnType 'ready'");

else

print("ran code for btnType 'not ready'");

end

end)
Report Abuse
AxFx is not online. AxFx
Joined: 14 Aug 2009
Total Posts: 518
26 Jan 2016 08:56 PM
Yea that's basically what I was asking for in my second post, if something like that were possible.

Thanks a bunch, that will help me a lot.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image