I have been fiddling with plugin creation. Thanks to AutMouse Labs! I have noticed that people will often use "(() =>{code})();" in their code, but AutMouse doesn't. I am wondering about the pros and cons about using it. In any case I would love a review. It works and if it can pass a community review I will post it in the finished plugins section. I will post both as an attachment and a spoiler since it isn't very big.
If you're curious about some me background. I have been dabbling with rpg maker since the ps1, but never went full deep dive into it until this past couple of weeks. I do know Javascript and HTML5 fair amount, and a good bit of other languages.
If you're curious about some me background. I have been dabbling with rpg maker since the ps1, but never went full deep dive into it until this past couple of weeks. I do know Javascript and HTML5 fair amount, and a good bit of other languages.
///////////////////////////////////////////////////////////
// Woden's Custom Leader Plugin
///////////////////////////////////////////////////////////
/*:
* @target MZ
* @Author Woden Burison
* @description A plugin to set the party leader to someone other than a battler, like in Pokemon games.
*
* @param customLeader
* @text Custom Leader:
* @desc Pick a custom leader based on the actor ID.
* @type number
* @Default 1
*
* @Help
* Setting a custom party leader
*/
const WODEN_customLeader = {};
WODEN_customLeader.pluginName = "WODEN_customPartyLeader";
//getting params
WODEN_customLeader.parameters = PluginManager.parameters(
WODEN_customLeader.pluginName
);
WODEN_customLeader.customLeader = Number(
WODEN_customLeader.parameters["customLeader"] || 1
);
//override party leader function from rmmz_objects 5454
Game_Party.prototype.leader = function() {
let leader = WODEN_customLeader.customLeader;
return $gameActors.actor(leader);
};
// Woden's Custom Leader Plugin
///////////////////////////////////////////////////////////
/*:
* @target MZ
* @Author Woden Burison
* @description A plugin to set the party leader to someone other than a battler, like in Pokemon games.
*
* @param customLeader
* @text Custom Leader:
* @desc Pick a custom leader based on the actor ID.
* @type number
* @Default 1
*
* @Help
* Setting a custom party leader
*/
const WODEN_customLeader = {};
WODEN_customLeader.pluginName = "WODEN_customPartyLeader";
//getting params
WODEN_customLeader.parameters = PluginManager.parameters(
WODEN_customLeader.pluginName
);
WODEN_customLeader.customLeader = Number(
WODEN_customLeader.parameters["customLeader"] || 1
);
//override party leader function from rmmz_objects 5454
Game_Party.prototype.leader = function() {
let leader = WODEN_customLeader.customLeader;
return $gameActors.actor(leader);
};