|
| 01 Oct 2015 02:21 PM |
So I'm creating 3 Objects Via ModuleScripts Each one implements the previous For example C implements B implements A
A is a big list B sorts that list, in order to create much of C, interfaces using GUI to display items in A
How do I make when C is clicked, A recieves what C returns then B and C are deleted?
Not looking for code. Just if anyone has any ideas on how to implement this, I'd be grateful |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 01 Oct 2015 02:23 PM |
um what
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 02:24 PM |
| You do know what object oriented programming is, right? |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 01 Oct 2015 02:27 PM |
yeah but all this could be done so much more easily
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 02:31 PM |
| How so? I've been looking for ideas |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 01 Oct 2015 02:32 PM |
well if you were more specific and less general
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 02:46 PM |
I've really been specific
There are 3 objects created by modulescripts
Deck -- An object which contains many tables. This calls upon a function :search which creates a GUIBlock, waits for the click event of x amount of GUI objects, and removes the GUI's that were clicked from the deck by their associated indexes
The main Goal of this is to display all the tables in deck, wait for an amount of them to be selected, and then remove those tables from the deck and put them somewhere else
GUIBlock -- An object which uses the Deck object to create a GUI object for each table in Deck
GUI -- An object connected to a GUI that can be clicked. Each holds all the info from one of the tables of the Deck. It also holds an index of where it was in the Deck.
So when the MouseButton1down event fires on a GUI, the index of the GUI clicked is given back to Deck, and handle to be removed. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 01 Oct 2015 02:52 PM |
and is there any specific reason why you need module scripts
all this could be done in one function
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:01 PM |
That would cause a mess. I'm trying to make a card game here where objects are used all over. I need to be orderly
Anyways I think I found my solution: BindableEvents |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 01 Oct 2015 03:03 PM |
that wouldnt cause a mess...
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Oct 2015 03:04 PM |
| Make your ModuleScripts return the constructors and remember to use weak references. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:11 PM |
| What do you mean by return the constructors? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Oct 2015 03:12 PM |
| You do know what object oriented programming is, right? |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:13 PM |
You do know what object oriented programming is, right? see what I did there. xD
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:13 PM |
Darn ninjas. hahaha
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:18 PM |
...I mean every object has a constructor, but what do you mean by return the constructor? Return to what? From What?
If I don't know something, pardon me. I need to know all I can to get it right. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Oct 2015 03:24 PM |
| From your ModuleScripts. Make your ModuleScripts return the constructor. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 03:31 PM |
Okay. Already do that.
I thought I was going to die there |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Oct 2015 03:32 PM |
Well if they return the constructor then you should have no issue?
If you need to do cyclic dependencies, then put the variable as a blank local and spawn() a function to set it at the end just as you return the module. |
|
|
| Report Abuse |
|
|