New account registration is temporarily disabled.

[RM2K3] EASY WAY TO GET X/Y FOR MAP ALIGNED 'PICTURES'? / TINT SCREEN QUESTION

Posts

Pages: 1
Hey there guys!

I've recently been messing around a day/night system, and I'd like to display a 'picture' during the night - for bright street lights, etc. I need them to ignore the "tint screen". Even though I've got the "follow map" option checked, the coordinates for the picture are screen based, not map based. Since the map has different entry points, the display picture command would have different X / Y coords in every teleport event.

I've aligned the picture by hand, by trial & error and some minor calculation, in the past, is there are a clever way to align the center of the picture with the center of the map? The display picture can get X/Y from variables, so I guess that a clever algorithm could do the trick. The engine can access the hero/camera X/Y and screen relative X/Y.

I can't test this at the moment, but my guess is, that I should take the screen relative Hero X/Y and add the difference in x/y position between the hero and the center of the map. That's my theory, any suggestions?

*

As a side question - I'm using tint screen for the day/night/sunset/dawn screen color/fade - is there a way to show a graphics which ignores the screen tint? Of course except the pictures, the battle animations ignore it too IIRC, but are impractical in my case, I think. Charsets would be best, but there's no stock way to make them display without tints IIRC - I have no idea about programming whatsoever, but maybe this can be done with DynRPG? Like the additive transparency plugin - adding a "suffix" after the charset's filename would make it "fullbright" - but still fading out during the transitions between maps, battles, menu. etc. Is this possible?
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
In the options for Show Picture, check the "Picture Scroll with Map" checkbox. Now the image will move around as the map does.

If you are having trouble figuring out where the pic should start, then yeah, I guess you'll want to do it with variables. Instead of calculating it using the hero coordinates (which is a pain in the ass to figure out unless the map endlessly loops, because the hero isn't always in the middle of the screen) I would actually have the events that teleport you into this map set two variables, for the x and y coordinates of the tile that is the upper left most tile on the screen after the player appears on the new map. Don't calculate this, just figure out what it is for each teleport spot by looking at the screen. You only have a few teleport spots, right?

Once you have the coordinates of the upper left most tile that's visible to the player when they first appear (tile coordinates, not pixel coodinates) figure out how far to the right and how far down from that you want the picture. If the tile where you want the picture is 6 tiles to the right and 3 tiles down from that, multiply both of those numbers by 16, and set the picture's coordinates to <96, 48>.

Or set two variables to 96 and 48, and have the picture's appearance be based on those variables. Either way.

Also!

To change a topic title, scroll all the way down, below the reply box, to where it says Actions. There's usually just a Subscribe button there, but if you created the topic, there's also an Edit Topic button there.
Hey, thanks for the reply and tip!

It turned out, I'll have to think of a "smart" method anyway, since nightfall can happen while wandering on the map - kinda forgot about it. :)

I've managed to do a working common event for this, it requires the size of the map (in grid units) to be input to the variables before teleporting to the map, and doesn't work correctly when the map dimensions are not an even number (this results in the picture being shifted by 8 pixels) - I might try to fix it inside the event, currently I did a workaround and just rounded down the size I put in the variables.

I still have to reinforce a limit - if you approach the edge, and you're in the "non scrolling" space, the picture is not in the correct spot but that should be an easy fix.

I can write down the events for it once I'm done - could be useful for somebody. :) It's just a simple process that calculates the distance between the hero and the center of the map.
author=Cage
I can't test this at the moment, but my guess is, that I should take the screen relative Hero X/Y and add the difference in x/y position between the hero and the center of the map. That's my theory, any suggestions?


Yeah, I think that's basically what you'd have to do. I have a parallel process common event running at all times that gets the hero's X, Y, Map ID, screenX & screenY for various applications, and that type of thing would come in handy here.

When you need to draw the picture, call a common event that calculates the X/Y position of the image based on the hero's screen position X/Y. It would be something along the lines of (ScreenX*16)/2.

author=Cage
As a side question - I'm using tint screen for the day/night/sunset/dawn screen color/fade - is there a way to show a graphics which ignores the screen tint? Of course except the pictures, the battle animations ignore it too IIRC, but are impractical in my case, I think. Charsets would be best, but there's no stock way to make them display without tints IIRC - I have no idea about programming whatsoever, but maybe this can be done with DynRPG? Like the additive transparency plugin - adding a "suffix" after the charset's filename would make it "fullbright" - but still fading out during the transitions between maps, battles, menu. etc. Is this possible?


The simple solution is to not use tint screen. Make a plain white image. If you use photoshop, index it so it's only 2 colors (transparency & white) and make the image tiny, but the same ratio as 320x240, since small image files are generally faster to load. I think I use an 80x60 image. Then in your event, draw the picture with a zoom of 400%, transparency to what you need it to be, and set the tint to something below 100 for each color. You'll get the same effect as a tint screen.
Pages: 1