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: Trivial Plugin Question?

Previous Thread :: Next Thread 
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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 is not online. 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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
09 Jan 2016 08:30 PM
Because that would be messy and inefficient.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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 is not online. 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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
09 Jan 2016 08:37 PM
*sure as hell be a lot less efficient
Report Abuse
icanxlr8 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
09 Jan 2016 08:42 PM
*throw

that that was @ican btw
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jan 2016 08:44 PM
I just said you can try a module...
Report Abuse
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
09 Jan 2016 08:44 PM
Thanks warspy, I wasn't talking to you when I made that last post btw
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jan 2016 08:47 PM
No guarantees if this'll work. I'm guessing here. Idk if modules work with plugins.
Report Abuse
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jan 2016 09:06 PM
Your welcome, glad my guesses worked lol :D
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