RPG Maker Forums

Could someone please kindly provide a summary of the benefits of using the following structure for plugins?

Code:
(function() {
  // stuff goes here
})();
I've seen plugins that use it, and plugins that don't. Some plugins put some stuff outside of it, and others put the same stuff inside. What's the difference? If I'm overriding or aliasing the functions in the core files, does it matter whether I use the above structure or not?

Some plugins do weird things like this:

Code:
(function(_) {
 // stuff goes here
})(something);
and I think I've seen some that do this:
Code:
(function($) { ...
What's that all about - what does it allow you to do? What's the significance of what I put in the ()?

I'm starting to write new plugins for my own game, which I may share here, and I'd like to get off on the right foot.

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top