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

Pages: [1] 2   Go Down

Author Topic: Rooms within Rooms  (Read 4661 times)

0 Members and 1 Guest are viewing this topic.
Rooms within Rooms
« on: December 05, 2009, 04:09:54 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
Hit there I use Game Maker 7.0 Pro and I'm making a "The Legend of Zelda" game and I would like to know how to make "rooms" within rooms... for example One Temple/Dungeon will be one room but there are four objects that indicate the borders of the "rooms", these borders will stop the View from proceeding and until link exits the view will the view transition to the next set of borders.... Yea I know im streching it a bit but It has been done in GM7 before.
Logged

Zhello

N.A.D.I.
Re: Rooms within Rooms
« Reply #1 on: December 05, 2009, 04:24:14 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
There should be an example somewhere in gmc.yoyogames.com, I remeber something like this but it was waaaaaay back, dunno if it still exists tho.
Logged
The IT Guy
Intermediate Coder
Linux is a wonderful thing
~Linkwolf48/Gumstone1080~

The Legend of Zelda - New Beginnings

http://zfgc.com/forum/index.php?topic=34986.0
1.6 Demo -
https://www.dropbox.com/s/56km0iadaras56g/LoZNB%20Game%20Folder.rar?dl=0


Side Projects:

Dragon Diary - Cybernetic Threat
Story: http://wiki.zfgc.com/Cybernetic_Threat

Quote
Aero88
ZFGC is like the Hotel California.  You can come in but you can never leave!

devianart: http://linkwolf48.deviantart.com/
Re: Rooms within Rooms
« Reply #2 on: December 05, 2009, 04:26:12 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
Well Do you remember what is what called?
Logged
Re: Rooms within Rooms
« Reply #3 on: December 05, 2009, 04:32:36 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I moved this, and probably one of your previous topics you posted in Templates & Tutorials, to here because that board is meant for asking for things like engines or posting things like engines and tutorials. My explanation is probably a little convoluted, I don't know. When one asks for help on how to do something, that is not automatically implying that the person wants a tutorial on how to do something, but rather that they just want some sort of help. The Discussion board is meant for typical coding questions and game making questions.
Logged
Re: Rooms within Rooms
« Reply #4 on: December 05, 2009, 04:37:02 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
ok I know what you mean
Logged

Mamoruanime

@Mamoruanime
Re: Rooms within Rooms
« Reply #5 on: December 05, 2009, 04:41:47 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
You can actually do this all with code. No need to have objects sitting there :p

Just need to calculate link's position vs the view boundary positions.
Logged
Re: Rooms within Rooms
« Reply #6 on: December 05, 2009, 04:43:56 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
But I think it would be less work place objects in a room then mapping coordinates, but If so how would I do that
Logged

Zhello

N.A.D.I.
Re: Rooms within Rooms
« Reply #7 on: December 05, 2009, 04:50:54 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
Well Do you remember what is what called?

sry man, it was back in like 2006-07  i tried making an rpg back then; gmks. i had are all gone along with my old pc.
Logged
The IT Guy
Intermediate Coder
Linux is a wonderful thing
~Linkwolf48/Gumstone1080~

The Legend of Zelda - New Beginnings

http://zfgc.com/forum/index.php?topic=34986.0
1.6 Demo -
https://www.dropbox.com/s/56km0iadaras56g/LoZNB%20Game%20Folder.rar?dl=0


Side Projects:

Dragon Diary - Cybernetic Threat
Story: http://wiki.zfgc.com/Cybernetic_Threat

Quote
Aero88
ZFGC is like the Hotel California.  You can come in but you can never leave!

devianart: http://linkwolf48.deviantart.com/

Mamoruanime

@Mamoruanime
Re: Rooms within Rooms
« Reply #8 on: December 05, 2009, 04:51:40 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
But I think it would be less work place objects in a room then mapping coordinates, but If so how would I do that

Pretty much the same way you'd calculate when link crosses paths with the transition object. You can do it a number of ways fairly easily. A bit of pseudo code-

Code: [Select]
if objLink.x >= (view_x[*currentview*] + view_width[*currentview*]) && objLink.walking = *right direction var*{
 *Begin transition to new room to the right*
}

Just do that for each direction, changing the math appropriately. Again, that's pseudo code, so it's not going to work as is, you need to modify it to work for your code.
Logged
Re: Rooms within Rooms
« Reply #9 on: December 05, 2009, 05:01:02 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
But I think it would be less work place objects in a room then mapping coordinates, but If so how would I do that

Pretty much the same way you'd calculate when link crosses paths with the transition object. You can do it a number of ways fairly easily. A bit of pseudo code-

