- Joined
- Feb 27, 2014
- Messages
- 160
- Reaction score
- 201
- First Language
- English
- Primarily Uses
- RMMV
Okay so, everyone everywhere says that you should work on plugins in an IFFE to prevent a lot of stuff like pollution/namespaces etc.
And that it's good practice to do so when working in rpg maker etc etc.
But I don't understand how to access/run functions or the plugin in general at ALL once they are inside an IFFE. I've been looking at other codes and tried looking up stuff online but online most people like to use really convoluted examples haha. After half a day sunk into trying to figure it out on my own I give up oml.
--------------------------------------------
I understand to call the following from a plugin in an rpg maker event script is testieboi();

I am pretty sure I have to add something to the plugin, the call, or both to get this to work but I don't understand what the internet is telling me. When I look at other plugins I only see 2 or 4 things outside of the (function() { }()); block. But I have NO idea which is doing the trick.
Can someone straight-up tell me exactly what I need to add to the below or the event script (or both) to run the exact same piece of code once it's placed into an IFFE? *screeches*

And that it's good practice to do so when working in rpg maker etc etc.
But I don't understand how to access/run functions or the plugin in general at ALL once they are inside an IFFE. I've been looking at other codes and tried looking up stuff online but online most people like to use really convoluted examples haha. After half a day sunk into trying to figure it out on my own I give up oml.
--------------------------------------------
I understand to call the following from a plugin in an rpg maker event script is testieboi();

I am pretty sure I have to add something to the plugin, the call, or both to get this to work but I don't understand what the internet is telling me. When I look at other plugins I only see 2 or 4 things outside of the (function() { }()); block. But I have NO idea which is doing the trick.
Can someone straight-up tell me exactly what I need to add to the below or the event script (or both) to run the exact same piece of code once it's placed into an IFFE? *screeches*

Code:
(function() {
var testieboi = function() {
console.log("Holy I work");
};
}());
Last edited: