Project1

标题: 關於把逃跑併入戰鬥界面代碼 還有隊形出錯 [打印本页]

作者: gay07400    时间: 2018-1-14 23:38
标题: 關於把逃跑併入戰鬥界面代碼 還有隊形出錯
搜尋版上有找到隊形併入戰鬥

Scene_Battle.prototype.createActorCommandWindow = function() {
    this._actorCommandWindow = new Window_ActorCommand();
    this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
    this._actorCommandWindow.setHandler('skill',  this.commandSkill.bind(this));
    this._actorCommandWindow.setHandler('guard',  this.commandGuard.bind(this));
    this._actorCommandWindow.setHandler('item',   this.commandItem.bind(this));
    this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
    this._partyCommandWindow.setHandler('escape', this.commandEscape.bind(this));
    this.addWindow(this._actorCommandWindow);
};

這串,但不知道到底怎麼用,直接打入YEP_BattleEngineCore直接出錯
希望有大大能解惑一下怎麼使用

隊形問題,戰鬥中調整隊形,會直接出現
cannot read property '0' of undefined 這串代碼 搜尋一下沒找到答案
><拜託大家解惑
作者: 407005278    时间: 2018-1-14 23:38
/*:
* @plugindesc 战斗选项添加逃跑
*/
Scene_Battle.prototype.createActorCommandWindow = function() {
  this._actorCommandWindow = new Window_ActorCommand();
  this._actorCommandWindow.setHandler('attack', this.commandAttack.bind(this));
  this._actorCommandWindow.setHandler('skill', this.commandSkill.bind(this));
  this._actorCommandWindow.setHandler('guard', this.commandGuard.bind(this));
  this._actorCommandWindow.setHandler('item', this.commandItem.bind(this));
  //    this._actorCommandWindow.setHandler('cancel', this.selectPreviousCommand.bind(this));
  // 加入逃跑选项
  this._actorCommandWindow.setHandler('escape', this.commandEscapeActor.bind(this));
  this.addWindow(this._actorCommandWindow);
  //this._actorCommandWindow.opacity = 150;

};

Scene_Battle.prototype.commandEscapeActor = function() {
  var actorIndex = BattleManager._actorIndex;
  BattleManager.selectNextCommand();
  BattleManager._actorIndex = actorIndex;
  this.commandEscape();
}

Window_ActorCommand.prototype.makeCommandList = function() {
  if (this._actor) {
    this.addAttackCommand();
    this.addSkillCommands();
    this.addGuardCommand();
    this.addItemCommand();
    //加入逃跑选项
    this.addCommand(TextManager.escape, 'escape', BattleManager.canEscape());
  }
};


把上面的代码复制进空记事本保存,后缀名改为 .js 就可以了。
第二个估计应该是和其他插件冲突了。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1