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] Having trouble with new rooms...  (Read 3048 times)

0 Members and 1 Guest are viewing this topic.

xxbloodlustxx

[Request/Listing] Having trouble with new rooms....
« on: April 04, 2006, 04:52:04 pm »
Okay, so I'm still working on a demo for my game, and I want to be able to go into houses and stuff, but I'm having just a bit of difficulty with making room transitions look nice. For example, how do you make the main character walk into a room and go to a certain position in that room, instead of where you started him off in that room before? BTW im using GM. Help would be much appreciated :)
« Last Edit: February 08, 2012, 09:54:18 am by Niek »
Logged

OcarinaBoy

Re: Having trouble with new rooms...
« Reply #1 on: April 04, 2006, 05:16:40 pm »
do you mean a room to room engine?, i know that hyrule_boy or deku_stick have one try to ask them
Logged
Re: Having trouble with new rooms...
« Reply #2 on: April 04, 2006, 05:28:22 pm »
  • *
  • Reputation: +10/-0
  • Offline Offline
  • Gender: Female
  • Posts: 1468
Okay, so I'm still working on a demo for my game, and I want to be able to go into houses and stuff, but I'm having just a bit of difficulty with making room transitions look nice. For example, how do you make the main character walk into a room and go to a certain position in that room, instead of where you started him off in that room before? BTW im using GM. Help would be much appreciated :)

You are going about this all wrong. Make your characters object persistent. Have him only be created in one single room, and then when he moves room change the x and y of him, heres and example, for moving him when he hits the object that will make him move room:

Room = [yourroom];
obj[yourobject].x = [wherever];
obj[yourobject].y = [wherever];

Like that. Hope it helped.
Logged
  • Elliott Parkinson

xxbloodlustxx

Re: Having trouble with new rooms...
« Reply #3 on: April 04, 2006, 05:52:11 pm »
wow thanks man, it worked. :D it's weird how the solution is actually simple, but i was doing all this complex crap to try to get it to work. anyway, thanks man.
Logged
Re: Having trouble with new rooms...
« Reply #4 on: April 04, 2006, 05:59:56 pm »
  • *
  • Reputation: +10/-0
  • Offline Offline
  • Gender: Female
  • Posts: 1468
wow thanks man, it worked. :D it's weird how the solution is actually simple, but i was doing all this complex crap to try to get it to work. anyway, thanks man.

Your welcome, just needed some advice from experienced gamemaker users. The ammount of mistakes i made like that, i did it all with global variables at first before i realised that i could do it with the obj[name].x ect, those were the days.
Logged
  • Elliott Parkinson
Re: Having trouble with new rooms...
« Reply #5 on: April 04, 2006, 08:18:30 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
Persistant is really really bad if you use variables it will screw them. Persistant isn't the solution.
Logged
Re: Having trouble with new rooms...
« Reply #6 on: April 04, 2006, 10:52:01 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1902
The way that I do it is actually pretty simple.
In the "Outside Room" action for Link, put this code.
(This is an example for going down out of a room)
Code: [Select]
if room = [whateverroom] {
if [LinkObject.y] > [TheBiggestYCoordinateOnTheMap] {
room_goto(RoomHere);
global.next_positiony = [Where you want him to start];
global.next_positionx = [Where you want him to start];
}
}
Then, in the creation code of the room, put
Code: [Select]
Link.x = global.next_positionx;
Link.y = global.next_positiony;

Hope that helped some, if you actually understood it lol, if not, I can create an engine for you.
Discuss.
Logged


.TakaM was here.
Quote
so my friend stole a giant bag of ketchup out of the ketchup pumping things and brought it to our table and we took it in the bathroom and i smashed it over the sink and kicked it around the bathroom and smeared it everywhere and we all took turns kicking the ketchup out of it and when we were done it looked like an african village was murdered in the bathroom
XFD.
  • Awesome Land
Re: Having trouble with new rooms...
« Reply #7 on: April 05, 2006, 08:35:13 am »
  • *
  • Reputation: +10/-0
  • Offline Offline
  • Gender: Female
  • Posts: 1468
The way that I do it is actually pretty simple.
In the "Outside Room" action for Link, put this code.
(This is an example for going down out of a room)
Code: [Select]
if room = [whateverroom] {
if [LinkObject.y] > [TheBiggestYCoordinateOnTheMap] {
room_goto(RoomHere);
global.next_positiony = [Where you want him to start];
global.next_positionx = [Where you want him to start];
}
}
Then, in the creation code of the room, put
Code: [Select]
Link.x = global.next_positionx;
Link.y = global.next_positiony;

Hope that helped some, if you actually understood it lol, if not, I can create an engine for you.
Discuss.

I never thought of doing it thast way, but then again im sure we all ahve our own coding methods and shortcuts, nice one!
Logged
  • Elliott Parkinson
Pages: [1]   Go Up

 


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



Page created in 0.022 seconds with 36 queries.