Also the code is supposed to be wrapped in:
(function() {
})();
So like this:
/*:
* @plugindesc This is the Achievements Plug-in!
*
*
* @author TagumonYatsuray
*
* @Param Achievements
* @Desc This is the Achievements Parameter
* @Default 0
* @help This is the help file!
*
*/
(function() {
Scene_Boot.prototype.start = function() {
Scene_Base.prototype.start.call(this);
SoundManager.preloadImportantSounds();
if (DataManager.isBattleTest()) {
DataManager.setupBattleTest();
SceneManager.goto(Scene_Battle);
} else if (DataManager.isEventTest()) {
DataManager.setupEventTest();
SceneManager.goto(Scene_Map);
} else {
this.checkPlayerLocation();
DataManager.setupNewGame();
SceneManager.goto(Scene_Title);
Window_TitleCommand.initCommandPosition();
}
this.updateDocumentTitle();
};
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.addCommand('Achievements', 'Achievements', true);
}
var xScene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
xScene_Menu_createCommandWindow.call(this);
this._commandWindow.setHandler('Achievements', this.commandAchievements.bind(this));
};
Scene_Menu.prototype.commandAchievements = function() {
SceneManager.push(Scene_Achievements);
};
//-----------------------------------------------------------------------------
function Window_Sample() {
this.initialize.apply(this, arguments);
}
Window_Sample.prototype = Object.create(Window_Base.prototype);
Window_Sample.prototype.constructor = Window_Sample;
Window_Sample.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_Sample.prototype.windowWidth = function() {
return 350;
};
Window_Sample.prototype.windowHeight = function() {
return 350;
};
Window_Sample.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
};
Window_Sample.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
function Scene_Achievements() {
this.initialize.apply(this, arguments);
}
Scene_Achievements.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Achievements.prototype.constructor = Scene_Achievements;
Scene_Achievements.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createSampleWindow();
};
Scene_Achievements.prototype.createCommandWindow = function() {
Scene_MenuBase.prototype.createCommandWindow.call(this);
this._commandWindow.setHandler('Achievements', this.commandAchievements.bind(this));
};
Scene_Achievements.prototype.createSampleWindow = function() {
this._windowSample = new Window_Sample(0, 0);
this._windowSample.x = Graphics.width;
this._windowSample.y = Graphics.height;
this.addWindow(this._windowSample);
}
Scene_Achievements.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
if (Input.isTriggered('cancel')) {
SceneManager.goto(SceneManager._previousClass);
}
}
Scene_Achievements.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
this._windowSample.refresh();
};
})(); // dont touch this.
Now this here next part is my achievement code, which I know works. I modified it to work with yours. I had it do some other stuff so I quickly stripped it. Let me know if anything's wrong.
Code:
/*:
* @plugindesc This is the Achievements Plug-in!
*
*
* @author TagumonYatsuray
*
* @Param Achievements
* @Desc This is the Achievements Parameter
* @Default 0
* @help This is the help file!
*
*/
(function() { // Do not touch RMMV uses this to wrap the code
var parameters = PluginManager.parameters('Achievements Plugin');
var _Scene_Menu_createCustomMenuWindow = Scene_Menu.prototype.createCommandWindow;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.addCommand("Achievements", 'achievements', true);
};
Scene_Menu.prototype.createCommandWindow = function() {
_Scene_Menu_createCustomMenuWindow.call(this);
this._commandWindow.setHandler('achievements', this.commandAchievements.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Menu.prototype.commandAchievements = function() {
SceneManager.push(Scene_Achievements);
};
//-----------------------------------------------------------------------------
// Window_Achievements
//
// The window for displaying achievements.
function Window_Achievements() {
this.initialize.apply(this, arguments);
}
Window_Achievements.prototype = Object.create(Window_Base.prototype);
Window_Achievements.prototype.constructor = Window_Achievements;
Window_Achievements.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_Achievements.prototype.windowWidth = function() {
return 350;
};
Window_Achievements.prototype.windowHeight = function() {
return 350;
};
Window_Achievements.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(2,0,0);
};
Window_Achievements.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createCommandWindow();
this.createAchievementsWindow();
this.createStatusWindow();
};
Scene_Achievements.prototype.createAchievementsWindow = function() {
this._achievementsWindow = new Window_Achievements(0, 0);
this._achievementsWindow.y = Graphics.boxHeight - this._achievementsWindow.height;
this.addWindow(this._achievementsWindow);
};
//-----------------------------------------------------------------------------
// Scene_Achievements
//
// The scene class of the menu screen.
function Scene_Achievements() {
this.initialize.apply(this, arguments);
}
Scene_Achievements.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Achievements.prototype.constructor = Scene_Achievements;
Scene_Achievements.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._achievementsWindow = new Window_Achievements(0,0);
this._achievementsWindow.x = 0;
this._achievementsWindow.y = 0;
this.addWindow(this._achievementsWindow);
};
Scene_Achievements.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
};
Scene_Achievements.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
if(Input.isTriggered('cancel')) {
SoundManager.playCancel();
SceneManager.goto(Scene_Menu);
}
}
})(); // dont touch this.