Automapping Layouts to a pause screen map

  • First image is based of my design, but I see a mistake: you must set variables LocalMap to

    |- Set LocalMapX" to loopindex("X")

    |- Set LocalMapY" to loopindex("Y")

    Also place those local vars underneath loops and even more underneath create blank event where actions for those variables will be. Underneath that nest arraymap events

    EDIT@ I've made mistake here

    |For "X" From 0 To "floor(layout.width/OriginalWindowHeight)"

    |For "Y" From 0 To "floor(layout.height/OriginalWindowWidth)"

    should be

    |For "X" From 0 To "floor(layout.width/OriginalWindowWidth)"

    |For "Y" From 0 To "floor(layout.height/OriginalWindowHeight)"

  • There is another mistake :

    ||- Spawn sprite "MiniMapRoom" ( or whatever it is called; It's the object to display as room on MiniMap ) at "X: MapBackground.X+(ArrayMap.CurX*MiniMapRoom.Height)" & "Y MapBackground.Y+(ArrayMap.CurY*MiniMapRoom.Width)"

    Width goes with X and height with Y. Was typing very fast . Sorry for that ( but you should know this anyway ;p ).

    I'm making capx for you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There you go

    https://drive.google.com/file/d/0B0jUjWN7LcQhQklOa0VXaGhUb2c/view?usp=sharing

    Hotspots for Detector, MapBackground, Minimaproom have to be at 0,0, top left corner. You can modify the events if you want to start form other position, but that's the easiest. Also, take note of instances preferences.

    Room Instance is there for you, to add coordinations of rooms, using top left corner of the room, when referencing to the spreadsheet. For example, from room the size of 4 screens located at : 12,10|12,11|13,10|13,11| , you will set Room variables to PositionX=12 and PositionY=10

  • There you go

    https://drive.google.com/file/d/0B0jUjWN7LcQhQklOa0VXaGhUb2c/view?usp=sharing

    Hotspots for Detector, MapBackground, Minimaproom have to be at 0,0, top left corner. You can modify the events if you want to start form other position, but that's the easiest. Also, take note of instances preferences.

    Room Instance is there for you, to add coordinations of rooms, using top left corner of the room, when referencing to the spreadsheet. For example, from room the size of 4 screens located at : 12,10|12,11|13,10|13,11| , you will set Room variables to PositionX=12 and PositionY=10

    Thanks a lot, will remember to give credit to you for the map!

    I'm definitely give this a good study and implement it into the game as well, I'll see if I can add another array which will set which animation for the mini-map (So they look like more details as rooms instead of pure boxes).

    By hotspots you mean origin? Looks like it. I'll most likely leave that as is.

    [quote:2lqv1kg8]For example, from room the size of 4 screens located at : 12,10|12,11|13,10|13,11| , you will set Room variables to PositionX=12 and PositionY=10

    What do you mean? Like I set the variables for each of the 12, 10, | 12,11 | 13, 10 | 13, 11| co-ordinates? I saw in the .capx it's just left as zeroes.

    This is an immense help!

    Anyway to get the room the player is in show in the mini-map?

  • megatronx

    I'm noticing that when I enter another layout, the mini-map gets kind of reset or something and the Minimaproom gets created on top of existing ones.

  • megatronx

    I'm noticing that when I enter another layout, the mini-map gets kind of reset or something and the Minimaproom gets created on top of existing ones.

    What do you mean? Like I set the variables for each of the 12, 10, | 12,11 | 13, 10 | 13, 11| co-ordinates? I saw in the .capx it's just left as zeroes.

    No, you need to map out whole world in spreadsheet first. Room instance is there to tell events about the position of the room in relation to the whole "world". But only top-left coordination is important. The rest is generated trough events.

    Coordinates 12, 10 | 12,11 | 13, 10 | 13, 11| are coordinates of 1 room of the size of 4 screens. Go in to something like excel or open office math and map those numbers according to their coordinates. You'll see that you will have 4 "1" creating a square.

    As for issue with minimaproom object multiplying itself, maybe that's because it is global, so switch it to not be global. Experiment.

    If you still have issues, just send me capx

    Thx for credits!

  • megatronx

    The test map I have right now shows up as the one on the right when I set up the minimap, exactly like yours.

    The mock up on the left is how it's supposed to look. I think they are getting reset somehow.

    I'll look into it more tomorrow.

  • > megatronx

    > 1.Coordinates 12, 10 | 12,11 | 13, 10 | 13, 11| are coordinates of 1 room of the size of 4 screens. Go in to something like excel or open office math and map those numbers according to their coordinates. You'll see that you will have 4 "1" creating a square.

    >

    > 2.As for issue with minimaproom object multiplying itself, maybe that's because it is global, so switch it to not be global. Experiment.

    >

    > 3.If you still have issues, just send me capx

    >

    > 4.Thx for credits!

    >

    1. Not sure I understand, so each layout only needs one room object in the top left corner?

    2. It's more kind of pasting itself over already existing ones, it's kind of weird.

    3. I actually might, but tomorrow.

    4. No problem! I give credit where credit is due.

  • >

    > > megatronx

    > > 1.Coordinates 12, 10 | 12,11 | 13, 10 | 13, 11| are coordinates of 1 room of the size of 4 screens. Go in to something like excel or open office math and map those numbers according to their coordinates. You'll see that you will have 4 "1" creating a square.

    > >

    > > 2.As for issue with minimaproom object multiplying itself, maybe that's because it is global, so switch it to not be global. Experiment.

    > >

    > > 3.If you still have issues, just send me capx

    > >

    > > 4.Thx for credits!

    > >

    >

    1. Not sure I understand, so each layout only needs one room object in the top left corner?

    2. It's more kind of pasting itself over already existing ones, it's kind of weird.

    3. I actually might, but tomorrow.

    4. No problem! I give credit where credit is due.

    1. Each layout needs one room object, but doesn't matter where it is! What you need to do is map out your "world" in spreadsheet, so you can apply coordinates of the room to room object, and if your room is bigger then one screen, you give it coordinates of top-left part of the room.

    2. Destroy on making invisible.

    KK

    M

  • 1. Each layout needs one room object, but doesn't matter where it is! What you need to do is map out your "world" in spreadsheet, so you can apply coordinates of the room to room object, and if your room is bigger then one screen, you give it coordinates of top-left part of the room.

    2. Destroy on making invisible.

    KK

    M

    I figured out how to use it! How do array's work though, can I go into negative values?

    I had an error where a minimap box would always be made in at the origin of the MapBG:

    But I think I solved it, problem might've been that I was setting the detect in the layout editor too close to the map, when I put it far away from the interactive part of the map, it stopped showing up.

    I've figured out it (I think)

    Aside from one minimapbox missing, which I think is my fault since that part of the room wasn't the size of the game window, it's exactly how it's supposed to look like, according to the co-ordinates!

    Is there anyway for the map to pan around instead of being static, without going outside of the MapBG? And to show which room the player is in? This is really complicated for me..

  • >

    > 1. Each layout needs one room object, but doesn't matter where it is! What you need to do is map out your "world" in spreadsheet, so you can apply coordinates of the room to room object, and if your room is bigger then one screen, you give it coordinates of top-left part of the room.

    >

    > 2. Destroy on making invisible.

    >

    > KK

    > M

    >

    I figured out how to use it! How do array's work though, can I go into negative values?

    I had an error where a minimap box would always be made in at the origin of the MapBG:

    But I think I solved it, problem might've been that I was setting the detect in the layout editor too close to the map, when I put it far away from the interactive part of the map, it stopped showing up.

    I've figured out it (I think)

    Aside from one minimapbox missing, which I think is my fault since that part of the room wasn't the size of the game window, it's exactly how it's supposed to look like, according to the co-ordinates!

    Is there anyway for the map to pan around instead of being static, without going outside of the MapBG? And to show which room the player is in? This is really complicated for me..

    There you go. Several changes, so go trough all new stuff.

    https://drive.google.com/file/d/0B0jUjWN7LcQhSDduQVh2Z2J0Rzg/view?usp=sharing

  • There you go. Several changes, so go trough all new stuff.

    https://drive.google.com/file/d/0B0jUjWN7LcQhSDduQVh2Z2J0Rzg/view?usp=sharing

    Oh my, that's incredible.

    I was going to ask if there's any way to make the rooms spawn in the middle of the MapBG instead of the top left corner, but then I took a couple swings at it myself and it was just changing the origin of the mapBG.

    This is amazing, I'll send you a link to my game's HTML5 demo after I'm done implementing this beast into the game.

    Oh by the way, how would I reset the map back to zero if say the player dies and starts a new game from the menu?

    Would I just clear the array?

  • >

    > There you go. Several changes, so go trough all new stuff.

    >

    > https://drive.google.com/file/d/0B0jUjWN7LcQhSDduQVh2Z2J0Rzg/view?usp=sharing

    >

    Oh my, that's incredible.

    I was going to ask if there's any way to make the rooms spawn in the middle of the MapBG instead of the top left corner, but then I took a couple swings at it myself and it was just changing the origin of the mapBG.

    This is amazing, I'll send you a link to my game's HTML5 demo after I'm done implementing this beast into the game.

    Oh by the way, how would I reset the map back to zero if say the player dies and starts a new game from the menu?

    Would I just clear the array?

    Cool.

    Yeah, clear the array and reset detectors or layouts, so the old detectors will be replaced with new ones. Can't remember from top of my head, but there might be a system action to do that. Reset layouts, or persistent object it might have been.

  • Here's a new version

    https://drive.google.com/file/d/0B0jUjW ... sp=sharing

    Few changes ( and couple of leftovers from failed experiment too). Now the room cell that player is in, is appearing in the center of the map.

    Origin of MapBG must be at 0,0, while origin of the minimaproom has to be in the middle, cause I don't know what I did, but technically it shouldn't work the way I did it... but it does! At least in my example.

  • megatronx

    After playing around with it, I noticed it breaks after I put the events for making the make in another event sheet for another layout.

    https://drive.google.com/file/d/0B0gW1AkX_7Nybms5cjhLaXU1RkU/view?usp=sharing

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)