Suppose I have a 50x50 map, but the player is viewing it through a 15x15 screen. The player needs to be able to move around to any part of the map without using the arrow keys (NOTE: The player in this scenario is simply the client's eye, not an actual mob).
Also note that at any given time certain tiles are invisible, which unfortunately means they can't be interacted with, and that sort of inhibits the idea of right-clicking to center the player's view on a tile. There doesn't seem to be any way to know which coordinates the player clicked on when clicking on an area or a screen object background.
So I'm looking for some other ideas on how to allow the player to navigate the large map through their small window without it being a pain in the butt to do. Ideally I'd like to use sliders just as the DM Map Editor uses, but that isn't supported right now, and a minimap would require far more trouble that I'm willing to put into this.
ID:151929
![]() Sep 18 2008, 2:21 am (Edited on Sep 18 2008, 2:27 am)
|
|
You could make your own slider.
Use BYOND's built-in mouse procs. You would need 102 objects though (2 sliders + 100 slider drop-zones). |
Jemai1 wrote:
You would need 102 objects though (2 sliders + 100 slider drop-zones). You can just use the objects present on the map to determine drop location. Just compare the location of the object under the mouse to the eye to find where it is from the center of your view and therefor where it would be on the screen_loc coordinates. |
I bet the slider is not 32x32 pixels in size. Scaling should be considered. Drag and Drop effects won't be handled easily especially if the map/eye updates at real time.
|
Jemai1 wrote:
I bet the slider is not 32x32 pixels in size. Scaling should be considered. Drag and Drop effects won't be handled easily especially if the map/eye updates at real time. True enough, but this comes to the point where you either do what you want and live with the problems or you move to a different system. I have gotten to the point where I don't feel like settling for less, nor do I want to spend a week doing something that takes ten minutes with a different language. Either way, yes, I had overlooked what you mentioned. |
As for sliders, you could implement that yourself. Put a couple slider objects on the client's screen and program them to slide your view around when you drag them.
Something along those lines anyway. And if you want them to see the slider sliding as it's dragged and not just when it's dropped, you can override MouseDrag() as well.
The minimap shouldn't be too bad either. You just have 1 pixel represent 1 tile, and you can represent it by a 2x2 icon grid. Just loop through the world, and draw a pixel on the grid to represent the turf.
Unless I'm forgetting something, that should be about all you need to represent the minimap. That's not the best implementation, but it's only required to be 2x2 for you, so it's good enough. It would probably be better if it were scalable, which wouldn't be too difficult a modification.
Either way, you could then set up the map's representation with a function.
Detecting where the minimap is clicked and moving to the appropriate place is the easy part, so I won't bother with that.