设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4704|回复: 1
打印 上一主题 下一主题

[有事请教] 關於把逃跑併入戰鬥界面代碼 還有隊形出錯

[复制链接]

Lv1.梦旅人

梦石
0
星屑
27
在线时间
54 小时
注册时间
2015-10-18
帖子
15
跳转到指定楼层
1
发表于 2018-1-14 23:38:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
30星屑
搜尋版上有找到隊形併入戰鬥

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 這串代碼 搜尋一下沒找到答案
><拜託大家解惑

最佳答案

查看完整内容

/*: * @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 ...

Lv3.寻梦者

梦石
0
星屑
1020
在线时间
245 小时
注册时间
2011-3-5
帖子
25
2
发表于 2018-1-14 23:38:37 | 只看该作者
/*:
* @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 就可以了。
第二个估计应该是和其他插件冲突了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-13 03:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表