|
| 09 Jan 2016 08:26 PM |
So I have this instance tree for my plugin:
-Plugin folder - init (script) - UI (folder) - TheGui (ScreenGui) - TestingScript (script)
The init script runs successfully and clones TheGui to CoreGui
TestingScript has only one line of code which prints out hello world to the output
TestingScript is not disabled
When I run the plugin, nothing is outputted? |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 09 Jan 2016 08:29 PM |
Why not combine the plugin script and the other script?
Rock on! http://www.roblox.com/games/121584089/Rock-Roleplay |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:30 PM |
| Because that would be messy and inefficient. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:31 PM |
When you clone it I do believe you have a new object and the connections aren't copied over. And the scripts in a plugin only run once. So you should probably be parenting it to and from CoreGui, rather than cloning.
Actually come to think of it, I'm not sure if TestingScript will even run, I usually put all my connections in the one Script and publish the script itself as the plugin. |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 09 Jan 2016 08:32 PM |
^ That's why I was saying put them all in one script. I've never had an issue with combining scripts, except occasionally when using continuous loops.
Rock on! http://www.roblox.com/games/121584089/Rock-Roleplay |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:33 PM |
Oh, I made a mistake in this thread. I actually do change the parent to CoreGui instead of cloning it.
Still, the testing script doesn't run before or after the hierarchy change. |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 09 Jan 2016 08:33 PM |
Still, why the hell can't you combine them? What's in each script that can't be combined?
Rock on! http://www.roblox.com/games/121584089/Rock-Roleplay |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:36 PM |
I'm not saying that it can't be combined.
It's just removes the modularity of the source which is extremely bad programming practice.
If I combine all of the scripts that I'll need to make the program I'll end up with one huge script that's impossible to understand and impossible to maintain. Well, maybe not impossible but it will sure as hell be a lot less inefficient than it could. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:37 PM |
| *sure as hell be a lot less efficient |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 09 Jan 2016 08:39 PM |
Use -- and --[[ to set headers and stuff to organize your script. That's how 90% of my really long scripts are set up.
Rock on! http://www.roblox.com/games/121584089/Rock-Roleplay |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:41 PM |
| As I suspected, you have to set up the events in the 'init' script. It's the only script that will run. You could maybe try a module or something but Idk if that would work. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:41 PM |
I'm not sure if you're missing my point or just not addressing it.
I don't want to through the entire source for the plugin into one script...
Is there any other solution? |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:42 PM |
*throw
that that was @ican btw |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:44 PM |
| I just said you can try a module... |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:44 PM |
| Thanks warspy, I wasn't talking to you when I made that last post btw |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:47 PM |
| Make a module for each separate 'script' and use init to require each one and run it's code. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:47 PM |
| No guarantees if this'll work. I'm guessing here. Idk if modules work with plugins. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:48 PM |
@warspy Good idea, thanks
I'll try that and post on this thread if it doesn't work. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 08:52 PM |
@warspy
Yup, it worked
Thanks
Well, now it should be easier since I can use 'init' sort of like a main thread to control the plugin and use warspy's method for modularity. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2016 09:06 PM |
| Your welcome, glad my guesses worked lol :D |
|
|
| Report Abuse |
|
|