Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Is there a way to transition from one point to another through a cutscene?

A topic by Stezzu created 34 days ago Views: 118 Replies: 16
Viewing posts 1 to 2

Is there a method to create a transition using a cutscene, for example: when the player interacts with a terminal that unlocks a door located far from the player's current position, a simple black fade-in/fade-out transition plays showing the door unlocking, and then another fade brings the focus back to the player?

By the way this library is absurdly useful! Thank you!

Developer

If the door is in the same room you could do something like this:


scene_info = [
	[cutscene_fade_out,3,c_black],
	[cutscene_camera_follow_object,obj_door,10], // Alternatively cutscene_camera_moveto_position
	[cutscene_fade_in,3,c_black],
	[cutscene_wait,1],
	// Here use some script to show the door unlocking,
	// for example cutscene_set_sprite or cutscene_change_variable
	// depending on how it works
	
	[cutscene_wait,1],
	[cutscene_fade_out,3,c_black],
	[cutscene_camera_follow_object,obj_player,10],
	[cutscene_fade_in,3,c_black]
];

But to be honest, the cutscene_fade_out and cutscene_fade_in scripts are not very good currently, there is a flicker if using some script in between. I will fix that in the next update probably, but I can give you a quick fix if you need it.

Oh I see, when will the next update come out?
Yes if you send me the fix I can try to do some tests.

Developer (1 edit)

I will publish the beta test of the update next week maybe.

But to fix it yourself, add this to the create event of control_cutscene:

effect_color = c_black;
effect_alpha = 1;

And in cutscene_fade_out, add rect = true; somewhere in line 12, before cutscene_next();

In cutscene_fade_in, add rect = false; somewhere in line 8, before the if statement.

Let me know if you encounter any problem.

(2 edits)

Right now, the fade in and fade out effects don't cover the entire screen. But I think the main issue is that we remove the black screen before reaching the 'objDoor'. We should wait until we're at the indicated spot before removing it.

A fix that I found useful in control_cutscene object draw GUI event to cover the entire screen:

//Draw fade in and out effects
if (fade_out == true) {
draw_set_alpha(timer);
draw_set_color(fade_color);
if (view_enabled) {
draw_rectangle(0,0,display_get_gui_width(),display_get_gui_height(),false);
}else{
draw_rectangle(0,0,room_width,room_height,false);
}
}
if (fade_in == true) {
//show_debug_message(string(fade_in))
draw_set_alpha(1-timer);
draw_set_color(fade_color);
if (view_enabled) {
draw_rectangle(0,0,display_get_gui_width(),display_get_gui_height(),false);
}else{
draw_rectangle(0,0,room_width,room_height,false);
}
}

I use display_get_gui_width() and display_get_gui_height()

Developer

They should fill the entire screen. If that is not happening, can you show me a screenshot?

Deleted 31 days ago

Check the previous message.

Developer

But I think the main issue is that we remove the black screen before reaching the ‘objDoor’. We should wait until we’re at the indicated spot before removing it.

I assume you can just add a cutscene_wait before the cutscene_fade_in?

A fix that I found useful in control_cutscene object draw GUI event to cover the entire screen:

I see. So is the problem fixed? I will keep this in mind for the next update.

I tryed to use some cutscene_wait without success.

scene_info = [
[cutscene_fade_out,1,c_black],
[cutscene_wait,3],
[cutscene_camera_follow_object, objBomb,120], // Alternatively cutscene_camera_moveto_position
[cutscene_wait,3],
[cutscene_fade_in,1,c_black],
[cutscene_wait,3],
// Here use some script to show the door unlocking,
// for example cutscene_set_sprite or cutscene_change_variable
// depending on how it works
[cutscene_fade_out,1,c_black],
[cutscene_wait,3],
[cutscene_camera_follow_object,objPlayerWIP,120],
[cutscene_wait,3],
[cutscene_fade_in,1,c_black]
];


Yes the problem is fixed and now the black screen cover the entire GUI.

(1 edit)

I think I found the issue, fade out and fade in (in my side) works just for the first time, the second time the fade out fill the entire screen and everything remain freezed, is it possible that the fact that we use "timer" for everything is going to make some miscalculations?

Another issue I found is in how far is the object to moving for, if is too far the screen just remain freezed and black.

Developer

I did some testing, and the timer doesn’t seem to be the problem, but the camera speed. Try changing the speed from 120 to something smaller, like 10 and see if that fixes it.

Another issue I found is in how far is the object to moving for, if is too far the screen just remain freezed and black.

Can you give more information about this? What object and is it outside the room?

Gotcha! In

function cutscene_camera_follow_object(_ob,_spd) {
// Move the camera object to the object
with(cutscene_camera) {
// Reset it so it won't follow another object at the same time
following = noone;
if (distance_to_object(_ob)>=1) {
//move_towards_point(_ob.x,_ob.y,_spd);
x = _ob.x;
y = _ob.y;
}else{
following = _ob;
cutscene_next();
}
}
}

I changed the move_towards_point() in something more immediate, this make everything work at 100%