I came across a YouTube tutorial by The Odie that was using this script call:
$gameMap._events[14].moveStraight($gameMap._events[14].findDirectionTo( $gamePlayer.x,$gamePlayer.y ));
to move an event toward a player (actually, to chase a player, but the desired outcome was still event --> player). I tried to implement it, but it isn't acting correctly. The setup is I have a character who is circling a sofa while the main character speaks with someone in the other room. That triggers a switch, and when the main character steps back into the living room, I have a script to trip that other character/event's self-switch A. That is when I'm trying to use this script to make that event walk to where my character is standing. I tried the script both as written, as well as swapping out the event number with the this_eventId used in the actual video because that made the game crash.
The issue is when the event starts to walk, it doesn't come the full way and/or skips awkwardly over the otherwise impassable sofa. I have also tried to simply event the movement rout to have the event move toward the player, but with the same issues.
Lastly, I tried the pathfinding script in the spreadsheet: this.moveStraight(this.findDirectionTo(X, Y)); and still didn't have any success.
What am I doing wrong?
$gameMap._events[14].moveStraight($gameMap._events[14].findDirectionTo( $gamePlayer.x,$gamePlayer.y ));
to move an event toward a player (actually, to chase a player, but the desired outcome was still event --> player). I tried to implement it, but it isn't acting correctly. The setup is I have a character who is circling a sofa while the main character speaks with someone in the other room. That triggers a switch, and when the main character steps back into the living room, I have a script to trip that other character/event's self-switch A. That is when I'm trying to use this script to make that event walk to where my character is standing. I tried the script both as written, as well as swapping out the event number with the this_eventId used in the actual video because that made the game crash.
The issue is when the event starts to walk, it doesn't come the full way and/or skips awkwardly over the otherwise impassable sofa. I have also tried to simply event the movement rout to have the event move toward the player, but with the same issues.
Lastly, I tried the pathfinding script in the spreadsheet: this.moveStraight(this.findDirectionTo(X, Y)); and still didn't have any success.
What am I doing wrong?