查看: 2887|回复: 3

[有事请教] 允许穿透的事件不能通过与事件和与角色接触触发

[复制链接]
梦石
0
星屑
141
在线时间
16 小时
注册时间
2024-5-8
回帖
4
发表于 2024-5-15 16:09:21 | 显示全部楼层 |阅读模式

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

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

×
能否修改成即使是可穿透的事件也和不可穿透的事件一样触发
梦石
2
星屑
8479
在线时间
463 小时
注册时间
2021-12-4
回帖
486

MZ评测员

发表于 2024-5-16 13:28:31 | 显示全部楼层
Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
    if (!$gameMap.isEventRunning()) {
        if (this._trigger === 2 && $gamePlayer.pos(x, y)) {
            if (!this.isJumping() && this.isNormalPriority()) { // 似乎跟穿透与否没有关系, 跟优先级有关系,你改成「和玩家相同」试试?
                this.start();
            }
        }
    }
};
回复

使用道具 举报

梦石
0
星屑
141
在线时间
16 小时
注册时间
2024-5-8
回帖
4
 楼主| 发表于 2024-5-16 13:36:10 | 显示全部楼层
小秋橙 发表于 2024-5-16 13:28
Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
    if (!$gameMap.isEventRunning()) { ...

和玩家相同也不能触发。。。是不是设置为穿透会自动修改优先级啊
回复

使用道具 举报

梦石
2
星屑
8479
在线时间
463 小时
注册时间
2021-12-4
回帖
486

MZ评测员

发表于 2024-5-16 15:58:23 | 显示全部楼层
dsqcr 发表于 2024-5-16 13:36
和玩家相同也不能触发。。。是不是设置为穿透会自动修改优先级啊

Game_CharacterBase.prototype.moveStraight = function(d) {
    this.setMovementSuccess(this.canPass(this._x, this._y, d));
    if (this.isMovementSucceeded()) {
        this.setDirection(d);
        this._x = $gameMap.roundXWithDirection(this._x, d);
        this._y = $gameMap.roundYWithDirection(this._y, d);
        this._realX = $gameMap.xWithDirection(this._x, this.reverseDir(d));
        this._realY = $gameMap.yWithDirection(this._y, this.reverseDir(d));
        this.increaseSteps();
        this.checkEventTriggerTouch(this._x, this._y); // 本行为新增内容,位于rmmz_objects.js第7400行左右
    } else {
        this.setDirection(d);
        this.checkEventTriggerTouchFront(d);
    }
};
// 编辑器里用词用的不好,应该把「接触」改成「碰撞」的……
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部