Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Request / Listing] Mini Map engine  (Read 3373 times)

0 Members and 1 Guest are viewing this topic.
[Request / Listing] Mini Map engine
« on: May 28, 2006, 03:06:47 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
 ;D Hi, i need a mini map engine or an example or the script... can anyone help me?
« Last Edit: February 10, 2012, 02:49:45 pm by Niek »
Logged



i'm working on:

I support and i'm part of the team of:
Re: [REQUEST] Mini Map engine
« Reply #1 on: May 28, 2006, 03:12:18 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 563
Well I may be able to help with some theory for it hehe.

Bassicly if its a mini map that displays badguys as red dots, you need a red dot for each badguy and also you need to convert each badguys x and y possition into a new x and y possition that fits on the minimap screen, one way to do this would be to have a minimap 16 times smaller than the screen, then you'd need to devide the x and y possitions by 16 and possition the dots relative to the minimap screen.

a good idea also may be to give each badguy and each dot its own unique ID number for x and y processing purposes.
Logged

I ♥ Open Girlfriend (What!? I didn't add this.. must have been Solly!)
  • My DevArt Account

Goodnight

Once and future Captain
Re: [REQUEST] Mini Map engine
« Reply #2 on: May 28, 2006, 06:15:38 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
It will help to be more descriptive too, because there are lots of different kinds of mini-maps.

OOT uses a single sprite as a scale map of the room. Wind Waker has a box that scrolls as you move, with arrows around it. You'll have to know what objects show up on the mini-map, and what they're represented by. If you want an arrow that points in the same direction the character is facing, it's good to know how the movement script works, so you can tell which way he's facing. Lastly you'll need to know the exact scale of the mini-map in order to get the objects showing in the right places.

It can also be done by adding another view to the room, and increasing its View width and height while decreasing its Port width and height, so you get a small box that shows more of the room.
Logged
Re: [REQUEST] Mini Map engine
« Reply #3 on: May 28, 2006, 11:46:36 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
well, i get the teory, but i still need some expmles or scrpts to start from...
Logged



i'm working on:

I support and i'm part of the team of:

Goodnight

Once and future Captain
Re: [REQUEST] Mini Map engine
« Reply #4 on: May 29, 2006, 05:22:27 am »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
I'll try to express Benito's idea in some sample code.. keep in mind you'll still have to decide on how the mini-map will look and act like I explained.

Say you want one that's in OOT style: a single sprite drawn in a fixed position. The room you're in is 1280x960, the view is 320x240, and the mini-map sprite is 64x48 (with its origin at 0,0), and you want it 16 pixels from the bottom-left edge. First, do a bit of math:

64/1280 = 0.05, so that's the scale of the mini-map. It will be drawn at an x of view_xview+16 obviously, and the y will be view_yview+view_hview-16 (16-pixel space from the bottom) -48 (for the height of the sprite).

So this can go in the Draw event:
Code: [Select]
var map_x, map_y;
map_x = view_xview + 16
map_y = view_yview + view_hview - 64
draw_sprite(sprMiniMap, 0, map_x, map_y)

Now to draw a yellow dot for Link, you need to find out where he is in the room, and scale that down for the map.
Code: [Select]
var link_x, link_y;
link_x = objLink.x * 0.05
link_y = objLink.y * 0.05
draw_sprite(sprYellowDot, 0, map_x+link_x, map_y+link_y)

Then if you want a red dot for every NPC or enemy, I would recommend making a parent object for them all. Just create an object called objNPC with no code or sprite, you don't even need to place it in the room, then set all the other NPC objects' parent to that. You can use a simple loop to check all of their positions and draw them in the same manner.
Code: [Select]
var i, npc_id, npc_x, npc_y;
for (i=0; i<instance_number(objNPC); i+=1) {    // iterate once for each NPC
    npc_id = instance_find(objNPC, i)    // find the id of the i'th NPC
    npc_x = npc_id.x * 0.05
    npc_y = npc_id.y * 0.05
    draw_sprite(sprRedDot, 0, map_x+npc_x, map_y+npc_y)
}

I hope that helps a bit. There are lots of other ways to do it too. Say for instance, the room sizes and mini-map sizes all vary from room to room. Instead of calculating a different scale number for each room, you can figure it out on the fly by comparing the sprite size to the room width.
Code: [Select]
// in Create:

switch room {
    case roomA: sprite_index=sprMiniMapA; break;
    case roomB: sprite_index=sprMiniMapB; break;
    case roomC: sprite_index=sprMiniMapC; break;
}

scale_x = sprite_width / room_width
scale_y = sprite_height / room_height

// in Draw:

link_x = objLink.x * scale_x
link_y = objLink.y * scale_y

And so forth.
Logged
Re: [REQUEST] Mini Map engine
« Reply #5 on: May 29, 2006, 05:32:26 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
Awasome IT WORKED, i made a few tweaks(mixed up both ways, made a few arrangements to make it work better and voila:
Logged



i'm working on:

I support and i'm part of the team of:
Re: [REQUEST] Mini Map engine
« Reply #6 on: May 29, 2006, 07:48:22 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
That screenie looks pretty good but shouldn't the clock engine be centered?
Logged
Re: [REQUEST] Mini Map engine
« Reply #7 on: May 30, 2006, 12:16:15 am »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
 ;D yes, but that screen is just a part of the screen the rom is 304x240 and the iamge is just link ant the minimap, is awasome it works really good, and whit the aprent objects forget about a lot of scripts
Logged



i'm working on:

I support and i'm part of the team of:
Re: [REQUEST] Mini Map engine
« Reply #8 on: May 30, 2006, 07:55:34 pm »
  • Taste the soup of my brain!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 612
Good lookin' shot, but I think you should knwo, if you are making a Majora's Mask fan game, tatl is yellow, not purple.  If you are not making a MM gam, disregaurd this reply.
Logged
She'll pull out your feathers for her brand new hat and when she's done that she'll feed you to her cat.
People you love will turn their backs on you.  You'll lose your hair, your teeth. Your knife will fall of its sheath, but you still don't like to leave until the end of the movie.
If I threw my guitar out the window, so far down, would I start to regret it?  Or would I smile and watch it slowly fall?
Re: [REQUEST] Mini Map engine
« Reply #9 on: May 30, 2006, 08:47:12 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
 ;D i know, but that is not tatl, is tael(tatl's brother/sister dunno)
Logged



i'm working on:

I support and i'm part of the team of:
Re: [REQUEST] Mini Map engine
« Reply #10 on: May 31, 2006, 01:51:58 pm »
  • Hello.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 201
That looks awesome I wish I could put one in my game but it looks too hard  :'(
Logged
  • My Myspace Page
Re: [REQUEST] Mini Map engine
« Reply #11 on: May 31, 2006, 05:34:21 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
actually is not htat hard  ;D add me on msn and i teach you how
Logged



i'm working on:

I support and i'm part of the team of:

master414

Re: [REQUEST] Mini Map engine
« Reply #12 on: May 31, 2006, 05:40:44 pm »
Yeah :P he helped me 2 and now its working
Logged

flyinrooster

Re: [REQUEST] Mini Map engine
« Reply #13 on: May 31, 2006, 06:17:12 pm »
;D i know, but that is not tatl, is tael(tatl's brother/sister dunno)
it's tatl's brother  ;D. anyway, im gonna add you to my msn litium, is that ok? i can get some of the things to work, but some not, so i was wondering if you could help me  ;).
« Last Edit: May 31, 2006, 06:36:25 pm by flyinrooster »
Logged
Re: [REQUEST] Mini Map engine
« Reply #14 on: June 01, 2006, 05:10:06 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
 ;D ok, i accepted you
Logged



i'm working on:

I support and i'm part of the team of:
Re: [REQUEST] Mini Map engine
« Reply #15 on: June 07, 2006, 04:11:06 pm »
  • w00t
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1983
I've got a minimap engine here that I downloaded long ago.  It may or may not be helpful.

http://home.graffiti.net/danthemanms/minimap.gmd
Logged
What do you mean I need a life?  =P  Hm... Lives... Isn't that something that you get in Super Mario Bros?  You know, those green mushrooms?  That's a life, right?



My one and only fangame, Link Maze, may be viewed at http://www.zfgc.com/forum/index.php?topic=82.0
  • Link Maze - Zelda mini fangame
Re: [REQUEST] Mini Map engine
« Reply #16 on: June 07, 2006, 04:27:13 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
is slow and old, but is nice to get an idea.
Logged



i'm working on:

I support and i'm part of the team of:
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.348 seconds with 68 queries.

anything