checkEventTriggerHere, why it stop the player ?

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
hi guys, why when i call a rmmv command: obj.checkEventTriggerHere([1])
its stop moveStraight player !?
am not understanding why.
i try find why with some console.log but nothing.



if I remember correctly, when the player touches an event, he is supposed to be able to continue his way , with mouse.
but play the trigger command in event, example a sound..
but its play commands event and also stop move. !?

source code, look at line:16
https://codeshare.io/GqpyDq

thank for help and if you have any idea or sugest, my game use only mouse?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
There is one idea that comes to my mind. That touch event gets triggered again and again. But it is a crazy one.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
There is one idea that comes to my mind. That touch event gets triggered again and again. But it is a crazy one.
in fact i thing it because it call this prototype
PHP:
Game_Temp.prototype.clearDestination = function() {
    this._destinationX = null;
    this._destinationY = null;
};
if i remove it , it work
but why on original game, it not stop mouse,
is it because checkEventTriggerHere() are use only for keyBoard key check, and it another method for check when using mouse move path ????
am try understand :)
its exist a similar method checkEventTriggerHere, but for mouse moving path?

thats will avoid clearDestination() ???
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
@Jonforum the system clears the destination, because the an event that is not parallel is triggered.
Specifically, the prototype that process the main map touch is this one in the rpg_scenes.js, in the Scene_Map object:

Code:
Scene_Map.prototype.updateDestination = function() {
    if (this.isMapTouchOk()) {  <-- Checks if the map touch is possible.
        this.processMapTouch(); <-- Process the map touch inserting the destination;
    } else {
        $gameTemp.clearDestination(); <-- If the map touch is not possible, the destination is cleared;
        this._touchCount = 0;
    }
};
So, if we give a little look on the isMapTouchOk method:

Code:
Scene_Map.prototype.isMapTouchOk = function() {
    return this.isActive() && $gamePlayer.canMove();
};
So, as you can see, the map touch will return ok if the Game Player can Move. If we give a deep look in that method of the Game Player object you can notice this:

Code:
Game_Player.prototype.canMove = function() {
    if ($gameMap.isEventRunning() || $gameMessage.isBusy()) { <-- LOOK HERE
        return false;
    }
    if (this.isMoveRouteForcing() || this.areFollowersGathering()) {
        return false;
    }
    if (this._vehicleGettingOn || this._vehicleGettingOff) {
        return false;
    }
    if (this.isInVehicle() && !this.vehicle().canMove()) {
        return false;
    }
    return true;
};
$gameMap.isEventRunning() check if an event is currently running on the map meaning that if it returns true, the method will return false and so the map touch will be considered not possible by the system.

So this is the flow:

MAP TOUCH --> CHECK IF THE MAP TOUCH IS POSSIBLE --> CHECK IF THE GAME PLAYER CAN MOVE --> IF YES, THE DESTINATION IS FOLLOWED; IF NO, THE DESTINATION IS CLEARED ($gameTemp.clearDestination()) .

So, for achieve your objective you can follow different paths:
• Make a condition for the Game Player canMove;
• Remove the clearDestination from the MapTouch method;
• Change the isMapTouchOk Method;
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@Gamefall Team
thank a lot my friend, i will take a look soon as possible the logic you give me, am on AE for now .
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top