Jump to content


Photo
* * * * * 2 votes

Creating Your Own Room Transition With Gm7 Pro


  • Please log in to reply
35 replies to this topic

#21 Bjornacorn

Bjornacorn

    World of Warcraft

  • New Member
  • 197 posts

Posted 06 July 2010 - 07:49 AM

I've always wondered if this was possible. Thank you, torigara. You walkthrough made sense to me.
  • 0

#22 imam_mashur

imam_mashur

    GMC Member

  • New Member
  • 282 posts

Posted 11 November 2010 - 10:24 AM

AWESOME...
5/5

  • 0

#23 Wooderson

Wooderson

    GMC Member

  • New Member
  • 2 posts

Posted 17 November 2010 - 02:15 AM

how do I create a new room with this? cause every time i try it says the room doesn't exist... am i missing something?, or can i only work with the previously created rooms?
  • 0

#24 torigara

torigara

    GMC Member

  • GMC Member
  • 6483 posts

Posted 19 November 2010 - 02:50 AM

how do I create a new room with this? cause every time i try it says the room doesn't exist...

Supposing that you're using the third example, every room should contain an instance of obj_controller. In the room editor, hold Ctrl and right-click the instance, choose "Creation Code", and you will see a piece of code that looks like following.
// Set indices of room at four sides (see do_transition)
tr_room[TR_LEFT] = room_east;
tr_room[TR_RIGHT] = room_west;
tr_room[TR_UP] = room_north;
tr_room[TR_DOWN] = room_south;
You're supposed to specify the next room at each side in this way. (Take a look into the script do_transition for further description.)
  • 0

#25 WannabeGod

WannabeGod

    GMC Member

  • New Member
  • 2 posts

Posted 19 November 2010 - 09:40 AM

where are the arguments set for the transitions (i.e., where are the transition scripts called from in the first place where you set the surfaces? I just don't understand how to tell it what the surfaces are that it's using for the transitions)?

You don't need to set them, gamemaker inputs the surfaces of the old and new room in the transition script.
All the arguments are actually predefined and thrown in by gm.

Edited by WannabeGod, 19 November 2010 - 09:42 AM.

  • 0

#26 goldage5

goldage5

    GMC Member

  • GMC Member
  • 152 posts

Posted 23 December 2010 - 05:25 PM

link broken!!!!!
  • 0

#27 shilohbrown

shilohbrown

    GMC Member

  • New Member
  • 1 posts

Posted 13 January 2011 - 02:02 AM

The ninja got closer and cuborm a blast got the ninja.
  • 0

#28 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1817 posts
  • Version:GM:Studio

Posted 13 January 2011 - 04:10 AM

Link is indeed down. Posted Image
  • 0

#29 Pro Pro.

Pro Pro.

    GMC Member

  • GMC Member
  • 728 posts

Posted 14 January 2011 - 06:03 AM

can someone re-upload this, or pm me if you have the files? Its the only custom transition example i can find.
  • 0

#30 Slajmboll

Slajmboll

    GMC Member

  • GMC Member
  • 69 posts

Posted 20 March 2011 - 11:31 PM

Hello you all. I'm kinda having trouble with this (I also recently started to use GM, so that makes sense I guess). :)

Anyhow, I'm getting this message when going to the right border of the screen:

"ERROR in
action number 4
of Keyboard Event for <Right> Key
for object kara:

In script do_transition:
Error in code at line 11:
next_room = obj_controller.tr_room[argument0];
^
at position 14: Unknown variable obj_controller
"


My creation code in the room seems ok I think (only want one entrance, to the right):

"// Set indices of room at four sides (see do_transition)
tr_room[TR_LEFT] = -1;
tr_room[TR_RIGHT] = rm_room0;
tr_room[TR_UP] = -1;
tr_room[TR_DOWN] = -1;"


Information about object:

Sprite: character
Solid: false
Visible: true
Depth: 0
Persistent: true
Parent: <no parent>
Mask: <same as sprite>

Step Event:
if relative position (0,1) is collision free for Only solid objects
set the gravity to 0.5 in direction 270
else
set the gravity to 0 in direction 270
if vspeed is larger than 12
set the vertical speed to 12

Collision Event with object wall:
move in direction direction at most 12 till a contact with solid objects
set the vertical speed to 0


Keyboard Event for <Left> Key:
if relative position (-4,0) is collision free for Only solid objects
jump relative to position (-4,0)

Keyboard Event for <Up> Key:
if relative position (0,1) gives a collision with Only solid objects
set the vertical speed to -10

Keyboard Event for <Right> Key:
if relative position (4,0) is collision free for Only solid objects
jump relative to position (4,0)
if object is aligned with grid with cells of 0 by 32 pixels
execute code:

if (x+32 >= room_width) {
// Go to the room to the right when the player tries to go beyond the right border of the room
do_transition(TR_RIGHT);
}
else {
hspeed = 4;
vspeed = 0;
}


I have no clue, is there something specifik I should change in the scripts? I deleted the teleportscript, gatescript and font, since I didnt have use for it. Hmm. Anway, I would be so thankful for some help. I offer cake and love. And sorry for my crappy english.
  • 0

