RPG Maker Forums

DarknessFalls has added this entry to his/her Everymans Thoughts, which inspired me to use container to wrap as many as I can. I eventually pushed this idea to the extreme(which is 100% my fault), resulting in something like this(DoubleX RMMV Permanent States):

/*---------------------------------------------------------------------------- * # Edit class: DataManager *----------------------------------------------------------------------------*/// Stores all extended and new functionsDoubleX_RMMV.Permanent_States.DataManager = { isDatabaseLoaded: DataManager.isDatabaseLoaded, // Extended function loadAllPermanentStateNotes: function() { var ps = DoubleX_RMMV.Permanent_States.DataManager; $dataStates.forEach(function(data) { if (data) { ps.loadPermanentStateNotes.call(this, data); } }, this); }, // loadAllPermanentStateNotes // data: The data to have its notetags read loadPermanentStateNotes: function(data) { var lines, ps; var asp = DoubleX_RMMV.Permanent_States.params.allStatesPermanent; data.meta.permanentStates = asp; if (asp === "persist" || asp === "revive") { return; } lines = data.note.split(/[\r\n]+/); ps = /< *permanent +state *: *(\w+) *>/i; for (var index = 0, length = lines.length; index < length; index++) { if (lines[index].match(ps)) { data.meta.permanentStates = RegExp.$1; return; } } } // loadPermanentStateNotes}; // DoubleX_RMMV.Permanent_States.DataManagerDataManager.isDatabaseLoaded = function() { var ps = DoubleX_RMMV.Permanent_States.DataManager; // Rewritten if (!ps.isDatabaseLoaded.apply(this, arguments)) { return false; } ps.loadAllPermanentStateNotes.call(this); return true; //}; // DataManager.isDatabaseLoaded/*---------------------------------------------------------------------------- * # Edit class: Game_BattlerBase *----------------------------------------------------------------------------*/// Stores all extended and new functionsDoubleX_RMMV.Permanent_States.Game_BattlerBase = { // Extended functions initMembers: Game_BattlerBase.prototype.initMembers, die: Game_BattlerBase.prototype.die, clearStates: Game_BattlerBase.prototype.clearStates, revive: Game_BattlerBase.prototype.revive, // /* New private instance variables * permanentStates: The id of all persist and revive permanent states * permanentStateTurns: The turns of all persist and revive permanent states */ initPermanentStates: function() { // v1.01h+ DoubleX_RMMV.Permanent_States.Game_BattlerBase[this] = { permanentStates: {}, permanentStateTurns: {} }; }, // initPermanentStates storePermanentStates: function() { var type, p; if (this._states) { p = DoubleX_RMMV.Permanent_States.Game_BattlerBase[this]; p.permanentStates = { persist: [], revive: [] }; p.permanentStateTurns = { persist: {}, revive: {} }; this.states().forEach(function(s) { type = s.meta.permanentStates; if (type === "persist" || type === "revive") { p.permanentStates[type].push(s.id); p.permanentStateTurns[type][s.id] = this._stateTurns[s.id]; } }, this); } }, // storePermanentStates // type: The permanent state type restorePermanentStates: function(type) { var ps = DoubleX_RMMV.Permanent_States.Game_BattlerBase[this]; if (ps.permanentStates[type] && ps.permanentStateTurns[type]) { this._states = this._states.concat(ps.permanentStates[type]); Object.keys(ps.permanentStateTurns[type]).forEach(function(id) { id = +id; this._stateTurns[id] = ps.permanentStateTurns[type][id]; }, this); ps.permanentStates[type] = ps.permanentStateTurns[type] = null; } } // restorePermanentStates}; // DoubleX_RMMV.Permanent_States.Game_BattlerBaseGame_BattlerBase.prototype.initMembers = function() { // v1.01h+ var ps = DoubleX_RMMV.Permanent_States.Game_BattlerBase; ps.initMembers.apply(this, arguments); ps.initPermanentStates.call(this); // Added}; // Game_BattlerBase.prototype.initMembersGame_BattlerBase.prototype.die = function() { // v1.01a+ var ps = DoubleX_RMMV.Permanent_States.Game_BattlerBase; ps.die.apply(this, arguments); ps.restorePermanentStates.call(this, "persist"); // Added}; // Game_BattlerBase.prototype.dieGame_BattlerBase.prototype.clearStates = function() { var ps = DoubleX_RMMV.Permanent_States.Game_BattlerBase; ps.storePermanentStates.call(this); // Added ps.clearStates.apply(this, arguments);}; // Game_BattlerBase.prototype.clearStatesGame_BattlerBase.prototype.revive = function() { var ps = DoubleX_RMMV.Permanent_States.Game_BattlerBase; ps.revive.apply(this, arguments); ps.restorePermanentStates.call(this, "revive"); // Added}; // Game_BattlerBase.prototype.revive
Right now I'm thinking of using this setup to all plugins having no performance critical section(hotspot) at all.

What do you think about using containers to wrap plugin codes? Will you push this idea to the extreme(wrapping everything) just like what I did?

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