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] Some real problem.  (Read 4350 times)

0 Members and 1 Guest are viewing this topic.

Fox

Turnbeutelvergesser since 1988.
[Request / Listing] Some real problem.
« on: April 13, 2006, 05:04:37 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
I use GM 5.3a .

Okay, so here's the deal. It's about room-transition. It's not like I got any problem! You see,
I got objects that, when Link collides with them, bring them to an other dedicated room. No problems with getting stuck in that object, since I indicated some variables and x- and y-positions. Everything's alright.
However,
that means, that you always end up at that door of the room, that you started in. So if I'd got a room with more than one exit, I'd have a big problem.
Also - and this is why I post here, since there would be a complicated, annoying way to fix the other problem - there is the problem with temples. I've decided to make every room in a temple seperated, so you'd always have a different room. But the problem is the end of each temple. You know, when you defeated the boss, retreived the heart-container and finally the super-duper-whatsoever-thingy of the temple, you'll get automatically beamed outside in front of the temple. Alright so far, no problem. But if you'd enter the temple again, you'd always start at the door of a room that you used to left. Since you didn't go back yourself outside the dungeon, it would always be the wrong exit. Can you imagine that?

So well, now I need help or a tip what to do.
« Last Edit: February 24, 2012, 10:51:26 am by Niek »
Logged
  • Me on deviantART

Ben

Re: Some real problem.
« Reply #1 on: April 13, 2006, 05:18:51 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
Have 2 global variables - link_set_x and link_set_y and then every door that you go through you simply set link_set_x and y to the  appropriate place and then in the room creation code just move link to those coordiates.
You might want an extra one for direction too.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

Fox

Turnbeutelvergesser since 1988.
Re: Some real problem.
« Reply #2 on: April 13, 2006, 07:15:33 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
I think you mean that Link appears on a place away from the object that changes the room while colliding, so there won't be any problems with looping the room-change; but that's not the problem...
To explain my problem better, I made a cheap graphic. lol.


You see, those squares are rooms. And the red arrows show, that you move from this point to the next room. The green dots show that Link is there and will be there once you enter that room again. That's just logical.
But then, the last room on the top right shows the green dot and a blue arrow, that is supposed to show how you get beamed in front of the temple. And you see the problem: Link would always start from the green dot in each room once he enters it since he left it at that point.
And that just doesn't look right.
What shall I do? ;___;
Logged
  • Me on deviantART

Ben

Re: Some real problem.
« Reply #3 on: April 13, 2006, 07:19:50 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
I see no problem :S.
On the entering of the room from the left you set the coordinates to the rooms entry point.
On entering it from the beginning (using the typical zelda portal) you just set the coordinates to the center.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

Fox

Turnbeutelvergesser since 1988.
Re: Some real problem.
« Reply #4 on: April 13, 2006, 08:20:31 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
I can't set any coordinates of a room that the player isn't inside if it's that what you mean. So I would have to make the room change even just for a moment (step) and set the coordinates, but that would spoil the game...
Logged
  • Me on deviantART

Ben

Re: Some real problem.
« Reply #5 on: April 14, 2006, 01:26:39 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
Okay, here's my idea. On entering a room you run the link objects create event, right?
So in that you check if global.link_set_x >-1 and if global.link_set_y>-1 (take -1 as effectively NULL) and if it is, then you set links coordinates to that, otherwise you just leave it where it's place in the room.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

Fox

Turnbeutelvergesser since 1988.
Re: Some real problem.
« Reply #6 on: April 14, 2006, 05:04:12 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
I'm not quite sure if I got you right, but... here's another idea (maybe it's yours lol):
I could make that the object that changes the room when collides with Link have a variable that indicates if the temple was done; something like global.dungeon1done and when you finish the dungeon, the variable would switch to 1 (true) and everytime you enter a room of the dungeon from outside, every object that changes the room puts Link near to it. And it would then change that global variable back! Oh yeah! Yes, that would work!

Geez, I gotta write that down or something...

Thanks Ben, I don't think I wouldn't have thought that far without you. :)
Logged
  • Me on deviantART

King Tetiro

Leader of Phoenix Heart
Re: Some real problem.
« Reply #7 on: April 14, 2006, 05:13:18 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3549
or you could do a few drag and drops saying if _____.x/______.y is larger than_ do _________________
Logged
  • Phoenix Heart
Re: Some real problem.
« Reply #8 on: April 15, 2006, 07:11:08 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
If it goes back to the first room, just make Link's XY set to the original room's starting points.
Logged
the a o d c
Re: Some real problem.
« Reply #9 on: April 15, 2006, 03:30:44 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
the way i normally do it is have a couple of objects and each object would go to a different room based on some global variables that i would set up in the rooms creation code
Logged
Re: Some real problem.
« Reply #10 on: April 16, 2006, 11:43:16 pm »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
Let me show you my OoL room coding.

Step 1: Link Persistent :/

Main Room (Zelonion):
Code: [Select]
//Control music.
sound_stop_all();
sound_loop(sndZelonion);
view_object=objMaster;

if ! (variable_global_exists("lroom")) {global.lroom=rmZelonion;}

if global.lroom=rmZelonion
{
objMaster.x=552;
objMaster.y=464;
objMaster.direction=272;
global.lroom=rmZelonion;
}
else if global.lroom=rmPloray
{
objMaster.x=16;
objMaster.y=312;
objMaster.direction=45;
global.lroom=rmZelonion;
}

In ploray (second room), since its a dead end, we know the variables basically.
Code: [Select]
sound_stop_all();
sound_loop(sndPloray);
view_object=objMaster;

if global.lroom=rmZelonion
{
objMaster.x=760;
objMaster.y=308;
objMaster.direction=225;
global.lroom=rmPloray;
}

In the third room... which is north of Zeloonion:
Code: [Select]
sound_stop_all();
sound_loop(sndMaze);

if global.lroom=rmZelonion
{
objMaster.x=296;
objMaster.y=768;
objMaster.direction=135;
global.lroom=rmForest_Maze;
}

Do you roughly understand?
Let me roughly say, to answer your question, that if you were beamed outside, you might have the new lastroom var as rmOverworldDungeon? Then when you re-enter, make it say something like:

if global.lroom=rmOverworldDungeon
{
objMaster.x=
objMaster.y=
objMaster.direction=
global.lroom=rmDung1;
}

And in the second room, have it check if it was rmDung1 before. Blah. Understand? Sorry for sloppy.
« Last Edit: April 16, 2006, 11:45:45 pm by AoDC »
Logged
the a o d c

Fox

Turnbeutelvergesser since 1988.
Re: Some real problem.
« Reply #11 on: April 17, 2006, 08:53:44 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
I think I kinda understand... I gotta keep reading it again, but I think I'm about to get the idea. :)
Thanks everybody for your help. :D
Logged
  • Me on deviantART
Pages: [1]   Go Up

 


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



Page created in 0.027 seconds with 61 queries.