Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Event Direction Script Call

Status
Not open for further replies.
U

Unmercyful

Guest
Hi RPG Makers, I been working on trying to translate this Ace script call to MV and I believe I almost have it.
I have an event set up like this:


The script code in the conditional branch is:
$gameMap.event(this._eventId).x - Math.abs($gamePlayer.x) + $gameMap.event(this._eventId).y - Math.abs($gamePlayer.y) == 3

Which I translated from this Ace script:
(($game_map.events[@event_id].x - $game_player.x).abs + ($game_map.events[@event_id].y - $game_player.y).abs) == 3

The left and up sighting works:


But on the right and down positions I get nothing. I do get a diagonal sighting leftUp and leftDown, no matter how many tiles away from the event:


I'm sure there is something not right with the translation of the scripts, I know neither and I am a new learner of RPGMMV. All though, I'm trying to learn and thought that this might help me learn some in the process of getting my project going.
If anyone with the knowledge that would like help, it would be much appreciated.(smile)
 

Mr. Trivel

Praised Adventurer
Xy$
0.00
@Unmercyful,
Retranslating:
Math.abs($gameMap.event(this._eventId).x - $gamePlayer.x) + Math.abs($gameMap.event(this._eventId).y - $gamePlayer.y) === 3

Absolute values were incorrectly placed~
 
U

Unmercyful

Guest
@Unmercyful,
Retranslating:
Math.abs($gameMap.event(this._eventId).x - $gamePlayer.x) + Math.abs($gameMap.event(this._eventId).y - $gamePlayer.y) === 3

Absolute values were incorrectly placed~
I thought I had it yesterday but that did the trick! Thank you very much.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
I am closing this topic due to being solved if for any reason you would like it re-opened please report the post.
 
Status
Not open for further replies.
Top