Obective Image Placement?

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
75
Reaction score
49
First Language
English
Primarily Uses
N/A
Hello, fellow Forumidians.
I know it's been while since I've posted here, but I'm looking for a bit of graphics help.

1. I saw this thread about how to place images and had no idea what Poryg was talking about. I spent maybe 10 minutes fiddling with the X and Y values until I got it to work, and then realized I would have to do that everytime I wanted to make a new image. Here's what happened:
My coords were X:134 Y:205, the tile I wanted my image to show up on was X:137 Y:201.
In the end, the values I needed to put in were X:200 Y:58. What?
It would be very helpful if someone could explain what Poryg was talking about, because the thread is archived and I don't want to DM him, because his signature says not to message him.

2. If no one knows what to to about the above, It would also be helpful if someone knew of a way to show images in a location not relative to the player.

As usual, any advice is greatly appreciated, thank you!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,246
Reaction score
7,627
First Language
German
Primarily Uses
RMMV
I can't tell if this is the same for RM2K(3) because I only know the show picture function for VXA and later, but I have a suspicion on where you messed things up.

All makers from Ace on (and possibly earlier as well) have two different forms of handling picture coordinates. Both methods have different purposes, and you only end up with strange numbers if you mix up those two ways.

Basically you have one setting to set the principle for the origin point - either "upper left" or "center".
Center is for when you want to display a picture in the center of the screen. If you do this the direct designation coordinates you'll have to use are the center of the screen - and it won't matter anymore what the size of the picture to display is.
Using the center option for anything else is a bad idea.

Upper Left is for tile- or screen-based positioning. In this case you'll count your positions from the top left to where you want the picture appear, and the picture will begin with its upper left edge at exactly this position. And again the size of the picture doesn't matter for the positioning.

But from your description it sounds as if you set the origin principle to center and then tried to find the numbers for a tile-based position...
 

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
75
Reaction score
49
First Language
English
Primarily Uses
N/A
I can't tell if this is the same for RM2K(3) because I only know the show picture function for VXA and later, but I have a suspicion on where you messed things up.

All makers from Ace on (and possibly earlier as well) have two different forms of handling picture coordinates. Both methods have different purposes, and you only end up with strange numbers if you mix up those two ways.

Basically you have one setting to set the principle for the origin point - either "upper left" or "center".
Center is for when you want to display a picture in the center of the screen. If you do this the direct designation coordinates you'll have to use are the center of the screen - and it won't matter anymore what the size of the picture to display is.
Using the center option for anything else is a bad idea.

Upper Left is for tile- or screen-based positioning. In this case you'll count your positions from the top left to where you want the picture appear, and the picture will begin with its upper left edge at exactly this position. And again the size of the picture doesn't matter for the positioning.

But from your description it sounds as if you set the origin principle to center and then tried to find the numbers for a tile-based position...
Thanks for the reply. I'm pretty sure 2k3 doesn't have a settings menu, and I haven't seen anything like 'Origin: Center/Upper Left,' but thanks anyway.
 

Cherry

RM2k(3) Developer (English Version)
Developer
Joined
Apr 19, 2015
Messages
120
Reaction score
71
First Language
German
Primarily Uses
You are confusing tile coordinates and screen coordinates.

There are screen coordinates, which is the number of pixels from the upper-left corner on the screen to the center of the picture. This is how pictures are placed.

And then there are tile coordinates, which is the number of tiles from the upper-left corner of the map. This is how events are placed.

This is also the difference between the two sets of coordinates that you can get from "Change Variable" when referencing an event. (However, as a small gotcha, the screen coordinates you get from an event will reference its bottom center, not its middle center)

If you want to place a picture on a specific tile, you have to figure out what screen coordinates you need to put the picture on (which is not a static value unless you know for a fact that the camera will always be positioned at the exact same location when you show the picture). Also you need to enable "Move with map", because you want the picture to stick the tile even when the camera moves.

If you already have a static event on this tile, this is somewhat easy. You just need to read the event screen coordinates into variables, subtract 8 from the Y coordinate (because as mentioned above, these coordinates are from the bottom center of the event so we have to subtract half a tile's height to get the middle position), and then use these variables as coordinates for showing the picture.

If you don't have an event there, this also works as long as you have an event anywhere else on the map that you can reference. Doesn't matter where and which event, because we just need it to determine the camera position, it just has to be an event that doesn't move (because otherwise it may currently be between two tiles and then this calculation won't work). You would then do the same as above, but additionally get the event's tile coordinates into variables, subtract your desired tile coordinates from them so you get a difference in tiles, and then multiply those "X difference" and "Y difference" values by 16 (which is the width/height of a tile in pixels) and subtract that from the screen coordinates of the event. And then you got the coordinates for the picture again that you need!
 
Last edited:

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
75
Reaction score
49
First Language
English
Primarily Uses
N/A
Ok, I'll try that.
 

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
75
Reaction score
49
First Language
English
Primarily Uses
N/A
You are confusing tile coordinates and screen coordinates.

There are screen coordinates, which is the number of pixels from the upper-left corner on the screen to the center of the picture. This is how pictures are placed.

And then there are tile coordinates, which is the number of tiles from the upper-left corner of the map. This is how events are placed.

This is also the difference between the two sets of coordinates that you can get from "Change Variable" when referencing an event. (However, as a small gotcha, the screen coordinates you get from an event will reference its bottom center, not its middle center)

If you want to place a picture on a specific tile, you have to figure out what screen coordinates you need to put the picture on (which is not a static value unless you know for a fact that the camera will always be positioned at the exact same location when you show the picture). Also you need to enable "Move with map", because you want the picture to stick the tile even when the camera moves.

If you already have a static event on this tile, this is somewhat easy. You just need to read the event screen coordinates into variables, subtract 8 from the Y coordinate (because as mentioned above, these coordinates are from the bottom center of the event so we have to subtract half a tile's height to get the middle position), and then use these variables as coordinates for showing the picture.

If you don't have an event there, this also works as long as you have an event anywhere else on the map that you can reference. Doesn't matter where and which event, because we just need it to determine the camera position, it just has to be an event that doesn't move (because otherwise it may currently be between two tiles and then this calculation won't work). You would then do the same as above, but additionally get the event's tile coordinates into variables, subtract your desired tile coordinates from them so you get a difference in tiles, and then multiply those "X difference" and "Y difference" values by 16 (which is the width/height of a tile in pixels) and subtract that from the screen coordinates of the event. And then you got the coordinates for the picture again that you need!
AYYYYYYYYYYYYYYYY It worked! Thanks a bunch!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,555
Messages
1,014,624
Members
137,231
Latest member
anjing_gila
Top