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
 

Re: How to implement RBXScriptSignal like eventing

Previous Thread :: Next Thread 
Draeton is not online. Draeton
Joined: 04 Jun 2012
Total Posts: 4269
20 Mar 2014 06:47 PM
Hi, I haven't used ROBLOX in a while but I've been thinking of implementing RBXScriptSignal like events/event processing for my own game engine. I need to know if registered listeners should be implemented as functions that are to have threads for them created and called by these threads when an event fires, or if the event information should be forwarded to the thread that installed the listener (such as a thread specific queue) for further processing.
Up until this point I've been planning for queues, but the other implementation I just described, that is RBXScriptSignal-like in my eyes based off the documentation, would work fine with my framework too.

Also, was the disconnect() method of events obsoleted because usage of RBXScriptConnection:disconnect() was able to disconnect a single listener specific to the connect() method that returned the object while event:disconnect() disconnected all listeners or a single listener indiscriminately?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Mar 2014 07:07 PM
yeah

local touch = script.Parent.Touched

touch:connect()

wait(10)

touch:disconnect()
Report Abuse
Draeton is not online. Draeton
Joined: 04 Jun 2012
Total Posts: 4269
20 Mar 2014 07:11 PM
@Lolb
I wasn't looking for example code, I'm writing an API for my own game engine using C. I need information on how the listeners are executed.

1) Are listeners executed in their own thread? Are they simply co-routines?
2) Is execution of a listener blocked until a previous listener established by the same thread finishes executing?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Mar 2014 07:38 PM
sorry tl;dr

i don't know much about what c can do but you should google it. there's tons of blogs who post even source code about their engines
Report Abuse
Draeton is not online. Draeton
Joined: 04 Jun 2012
Total Posts: 4269
20 Mar 2014 07:39 PM
Dude I'm not out to steal their source code. Also I don't care about their APIs, only ROBLOX's.
Report Abuse
Draeton is not online. Draeton
Joined: 04 Jun 2012
Total Posts: 4269
20 Mar 2014 07:41 PM
I need you to understand right now that recreating an API from scratch != stealing source code.
Also, it looks like the HopperBin's page on the ROBLOX wiki was totally obliterated.
Report Abuse
Draeton is not online. Draeton
Joined: 04 Jun 2012
Total Posts: 4269
20 Mar 2014 08:29 PM
Alright, I'm going with executing listeners in their own threads immediately.
Report Abuse
KidCrumpet is not online. KidCrumpet
Joined: 16 Jul 2013
Total Posts: 193
20 Mar 2014 08:40 PM
^Stoopid java is btr
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
20 Mar 2014 09:46 PM

----------------------------------
--Here I made an oop system and a RBXScriptSignal like system too
-- ^-^
----------------------------

Class = {}


function Class.new(constructArgs)
----class = {}
----setmetatable(class, Class)

----class construct stuff goes here

----return class
end

Class.eventName = {}
Class.eventName.calls = {}

function Class.eventName.func(args)
----Class stuff
----for _, v in pairs(Class.Event.Calls) do
--------v(args)
----end
end

function Class.eventName:connect(func)
----table.insert(self.Calls, func)
----return #self.Calls
end

function Class.eventName:disconnect(id)
----table.remove(self.Calls, id)
end
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
20 Mar 2014 11:26 PM
alt+255 for tabs tho
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