#31 abaddamn

abaddamn

    GMC Member

  • GMC Member
  • 38 posts

Posted 12 July 2011 - 02:41 AM

Hello you all. I'm kinda having trouble with this (I also recently started to use GM, so that makes sense I guess). :)

Anyhow, I'm getting this message when going to the right border of the screen:

"ERROR in
action number 4
of Keyboard Event for <Right> Key
for object kara:

In script do_transition:
Error in code at line 11:
next_room = obj_controller.tr_room[argument0];
^
at position 14: Unknown variable obj_controller
"


My creation code in the room seems ok I think (only want one entrance, to the right):

...

I have no clue, is there something specifik I should change in the scripts? I deleted the teleportscript, gatescript and font, since I didnt have use for it. Hmm. Anway, I would be so thankful for some help. I offer cake and love. And sorry for my crappy english.


The obj_controller needs to be in the same room when the transition takes place. That's why it doesn't work. Have a look in Torigara's Room transition file.

Otherwise you can just change the 'next_room=obj_controller.tr_room[argument0]' -> 'next_room=your_room' and then that should work fine.


Question to Torigara and anyone who know how to deal with GM Surfaces...
There is an issue with the room transition script. I've implemented your script to make the room transition (specifically the push transitions) and they are great - except for one nagging big problem:

During the Transition - alpha around the trees removes the underlayer
and the buffered image from the previous frame seem to appear underneath.
Posted Image

Don't worry about it - I've figured it out already.
The solution is draw_clear_alpha(0,0), put it in before the transition part of the script.

Edited by abaddamn, 13 July 2011 - 01:06 AM.

  • 0

#32 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 03 April 2012 - 08:59 PM

Evil bump coming up. Haven't commented on these before, but this really is great stuff!
  • 0

#33 Epixel

Epixel

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:HTML5

Posted 14 April 2012 - 09:56 PM

Hi!

I really, REALLY want to use your teleport transition, but i cannot rip it from your example!
Do you have an example with only THAT transition?
  • 0

#34 RangerX

RangerX

    GMC Member

  • GMC Member
  • 905 posts
  • Version:GM8.1

Posted 20 September 2012 - 07:34 PM

Bumping this because apparently I am dumb.
I don't know how to implement those transitions into my games. I look at Tori's GML in his "object control" and "obj button" and I don't even see where he calls for his transition scripts. There's something I'm not getting...

Could someone tell me what I am missing there or direct me to a TUTORIAL with step by step examples on how to create my own transitions? (fade in/out if possible). I don't want some "here's a gm example file and then figure it out" kind of "tutorial". I'm too dumb for that apparently.


EDIT:
oh well, looks like I created my own "fade in / fade out" transitions. They also work after loading a game so I am satisfied with it for now.

Edited by RangerX, 25 September 2012 - 11:19 AM.

  • 0

#35 Brock Lee

Brock Lee

    GMC Member

  • GMC Member
  • 11 posts
  • Version:GM7

Posted 18 December 2012 - 09:47 PM

My God, these transitions are amazing. I LOVE YOU!
  • 0

#36 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4672 posts
  • Version:GM8

Posted 10 February 2013 - 02:04 AM

Greatest bump in the history of mankind!

So far starters, a shameless plug!

http://gmc.yoyogames.com/index.php?showtopic=531097&st=0#entry3903326

That's a link to my "tutorial" on a Castlevania-style room transition (Classicvania, not crappy IGAvania). I just recently updated it. I wrote up that room transition (the original version is also in the demo and is hidden in the spoiler tag in the first post) based on torigara's tutorial here. Yes, it took a lot of trial and error to get down, but it can be done and my "tutorial" proves it! (Mine and some of the Metroid engines floating around out there.)

I wanted to add a couple things to tori's tutorial too. First off, you don't need to declare a variable during a transition: it will automatically be script-local. In other words, you don't need
var fraction;
Torigara did that in his tutorial. Also, while it does help you read your script by assigning arguments to custom variables, it does waste cycles. So if you can read a script fine using just "argument0' or "argument1" or "argument2" instead of special variables like torigara does, then that would be best.

Also, even though room transitions literally freeze your game while processed, you can still do things "outside" the transition while it's running. Actions which affect objects, tiles or backgrounds will affect the objects, tiles, and backgrounds in the next room. This means you can set the player's coordinates in the next room during the room transition, for example (I do this in my "tutorial").

You can play sounds during a transition as well. If you've ever played Castlevania 3 on the NES, when a door opens it makes a slamming sound, then again when it shuts. That can be done with a custom transition in Game Maker!

If you really wanted, you could make a message box pop up during a transition. This is very, very, very, extremely useful when trying to debug your transitions.

To make scripting a timeline-style room transition easier on yourself, first multiply argument4 by transition_steps and save it in another variable like so:
argument15 = argument4 * transition_steps;
You can then reference that variable. The reason for this is argument4 is a fraction. It's easier to work with integers than it is to work with fractions, I think.


This bump made possible by torigara, whose tutorial here helped me make my own complex transition. :thanks:

Edited by TheouAegis, 10 February 2013 - 02:05 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users