Code: [Select]
if objLink.x >= (view_x[*currentview*] + view_width[*currentview*]) && objLink.walking = *right direction var*{
 *Begin transition to new room to the right*
}

Just do that for each direction, changing the math appropriately. Again, that's pseudo code, so it's not going to work as is, you need to modify it to work for your code.
I know how to do the transistion but the reason I have object borders is because the view will move with objLink until the view collides with one of the borders. So its not just view changing without any rooms bigger then the other,,,,,
Logged

Mamoruanime

@Mamoruanime
Re: Rooms within Rooms
« Reply #10 on: December 05, 2009, 05:05:06 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Hmm it sounds like you're horribly overcomplicating it though. Just set some variables in your room creation code for lock positions for your view, and have a control object return when it's okay for your view to scroll or not based on those o.o... Objects add a considerable chunk to your filesize, regardless of what's in them ;x
Logged
Re: Rooms within Rooms
« Reply #11 on: December 05, 2009, 05:13:03 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
Okay but If i put this a code like this in
 
Code: [Select]
if view_xview>(xvar1-view_wview) view_xview=(xvar1-view_wview)
if the xview value is larger then the x varible it will go back to that xvarible, making it impossible to proceed to another room..
« Last Edit: December 05, 2009, 05:15:22 am by Veran »
Logged

Ethelon

Awesome Resized Avys
Re: Rooms within Rooms
« Reply #12 on: December 05, 2009, 06:11:23 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 254
Bleh yeah, I remember an old old example of this. The problem with that one was that all the room sizes were all the same, unless that's what you want o.o
Logged

Xfixium: "Leader"/Lead Programmer/Lead Spriter,  Cypras: Programmer, Ethelon: Tiler/Spriter, Darklink45: Spriter, Noseblunt3: Spriter,
SinkinDevil: Spriter, Dotyue: Spriter, Tompel: Tiler/Spriter, 
Mamoruanime: Tiler, DJvenom: Spriter
Re: Rooms within Rooms
« Reply #13 on: December 05, 2009, 07:19:18 pm »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
No it's not..... The view is able to follow link unless the view collides with a border
Logged

Ethelon

Awesome Resized Avys
Re: Rooms within Rooms
« Reply #14 on: December 05, 2009, 09:10:42 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 254
OOOO I see what you're saying...
Logged

Xfixium: "Leader"/Lead Programmer/Lead Spriter,  Cypras: Programmer, Ethelon: Tiler/Spriter, Darklink45: Spriter, Noseblunt3: Spriter,
SinkinDevil: Spriter, Dotyue: Spriter, Tompel: Tiler/Spriter, 
Mamoruanime: Tiler, DJvenom: Spriter
Re: Rooms within Rooms
« Reply #15 on: December 05, 2009, 09:59:33 pm »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
OOOO I see what you're saying...

Yea so could you help me out
Logged

Mamoruanime

@Mamoruanime
Re: Rooms within Rooms
« Reply #16 on: December 05, 2009, 11:18:32 pm »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
No it's not..... The view is able to follow link unless the view collides with a border

Yeah but you can still do this with one controller object... You just set up your boundaries in the room creation code, and you have the controller object check the views position. If it comes up to those predefined coordinates from the room creation code, it will stop moving in that direction.

You're going to run into issues using objects for that, because the view will quake when it hits them. Game Maker doesn't run each step routine simultaneously, it cycles through them by object index, so it could process your view, and not process the other object's properties until it becomes visibly noticeable that it's shifting the view back.
Logged
Re: Rooms within Rooms
« Reply #17 on: December 06, 2009, 01:24:36 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
Wait im a bit confused....what codes should I use
Logged
Re: Rooms within Rooms
« Reply #18 on: December 06, 2009, 09:13:05 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I just looked at this topic and I haven't thought much about it yet but what I would do is the following pseudo code:

Code: [Select]
xview = x - VIEWWIDTH / 2;                        //Update the view to follow link.
if(xview < BOUNDARY_L)                             //Check if it goes beyond the leftside.
         xview = BOUNDARY_L;                       //Update accordingly.
elseif(xview + VIEWWIDTH > BOUNDARY_R)    //Check if the view goes beyond the rightside.
         xview = BOUNDARY_R - VIEWWIDTH;   //Update accordingly.

For the yview it is similar, but you use height, top and bottom. This is what I thought up in a first thought. Most likely with some more thought it can be done even faster.
Logged
Re: Rooms within Rooms
« Reply #19 on: December 06, 2009, 10:29:58 am »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
As I pointed out earlier that if the view is beyond a certain point than it wont go beyond that point which ruins the purpose of this concept but thanks for the effort but the code did not work
Logged
Pages: [1] 2   Go Up

 


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



Page created in 0.045 seconds with 74 queries.

anything