Creating Your Own Room Transition With Gm7 Pro
#21
Posted 06 July 2010 - 07:49 AM
#22
Posted 11 November 2010 - 10:24 AM
5/5
#23
Posted 17 November 2010 - 02:15 AM
#24
Posted 19 November 2010 - 02:50 AM
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.how do I create a new room with this? cause every time i try it says the room doesn't exist...
// 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.)
#25
Posted 19 November 2010 - 09:40 AM
You don't need to set them, gamemaker inputs the surfaces of the old and new room in the transition script.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)?
All the arguments are actually predefined and thrown in by gm.
Edited by WannabeGod, 19 November 2010 - 09:42 AM.
#26
Posted 23 December 2010 - 05:25 PM
#27
Posted 13 January 2011 - 02:02 AM
#28
Posted 13 January 2011 - 04:10 AM
#29
Posted 14 January 2011 - 06:03 AM
#30
Posted 20 March 2011 - 11:31 PM
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.
#31
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.

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.
#32
Posted 03 April 2012 - 08:59 PM
#33
Posted 14 April 2012 - 09:56 PM
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?
#34
Posted 20 September 2012 - 07:34 PM
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.
#35
Posted 18 December 2012 - 09:47 PM
#36
Posted 10 February 2013 - 02:04 AM
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.
Edited by TheouAegis, 10 February 2013 - 02:05 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











