#Transitions

147 messages · Page 1 of 1 (latest)

grizzled nest
#

So I've been working on adding transitions to my game between room, follow a tutorial (https://www.youtube.com/watch?v=TCwIerWM2iU&t=763s) and I have a door that takes the player to the next room. What I need to add is a way for the transition to happen after every room

❤️★ Support my work ▶ https://www.patreon.com/shaunjs
💻★ Source code ▶ https://github.com/ShaunJS/gms2-transitions

This video will show you how to build flexible room transitions using sequences and a single ~40 line script.

These tutorials are supported almost wholly by wonderful people via Patreon, click the link above to join them and acces...

▶ Play video
#

There is the script

#

and

#

this is what i came up with (it doesnt work)

#

anyone have any ideas?

dawn barn
grizzled nest
#

oh thats in a collision event with the player, the door has it

#

@dawn barn you have any ideas?

dawn barn
#

you made sure to do this?

grizzled nest
#

yeah

#

i did that but i think my code is wrong elsewhere

#

i can give you the errors

dawn barn
#

if there were errors those would've been very very very helpful from the beginning

grizzled nest
#

Object: obj_door Collision Event With obj_player at line 1 : wrong number of arguments for function room_next
Object: obj_door Collision Event With obj_player at line 1 : malformed assignment statement

#

oh my fault

dawn barn
#

room_next(room)

#

not room_next()

grizzled nest
#

wow im dumb

#

thank you dude

#

im doing this project for school but the teacher has been out and so i he hasnt taught us much code

#

wait

#

it doesnt work

#

it works for the first room but when i get to the second one it don't work

dawn barn
#

does the 2nd room have a room_next?

grizzled nest
#

hmm

#

?

dawn barn
#

is there a 3rd room?

grizzled nest
#

yes

dawn barn
#

what does it do instead when it goes into the 2nd room

#

does it throw an error?

grizzled nest
#

no the player is just static a few pixels above the door

#

brown square:

#

well not above but the door don't transport it

dawn barn
#

can you slap a show_message(room_get_name(target_)) in the collision with the player

grizzled nest
#

sure

dawn barn
#

there should be 1 popup that says the 2nd room when you're in the first room

#

what does the popup say when you're in the 2nd room

grizzled nest
#

umm one sec

#

i got this at the door in the first room are you sure its (target_) and not (_target)?

dawn barn
#

oh you didn't put an underscore

#

it's whatever variable you declared

#

so target

grizzled nest
#

ok

#

it now says this

dawn barn
#

and make sure the show_message code goes after you declare var target

#

ok that's correct

#

press ok

grizzled nest
#

i did

#

ok

dawn barn
#

and go to room 2

#

and try to exit a door and show what it says

grizzled nest
#

well

#

ok doesn't make it go away

dawn barn
#

huh.

grizzled nest
#

maybe because my player is still in contact with the door?

dawn barn
#

that's correct

#

hmm

#

well you can change it to show_debug_message

#

do you know where it'll print?

grizzled nest
#

in the output thing?

dawn barn
#

yes!

grizzled nest
#

ok

#

so i write

dawn barn
#

show_debug_message(room_get_name(target)) instead of show_message...

grizzled nest
#

yeah

dawn barn
#

ok do that

#

it should spam room2 for a few times, then go to room 2

#

instead of a popup

grizzled nest
#

just says a bunch or room 3

#

i have a room 3 tho

#

hmm

#

this is weird

dawn barn
#

ok so it's showing the correct room

#

just not going there

grizzled nest
#

yes

dawn barn
#

right

#

now change it to
show_message(global.roomTarget)

grizzled nest
#

ok

#

says -1 now and asks me to hit ok i do and it asks again

dawn barn
#

oh oops

#

meant to be show_debug_message

grizzled nest
#

ok

dawn barn
#

so it spams the output

grizzled nest
#

show_message(global.roomTarget)?

dawn barn
#

yeah

grizzled nest
#

umm

#

hold up

#

weird

#

its either sending nothing or more ones than i already got from the first room

#

and my player is stuck atop the door

#

maybe the collision system is the problem and not the code

dawn barn
#

question

grizzled nest
#

yes?

dawn barn
#

where do you use Transition_Finished()

#

is it in the sequence somewhere?

grizzled nest
#

for the sq_fadein at 59 frames

dawn barn
#

ok

#

can you show_debug_message(global.midTransition)

#

in a step event somewhere

#

and watch it

grizzled nest
#

like in a step event of the player?

dawn barn
#

it should be 0 then 1 then 0

#

yeah player would work

#

remove the other show_debug_message code in the collision event

grizzled nest
#

ok in the beginning it spammed 0s then the 1s when i hit the door but it didnt go back to 0 thats the problem

dawn barn
#

right

grizzled nest
#

what did i forget

dawn barn
#

can you check sq_fadein again

#

Transition_Finished() isn't being called

#

which is what i suspected

#

the game doesn't know the 1 to 2 transition is done, it thinks it's still going

#

so it doesn't let the game start going from 2-3

grizzled nest
dawn barn
#

are you sure it's not
TransitionFinished()

grizzled nest
#

hm?

#

whats the difference between what and wha

dawn barn
#

yeah it's not

#

HMM

grizzled nest
#

could it be something in the script?

dawn barn
grizzled nest
#

ok

dawn barn
#

i...don't know

#

check the tutorial again

grizzled nest
#

alr

dawn barn
#

atleast we know the problem

grizzled nest
#

the tutorial is specifically going from room 1 to 2 or if room == 1 then go to room 2 though

#

but i'll double check it

dawn barn
#

your room stuff should be fine

#

var target = room_next(room) should be fine

grizzled nest
#

alright

dawn barn
#

we confirmed that

grizzled nest
#

well i'll double check it might take me a while though

dawn barn
grizzled nest
#

yeah im realizing that now

#

i probably spelled transition wrong somewhere

dawn barn
#

indeed you did

#

Transititon

#

@grizzled nest

#

inside the TransitionFinished function

grizzled nest
#

what

#

sorry i was eating

#

oh i see