I want to have a picture of my map (like a mini map) and when people click it they will be teleported to the place they clicked (the place clicked on the map that is), such as system was made before in Xoule's charmed games, I realize in order to do this I must match the pixel coordinates with the actual xyz via MouseUp() but I don't know how to do that; what is more I don't know how to get the mini map picture. Thanks in advance.
- Miran94
ID:161357
![]() May 17 2008, 2:04 am
|
|
![]() Jan 20 2009, 9:00 pm
|
|
Lol... Miran... The Terrorist! Lol... Sorry i had to throw that in there. :P Anyway to get the picture. The easiest thing for you to do is make the screen as large as you can and take a Screen shot. Thats the easier way. There are harder ways that make the picture come out much nicer. But i wont give away to many of my secrets. Anyway. The only problem with the screen shot pictures is that grey box outline. Which can easily be replaced or cropped out. Id also suggest making the picture about... twice the size as it is now. Maybe larger. Small maps are harder to click exactly where you want to go. Lol.
|
A cool idea for sure, here is a good place to start:
First you need the maps to click on. Yes it is possible to pre-generate these maps yourself using screen shots as suggested by Moussiffer, however this leads to a lot more work by you and also leaves no room for expansion. This is why I would suggest you actively generate the mini map during runtime. How would you do this? The HUB is filled with fun little demos on all kinds of things, and one of them happens to be making mini maps. Here are two I would suggest looking at: http://www.byond.com/developer/Crispy/Mapper http://www.byond.com/developer/Zaltron/MiniMapGenerator The first generates the mini map in a browser, the second in game. The second is going to be more along the lines of what you want but both are good to look at as a reference. Once you figure out how to generate the mini map you need to implement the click-teleport system. As a personal method I would suggest doing part 1 and part 2 separately. (that is, first learn how to make mini maps then learn how to make click based teleportation on a small grid that happens to be the size of the mini maps you are generating) Then once you have both functioning combine the two to create the teleporty-grid that has a pretty image on it that matches your map. (Side note: Firefox is telling me that teleport isn't a word... Wtf? Fail firefox... fail...) EDIT: I was going to suggest creating an individual object to display on the client screen for each x/y coordinate you could teleport to.. HOWEVER, I removed all of the text following this because once you throw a few hundred objects onto the screen then your BYOND starts lagging up real good. There is another approach to this, which involves grabbing the actual X and Y of your click... Which is a much wiser way to approach it anyway. I will see if I can figure it out tonight, if not I'm sure an older BYONDer can fill in the blanks. Basically you're going to want to look up icon-x and icon-y in the mouse controls section of the DM Reference. Sorry about that, Good luck still! EDIT AGAIN!!! Alrighty then. Here is the 100% working code that I threw together. It isn't the prettiest in the world, but I threw in some crude commentary so you can get a generic understanding of what I'm doing. obj/ASystem/ClickNGo Hopefully that will get you moving in the right direction. Now it is up to you to apply a pretty picture to the ugly black boxes. :) Good luck again! |