I am learning RMMV JS Plugin Development. I want to create a plugin where you bribe the enemy to leave the field and give you rare treasures, just like in Final Fantasy X. But I am stuck now.
Now, I didn't do as much as I could do. Please don't comment on other codes that I didn't do right. But if my current code is the way I want it to and there is a better way to do so then please do comment it. But since I am stuck, I would want to proceed after I fix this problem. Here is the code:
I honestly do not know what to do. I ask the money to be inputted but it appears only after the following code do. Adding a message doesn't do the job either. I have improved in this plugin and have managed to do more than before I have tried making this plugin. I am still a beginner to this language (JS) and this framework (RMMV). Help would be greatly appreciated.
Now, I didn't do as much as I could do. Please don't comment on other codes that I didn't do right. But if my current code is the way I want it to and there is a better way to do so then please do comment it. But since I am stuck, I would want to proceed after I fix this problem. Here is the code:
JavaScript:
var earnItem = false;
var _Game_Action = Game_Action.prototype.apply;
Game_Action.prototype.apply = function (target) {
console.log($dataSkills[1]);
if (target.isEnemy()) {
$gameMessage.setNumberInput(1, 4); //This happens after the statements below happen and adding a message following this doesn't make this appear
target.hide();
BattleManager._rewards.items = target.makeDropItems();
BattleManager.displayDropItems();
BattleManager.gainDropItems();
}
else _Game_Action.call(this, target);
}
var _makeDropItems = Game_Enemy.prototype.makeDropItems;
Game_Enemy.prototype.makeDropItems = function () {
var items = _makeDropItems.call(this);;
items.push(this.itemObject(1, 3));
return items;
};
I honestly do not know what to do. I ask the money to be inputted but it appears only after the following code do. Adding a message doesn't do the job either. I have improved in this plugin and have managed to do more than before I have tried making this plugin. I am still a beginner to this language (JS) and this framework (RMMV). Help would be greatly appreciated.