Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2013-01-31 16:50:03

SuperSonicRacing
Member
From: Bowness-on-Windermere, UK
Registered: 2013-01-21
Posts: 48

Cutscenes

Sorry for all the questions, but this should be the final one.
How do you make a cutscene, a very basic one of mainly text or a couple of non-animated images? The cutscene.levs are hard to read as they aren't uniformed and word wrap doesn't help.
Thanks in adavance!

Offline

#2 2013-01-31 17:08:04

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Cutscenes

Someone should start record open surge development tutorials on youtube.

Offline

#3 2013-01-31 17:20:54

SuperSonicRacing
Member
From: Bowness-on-Windermere, UK
Registered: 2013-01-21
Posts: 48

Re: Cutscenes

I would be happy to start with basic stuff if you want, such as level editing, bricksets, themes etc.. i just need to learn the higher stuff.

Offline

#4 2013-01-31 20:40:18

MatheusRRR
Member
From: Rio de Janeiro, Brazil
Registered: 2012-10-05
Posts: 335
Website

Re: Cutscenes

is not simple to create cutscenes, but it's not complicated. what do you should do is create an object with the cutscene, and definilo at a specific level using the "startup". To create the object, use the states putting id_avatar in dialogbox and setting its text.

example: cutscene 1 (original)

object .dialogbox.cutscene1
{
    requires 0.2.0
    always_active
    detach_from_camera

    state main
    {
        let $step=0
        let $num_steps=15
        let $_dialogbox_avatar_id=1
        let $_dialogbox_text_id=100

        hide
        create_child .dialogbox.base.background[cutscene] 0 0 background
        create_child .dialogbox.base.avatar 0 0 avatar
        create_child .dialogbox.base.text[typewriter] 0 0 text
        create_child .dialogbox.base.button 0 0 button
        change_state wait
    }

    state wait
    {
    }

    state .dialogbox.base.background:on_appear
    {
        change_child_state text start
        change_state wait
    }

    state .dialogbox.base.background:on_disappear
    {
        change_child_state background destroy
        change_child_state avatar destroy
        change_child_state text destroy
        change_child_state button destroy
        change_parent_state .dialogbox:on_destroy
        destroy
    }

    state .dialogbox.base.text:on_complete
    {
        // displaying the correct avatar and message
        let $step+=1
        let $a=cond($step==0,1,$a)
        let $a=cond($step==1,2,$a)
        let $a=cond($step==2,1,$a)
        let $a=cond($step==3,2,$a)
        let $a=cond($step==4,1,$a)
        let $a=cond($step==5,2,$a)
        let $a=cond($step==6,1,$a)
        let $a=cond($step==7,2,$a)
        let $a=cond($step==8,1,$a)
        let $a=cond($step==9,2,$a)
        let $a=cond($step==10,1,$a)
        let $a=cond($step==11,1,$a)
        let $a=cond($step==12,2,$a)
        let $a=cond($step==13,1,$a)
        let $a=cond($step==14,1,$a)
        let $_dialogbox_text_id=100+$step
        let $_dialogbox_avatar_id=$a

        // tell the parent that the step has changed
        change_parent_state .dialogbox.cutscene1:completed_step

        // ok
        change_state message_delivered
    }

    state .dialogbox.base.text:on_start
    {
        change_parent_state .dialogbox.cutscene1:began_step
        change_state void
    }

    state void
    {
    }

    // ------------------------------------------------

    state message_delivered
    {
        // am I blocked?
        change_child_state button hidden
        if $blocked message_delivered

        // refresh?
        change_child_state button continue
        if $step<$num_steps wants_to_refresh

        // end?
        change_child_state button stop
        change_state completed
    }

    state wants_to_refresh
    {
        on_button_pressed fire1 refresh
    }

    state refresh
    {
        change_child_state avatar refresh
        change_child_state text refresh
        change_state wait
    }

    state completed
    {
        on_button_pressed fire1 disappear
    }

