查看: 2089|回复: 5

[有事请教] 如何上下载具后保持人物的移动速度?

[复制链接]
梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
发表于 2022-7-28 07:42:42 | 显示全部楼层 |阅读模式

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

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

×
我发现人物只要上了载具,下来以后就会恢复游戏默认的移动速度。有什么办法可以让人物无论进入任何载具,下来以后还是保持之前的移动速度呢?
梦石
0
星屑
10274
在线时间
1919 小时
注册时间
2020-1-2
回帖
1043
发表于 2022-7-28 09:44:50 | 显示全部楼层
自己事件搞成载具不就好了

点评

游戏里不少地方都要用到,全部都改有点太麻烦了,而且有些设置可能还会起冲突。如果能有简单的全局修改方法就好了。  发表于 2022-7-28 11:06
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复

使用道具 举报

梦石
0
星屑
7997
在线时间
1442 小时
注册时间
2018-12-16
回帖
1843
发表于 2022-7-28 13:55:17 | 显示全部楼层
我都是把调整载具速度用成一个公用事件...
然后你就单独调用那个公用事件. 全部的速度就都改过去了....
回复

使用道具 举报

梦石
0
星屑
4649
在线时间
570 小时
注册时间
2018-11-12
回帖
120
发表于 2022-7-29 04:38:38 | 显示全部楼层
var _game_Player_getOnVehicle = Game_Player.prototype.getOnVehicle;
Game_Player.prototype.getOnVehicle = function() {
        this.OldMoveSpeed = this._moveSpeed;
        _game_Player_getOnVehicle.call(this);
};
Game_Player.prototype.getOffVehicle = function() {
    if (this.vehicle().isLandOk(this.x, this.y, this.direction())) {
        if (this.isInAirship()) {
            this.setDirection(2);
        }
        this._followers.synchronize(this.x, this.y, this.direction());
        this.vehicle().getOff();
        if (!this.isInAirship()) {
            this.forceMoveForward();
            this.setTransparent(false);
        }
        this._vehicleGettingOff = true;
        this.setMoveSpeed(this.OldMoveSpeed);
        this.setThrough(false);
        this.makeEncounterCount();
        this.gatherFollowers();
    }
    return this._vehicleGettingOff;
};

//将上述代码复制粘贴到任意插件最下面,即可实现楼主的想法。希望对你有所帮助。

点评

感谢大佬!您已经帮助我解决好几个问题了,您在我心中现在就是神一般的存在!我要天天仰视,膜拜您。  发表于 2022-7-29 11:23
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部