Plugin Commands?

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
So can anyone tell me why someone would want plugin commands over an actual script command?

I mean I don't get why plugin commands are even a thing. They don't add anything special and they can't be used everywhere script calls can be. So what's the point with them anyways?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,546
Reaction score
3,717
First Language
Java's Crypt
Primarily Uses
RMMZ
They're easier to use. It's my favorite new feature of MV, because I can let people write commands in a way that is easier to understand. Check some samples of plugin commands from some of my plugins, compared to their script counterpart:

Code:
COMMAND: run common event 15 in 2 minutesSCRIPT:  OrangeTimeSystem.runInMinutes(15, 2);
Code:
COMMAND: spawn event 10 from map 2 on region 7SCRIPT:  OrangeCustomEvents.spawnMapEventFrom(2, 10, 7);
 
Last edited by a moderator:

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
566
First Language
English
Primarily Uses
RMMV
Simplicity. If you read the documentation on eventing it states Script is:

Evaluates text as JavaScript.
It all comes down to the K.I.S.S methodology, keeping it simple stupid. The moment you make "Script calls" a standard, people will try to have the average RMMV user execute full blown javascript, as thats what the event command is for, to execute full blown javascript that wouldn't necessarily be its own plugin. I often use it for short for-loops that don't need their own plugin, because having such a for loop be its own plugin (e.g: A for loop to simply increase all the HP at that moment, of every party member by a specified formula) is not keeping it simple.
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Ya I suppose that makes sense, it's just the exact opposite of the standard set by previous rpg makers.

And they'll add a lot of function call bloat the more plugins you get that add them, if you have 30 plugins all aliasing or hooking the same function. I don't know if that bloat will be bad or not I don't know how fast JavaScript is compared to other languages like ruby or lua.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,546
Reaction score
3,717
First Language
Java's Crypt
Primarily Uses
RMMZ
Yeah, we have been discussing that on other threads. It makes a big relative difference (but not big enough to cause lag).

I'll start adding a param on my plugins for people to decide if they want to use plugin commands or not.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
JavaScript is much faster than Ruby. Also, your version of Game_Interpreter.pluginCommand should return, if it matches with your command, so it won't have to call all aliases methods, but only as many as needed. I wouldn't use plugin commands for stuff, that's executed every few frames, anyway.
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Oh ya I didn't think about the return, and good ruby was slow I knew lua was faster than ruby but wasn't sure how java compared.

So I'm not the only one who thought of the impact awesome I thought maybe I was understanding something wrong. But if it's not a laggy impact then I suppose it's not horrible.

I guess I'll just accept it as the new practice. It's just weird after playing with dog makers since xp lol.

By the way handy link in your signature.

Just a thought on proformance and the endlessly hooked function would it be worth it to try and get something wrote up for the MVCommons that handles this without hooking the same function?

Like say

MVCommons.addPlugin(name, func) {

_data[name ] = func;

}

And then it would just call

_data[name](args);

Or would it be pointless?
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
try this... call a script call of a plugin...

remove the plugin because somehow you decided to not using it. (let's say it cause lag / incompatible with other plugin)

crash... (you need to edit ALL your event and remove that script call).

vs

call a plugin command of a plugin

remove the plugin because of same reason as above.

work fine without crash.

so i would prefer using plugin command as user.
 
Last edited by a moderator:

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Us I suppose, but I'd rather the error so I can know which events have useless data in them.

But good thought anyways I wouldn't of even thought about that.
 

Sulsay

Villager
Member
Joined
Nov 25, 2015
Messages
25
Reaction score
7
First Language
Dutch
Primarily Uses
RMMV
JavaScript is much faster than Ruby. Also, your version of Game_Interpreter.pluginCommand should return, if it matches with your command, so it won't have to call all aliases methods, but only as many as needed. I wouldn't use plugin commands for stuff, that's executed every few frames, anyway.
I don't agree. If the command matches something that your plugin handles, please, still continue execution. You can't be a 100% sure that another plugin doesn't implement the same command.

This method is, in my opinion, supposed to always run its entire chain, regardless of whether or not your plugin handles the command.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
If 2 plugins share the same command, i'm inclined to say that they are incompatible. That's why i add a plugin parameter to all of my plugins, that can be used to modify the commands (i probably should disable them entirely, if the parameter is empty, though).
 

Sulsay

Villager
Member
Joined
Nov 25, 2015
Messages
25
Reaction score
7
First Language
Dutch
Primarily Uses
RMMV
I can't really think of a convincing example where two compatible plugins would use the same command. You have a point there :)

I would still call the original method though. Just feels better.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,546
Reaction score
3,717
First Language
Java's Crypt
Primarily Uses
RMMZ
I always call the original method too.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top