    state disappear
    {
        change_child_state background disappear
        change_state wait
    }

    state hide
    {
        change_child_state background hide
        change_state wait
    }

    state show
    {
        change_child_state background show
        change_state wants_to_refresh
    }

    // returns the step in which the dialog box is in
    state @get_step
    {
        let $_fun_value=$step
        return_to_previous_state
    }

    // blocks this dialog box
    state block
    {
        let $blocked=1
        return_to_previous_state
    }

    // unblocks this dialog
    state unblock
    {
        let $blocked=0
        return_to_previous_state
    }
}

epero that helps a bit. ^^

Offline

#5 2013-01-31 22:40:57

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Cutscenes

a cutscene can be made very easily, or it can be very hard. It depends on what you want.

tutorials on youtube would be awesome.

there should be a tutorial (case study) on the wiki for a simple cutscene. A sequence of texts and images, that show without any special effects. This is EXACTLY what a state machine is, hence this can be made pretty easily, because objects ARE state machines.

how do you make a simple text-only cutscene, with no eye candy? Easy.

1. in the .lev file, set the player to "None".
2. in the .lev file, set the startup object to ".mycutscene" (or whatever name you choose)
3. create a mycutscene.obj file, which will hold an always_active object, and then you script it:

a. state main: hide the object, goto state 1
b. state 1: textout "something", on_timeout 5 goto state 2
c. state 2: textout "way to go", on_timeout 5 goto state 3
.
. (and so on)
.
k. state 10: next_level

Can someone write a tutorial, please? smile

Offline

#6 2013-02-01 16:08:00

SuperSonicRacing
Member
From: Bowness-on-Windermere, UK
Registered: 2013-01-21
Posts: 48

Re: Cutscenes

Thanks a lot for your help!:D

Offline

#7 2013-02-01 16:32:12

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Cutscenes

Well that has to be someone else who writes that tutorial. smile

And also while whe're at cutscenes. How do you load a cutscene to test it out from within the game? Since there is no folder browser within the game there is no way one can actualy open the cutscene folder. yikes

Offline

#8 2013-02-01 17:10:08

SuperSonicRacing
Member
From: Bowness-on-Windermere, UK
Registered: 2013-01-21
Posts: 48

Re: Cutscenes

Its a .lev isn't it? so you can open it through a quest but otherwise, i don't know

Offline

#9 2013-02-01 19:25:27

lunarrush
Member
Registered: 2010-05-13
Posts: 278

Re: Cutscenes

Generally you add them into a quest where you want them to appear, for example you can make one appear once the player presses start game by putting it in default.qst.  Depending on how things are going I could potentially start a series of youtube tutorials teaching various things about game design/open surge engine hacking, but before I start such things I need to find where I have time to do so, and though I may not be the most experienced at stuff such as this I think I could provide a decent starting point for people who want to get into hacking this engine.


If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Offline

#10 2013-02-02 00:12:33

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Cutscenes

if any1 wants a tutorial, here it is:
click here cool

SuperSonicRacing wrote:

Its a .lev isn't it? so you can open it through a quest but otherwise, i don't know

that works, but there's an easier way.

jobromedia wrote:

And also while whe're at cutscenes. How do you load a cutscene to test it out from within the game? Since there is no folder browser within the game there is no way one can actualy open the cutscene folder.

if you enjoy using the command line, you can just launch

opensurge --level levels/some_level.lev

if you don't, you can simply go to the DEBUG (SECRET) stage selection screen, where all .lev's will show up - cutscenes and everything. How do you access it?

1. goto options screen
2. highlight stage select
3. press RIGHT three times; you'll hear a sound
4. enter

this should be documented in the wiki. Please. Any volunteers?

lunarrush wrote:

Depending on how things are going I could potentially start a series of youtube tutorials teaching various things about game design/open surge engine hacking, but before I start such things I need to find where I have time to do so, and though I may not be the most experienced at stuff such as this I think I could provide a decent starting point for people who want to get into hacking this engine.

that would be great smile

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org