public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

Event/Script solution for picture movement using Designate by Variable

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: Event/Script solution for picture movement using Designate by Variable
  • Original author: ZombieKidzRule
  • Original date: March 17, 2023
  • Source thread: https://forums.rpgmakerweb.com/threads/event-script-solution-for-picture-movement-using-designate-by-variable.155886/
  • Source forum path: Game Development Engines > RPG Maker MZ Support

Summary

So I have been experimenting with on map, turn-based movement for combat. I started by using pictures to represent the actors and I establish their pixel X and pixel Y coordinates. Since the tiles are 48x48 pixels, I then use variables called DestinationX and DestinationY to determine what the destination coordinates will be by adding or subtracting 48 and check those coordinates to make sure something isn't there already and the movement can happen. This is working fine and I like the smooth movement of the actor pictures. However, I...

Archived First Post

So I have been experimenting with on map, turn-based movement for combat. I started by using pictures to represent the actors and I establish their pixel X and pixel Y coordinates. Since the tiles are 48x48 pixels, I then use variables called DestinationX and DestinationY to determine what the destination coordinates will be by adding or subtracting 48 and check those coordinates to make sure something isn't there already and the movement can happen.

This is working fine and I like the smooth movement of the actor pictures. However, I have run into a bit of an issue.

Early on I realized that my map is bigger than the playtest viewable area. This actually effects the pixel X and pixel Y values since I am using the Center option for placement of the pictures and as I move the pictures, I add or subtract 48 from the coordinates. But the starting coordinates of the pictures are not the same as the overall pixels of the map. The playtest viewable area width and height in pixels are not necessarily the same at the map width and height in pixels.

Meaning, when I first calculate the starting coordinates of any actor/picture on the screen, the pixel coordinates are based on the playtest viewable area and not the overall coordinates of the map. For example, for an X coordinate of 48 x 5 (plus 24 to center the picture in the middle of a tile) that would be the 6th tile in the viewable area in the playtest. However, that doesn't mean that is the 6th tile of the map because the map might extend beyond the viewable playtest area.

My current testing map is 17x17. So the entire width of the map is viewable in playtest, but the entire height isn't.

The problem I discovered is when I am trying to determine the Region ID of the Destination coordinates. When I am checking those coordinates moving left or right, I get the correct Region ID of the Map as if I was using the 0, 0 to 16, 16 coordinates and I can check for obstacles.

But, when I do the same thing moving up or down, the Region ID of the Map for the destination coordinates (which I divide the pixel values by 48) comes out to different actual coordinates.

So, moving left or right, my destination pixel coordinates divided by 48 show 5, 5 and the Region ID I want is the one for tile 5, 5. Cool. My map width and playtest view screen width are the same.

But if I move up or down, my destination pixel coordinates divided by 48 might show 3, 7 while the actual Region ID of the tile the picture would be moving to (center of tile) might be 3, 9. I believe it is off by the same number of tiles that DON'T show in the playtest viewable area.

I have tried all sorts of math to try to compensate/correct for this, but I am stumped.

Now, I can fix this by making sure the combat map is the same size as the viewable playtest area. But that also means my combat area is unnecessarily limited.

I also was just playing around with using Events and Set Event Location instead of pictures because that way I don't have to calculate the pixels for coordinates and movement. But the downside to that is I can only choose from assets that can be selected in the Event for displaying the actors. With the pictures, the actors/pictures can actually be scaled so they don't necessarily have to be squashed into the confines of the tile size. Also, the appearance of the event movement using Set Event Location is jerky. It doesn't look like the actor is moving, rather it just jumps from tile to tile.

I'm not sure if this makes sense. I will attach a few screenshots to show the pixel coordinate designation and some other stuff. These aren't the entire events because I have tested a bunch of stuff that seems to be working fine.

Maybe I am doing something wrong with the whole pixel stuff. I thought I was on the right track when I could move the picture exactly one tile at a time using the pixel coordinates and plus or minus 48, as appropriate.

But the whole pixel size of the viewable playtest area compared to the pixel size of the entire map is throwing me off.

Again, it seems like it works fine if the actual map fits perfectly in the playtest viewable area. But I would like to be able to let the player move the picture/actors anywhere on a larger map.

Maybe I will also get stuck with scrolling the map too. I haven't tested that yet because I sort of got stuck with the whole use Region ID to check to see if there is an obstacle that you can't move to.

Maybe I am missing another alternative because I am stuck on this path and can't seen any other options. Or maybe it is based on my lack of knowledge and experience.

If there is an entirely different way to approach this, without plugins, I would also love to hear about that too since I am trying to learn.

And again, the map and squashed Reid isn't pretty. I am just using this for quick proof of concept testing. LOL!

And again, the screenshots aren't the full events. They are just to show the relevant concepts of what I am trying to do. And you might be able to tell I also have tested a wide variety of things.

I started off (not shown) by displaying a chess board and moving the Evil Teddy from square to square. I have tried menu driven movement choices, key press driven movement choices, and most recently (not shown) click on 8 directional arrows to move.

The biggest problem right now is trying to determine if the actor/picture can move to a tile with an obstacle where it shouldn't be able to move. Maybe there is a better/easier way to do that without Region ID.

If the whole using pixels for coordinates is just too problematic for maps that are bigger than the playable screen area, then that would be good to know so I can devote my time to another path.

I hope this Frankenstein Monster makes sense and thank you so much for taking the time to look at this and trying to decipher that ramblings of an old, RPG Maker newbie!

Protected downloadProtected downloadProtected downloadProtected downloadProtected downloadProtected downloadProtected downloadProtected downloadProtected download

EDIT: UPDATING WITH VIDEO OF PROBLEM:

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

Referenced Images / Attachments

Movement by Pixel Coordinates 1.png
Movement by Pixel Coordinates 1.png
Movement by Pixel Coordinates 2.png
Movement by Pixel Coordinates 2.png
Movement by Pixel Coordinates 3.png
Movement by Pixel Coordinates 3.png
Movement by Pixel Coordinates 4.png
Movement by Pixel Coordinates 4.png
Movement by Pixel Coordinates 5.png
Movement by Pixel Coordinates 5.png
Movement by Pixel Coordinates Map.png
Movement by Pixel Coordinates Map.png
Movement by Pixel Coordinates Playtest Area.png
Movement by Pixel Coordinates Playtest Area.png
Movement by Pixel Coordinates Region ID.png
Movement by Pixel Coordinates Region ID.png
Movement by Pixel Coordinates Squashed Reid.png
Movement by Pixel Coordinates Squashed Reid.png
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#mz-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar