查看: 8015|回复: 14

[有事请教] 请问$gamePlayer.battler()的返回值是什么呀?

[复制链接]
梦石
0
星屑
22578
在线时间
2605 小时
注册时间
2015-7-4
回帖
917
发表于 2017-11-23 15:17:38 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
在修改Alpha_ABS,加了切换角色插件,但是无论切换成谁,伤的都是角色001的血。
查代码发现用到这个指令:$gamePlayer.battler()
1、求它的返回值
2、要换成当前所切换的角色应该怎么写
3、如何刷新当前角色
请大神指点,拜谢!
梦石
1
星屑
916
在线时间
101 小时
注册时间
2006-3-27
回帖
1019
发表于 2017-11-23 15:42:21 | 显示全部楼层
MV没研究明白,无力回答
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-11-23 18:41:58 | 显示全部楼层
常用內建指令
alert()
相當於舊版本的 p 及 msgbox 方法
alert(123); // 顯示123

console.log()
在控制台顯示變量內容,相當於VA的 p 方法
console.log(a); // 在控制台顯示 a 變量內容

试试这些语句..
回复

使用道具 举报

梦石
0
星屑
22578
在线时间
2605 小时
注册时间
2015-7-4
回帖
917
 楼主| 发表于 2017-11-23 22:16:57 | 显示全部楼层
soulsaga 发表于 2017-11-23 18:41
常用內建指令
alert()
相當於舊版本的 p 及 msgbox 方法

非常感谢,console.log()显示不出来,它应该是个类。
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-11-23 22:26:39 | 显示全部楼层
Fan723 发表于 2017-11-23 22:16
非常感谢,console.log()显示不出来,它应该是个类。

那你得传脚本让大神研究.
回复

使用道具 举报

梦石
0
星屑
22578
在线时间
2605 小时
注册时间
2015-7-4
回帖
917
 楼主| 发表于 2017-11-23 22:40:26 | 显示全部楼层
soulsaga 发表于 2017-11-23 22:26
那你得传脚本让大神研究.

哇咧……,这脚本一万两千行,估计打开的都要骂我了,这里有两个帖可以下到,就传我想修改的一段吧:
                _createPlayerParams() {
                        var bitmap = new Bitmap(160,90);
                        this.hpBar = null;
                        bitmap.addLoadListener(function()
                        {
                                //bitmap.fillRect(0,0,bitmap.width,bitmap.height, Color.RED.CSS);
                                this.hpBar = new UIObject_BarHP(bitmap, $gamePlayer.battler());
                                this.hpBar.setPosition(8, 10, 140, 24);
                                this.hpBar.refresh();

                                this.mpBar = new UIObject_BarMP(bitmap, $gamePlayer.battler());
                                this.mpBar.setPosition(8, 36, 140, 24);
                                this.mpBar.refresh();

                                if($dataSystem.optDisplayTp) {
                                        this.tpBar = new UIObject_BarTP(bitmap, $gamePlayer.battler());
                                        this.tpBar.setPosition(8, 63, 140, 24);
                                        this.tpBar.refresh();
                                }

                        }.bind(this));
                        this.spriteParams = new Sprite(bitmap);
                        this.spriteParams.x = this.x + this.faceSize;
                        this.spriteParams.y = this.y;
                        this.spriteParams.opacity = 200;
                        this.addChild(this.spriteParams);
                }

点评

没脚本没意义..  发表于 2017-11-23 23:17
回复

使用道具 举报

梦石
0
星屑
22578
在线时间
2605 小时
注册时间
2015-7-4
回帖
917
 楼主| 发表于 2017-11-23 23:21:51 | 显示全部楼层
将就这样传吧 Alpha_ABS.rar (64.08 KB, 下载次数: 74)
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2017-11-23 23:48:15 | 显示全部楼层
//NEW
        Game_Player.prototype.battler = function() {
                return this._absParams.battler;
        }
返回值在这..可能..
回复

使用道具 举报

梦石
0
星屑
852
在线时间
59 小时
注册时间
2017-9-27
回帖
17
发表于 2017-11-24 00:05:12 | 显示全部楼层
没有指定所有角色,应该返回的是带队的值。
回复

使用道具 举报

梦石
0
星屑
22578
在线时间
2605 小时
注册时间
2015-7-4
回帖
917
 楼主| 发表于 2017-11-24 00:16:52 | 显示全部楼层
本帖最后由 Fan723 于 2017-11-24 00:19 编辑
傲天狂尊 发表于 2017-11-24 00:05
没有指定所有角色,应该返回的是带队的值。

另一个插件里面切换角色部分如下,不知道怎么让它更新带队角色呢。附上插件 DIYHUD.rar (3.86 KB, 下载次数: 66)
  1.     //切换队员
  2.     Window_HUD.prototype.SwitchActor = function ()
  3.     {
  4.         //设置键值
  5.         if (Input.isTriggered('pageup'))
  6.         {
  7.             $gameParty._actors.push($gameParty._actors.shift());
  8.             this.actor=$gameParty.members()[0];
  9.             $gamePlayer.refresh();
  10.          }
  11.     };
  12.     Window_HUD.prototype.update = function ()
  13.     {
  14.         this.SwitchActor();
  15.     };
复制代码

点评

你现在应该发ABS玩家受伤的脚本..  发表于 2017-11-24 09:38
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部