Re: [SUBPROJECT] Introduction cutscene

your version is a thousand times better!

version with background


http://upload.surgeswarehouse.com/upload/opensurge2.PNG

PunBB bbcode test
Creating and Editing Sprites.

77

Re: [SUBPROJECT] Introduction cutscene

its perfect!

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [SUBPROJECT] Introduction cutscene

Very good, Race! big_smile I think the cutscene art is done now, isn't it? Thank you very much!

The only thing missing now is fixing the issues in the scripting. I checked dropbox, and it's still got timing issues. Depending on my framerate, the "will be over" text isn't displayed: the main menu comes before (or during) it.

at a first glance, the .intro_subtitles and the .cutscene_skipper objects are perfectly fine. Some refactoring could be done in "Introduction Cutscene", as the logic currently written in there may give you headaches. Things could be easier. It's just a suggestion, though. It's up to you. tongue

Re: [SUBPROJECT] Introduction cutscene

Alexandre wrote:

Very good, Race! big_smile I think the cutscene art is done now, isn't it? Thank you very much!

The only thing missing now is fixing the issues in the scripting. I checked dropbox, and it's still got timing issues. Depending on my framerate, the "will be over" text isn't displayed: the main menu comes before (or during) it.

I can't get this fixed... after multiple attempts I still can't get it to work.

Alexandre wrote:

Some refactoring could be done in "Introduction Cutscene", as the logic currently written in there may give you headaches. Things could be easier. It's just a suggestion, though. It's up to you. tongue

At this point, let's just get it done before doing any reordering.

80

Re: [SUBPROJECT] Introduction cutscene

what is the object that ends the cutscene? maybe that object is working on a timeout which is too low

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [SUBPROJECT] Introduction cutscene

SilverstepP wrote:

I can't get this fixed... after multiple attempts I still can't get it to work.

The code that handles the audio in the script seems to be fine. Can you use that to your own benefit?

In my opinion, and I said that a few days ago, "Introduction Cutscene" should be rewritten. The code is a bit messy (please consider this as a good criticism), and it will be hard to make it synchronize properly. It's probably easier to rewrite that code completely and use some clean timers. "Introduction Cutscene" should also be a hidden object.

KZR wrote:

what is the object that ends the cutscene? maybe that object is working on a timeout which is too low

It's "Introduction Cutscene".

---

Man, rewrite that object. Seriously. It will save you time and headaches.

Re: [SUBPROJECT] Introduction cutscene

No news regarding the scripts?

83

Re: [SUBPROJECT] Introduction cutscene

the issues of cutscene lenth and sync of last 2 lines are solved.

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [SUBPROJECT] Introduction cutscene

that's nice. Thanks, KZR. Unfortunately, the cutscene had many other problems, like: the music repeated itself if the fps was low, Surge & friends appeared too early in the cutscene (see the specifications), etc. The script of the "Introduction Cutscene" object was buggy, and I've been saying his for quite some time now. However, apparently this had no effect on the actual work. Therefore I decided to step in and help you guys with this in a more concrete manner.

Those of you who took care of the scripting, please listen. It's a construtive criticism.. You probably have had headaches because you were most likely doing the synchronization by trial and error. "Introduction cutscene" and ".intro_subtitles" did not talk to each other, hence the problems. They had separate timers which were not synchronized. ".intro_subtitles" had gotten all the timing right, so all you needed to do is to make "Introduction cutscene" be synchronized to it via message passing: .intro_subtitles calls change_closest_object_state, and everything simply works!

I have rewritten "Introduction cutscene" completely and changed its name to ".intro_startup". The complexity of the code (i.e., the number of states) has been drastically reduced. It's just a matter of organization. Please study it! I'm posting the new working code at the end of this post.

I'm officially closing this task, as this has consumed too much time to be made. Thanks for everyone who were involved. smile If you believe you can improve something, please post your improvements in this thread.

If you have any questions, please let me know. You guys are super smart, you have done impressive things with scripting, so I'm sure you can learn this!

https://spreadsheets0.google.com/oimg?key=0AnwwyfcLWzIPdFd6UElSUmFGYWh4REpFUlgzVFRrNUE&oid=2&zx=uv5w0zt82rja

// introduction cutscene
// by Joao Victor, SilverstepP, KZR, jobromedia, Alexandre

object ".intro_startup"
{
    requires 0.2.0
    detach_from_camera
    always_active

    // main
    state "main"
    {
        set_alpha 1.0
        set_zindex 0.9999

        create_child ".cutscene"
        create_child ".intro_subtitles"
        create_child ".intro_background"
        create_child ".cutscene skipper

        play_music "musics/intro/Jobromedia-Intro.ogg" 0
        change_state "start 1st slide"
    }

    // first slide
    state "start 1st slide"
    {
        set_absolute_position 160 -180
        set_animation "SD_INTROCUTSCENE_SLIDE1" 0
        change_state "1st slide"
    }

    state "1st slide"
    {
        set_absolute_position xpos() min(-10,ypos()+12*dt())
    }

    state "show 2nd slide" // called by someone else
    {
        set_alpha max(0,alpha()-(1.0/1.5)*dt())
        if alpha()<=0 "start 2nd slide"
    }

    // second slide
    state "start 2nd slide"
    {
        set_absolute_position 160 0
        set_animation "SD_INTROCUTSCENE_SLIDE2" 0
        change_state "2nd slide"
    }

    state "2nd slide"
    {
        set_alpha min(1,alpha()+(1.0/1.5)*dt())
    }

    state "show 3rd slide" // called by someone else
    {
        set_alpha max(0,alpha()-(1.0/2.5)*dt())
        if alpha()<=0 "start 3rd slide"
    }

    // third slide
    state "start 3rd slide"
    {
        set_animation "SD_INTROCUTSCENE_SLIDE3" 0
        set_absolute_position 320 0
        change_state "3rd slide"
    }

    state "3rd slide"
    {
        set_alpha min(1,alpha()+(1.0/2.5)*dt())
        set_absolute_position cond(alpha()>=0.5,max(160,xpos()-10*dt()),xpos()) ypos()
    }

    state "show 4th slide" // called by someone else
    {
        set_alpha max(0,alpha()-(1.0/1.5)*dt())
        if alpha()<=0 "start 4th slide"
    }

    // fourth slide
    state "start 4th slide"
    {
        set_absolute_position 160 0
        set_animation "SD_INTROCUTSCENE_SLIDE4" 0
        change_state "4th slide"
    }

    state "4th slide"
    {
        set_alpha min(1,alpha()+(1.0/1.5)*dt())
    }

    state "show 5th slide" // called by someone else
    {
        set_alpha max(0,alpha()-(1.0/4.5)*dt())
    }
}

object ".intro_subtitles"
{
    requires 0.2.0
    always_active
    detach_from_camera

    // state detection
    state "main"
    {
        set_absolute_position 0 0
        set_zindex infinity()+999

        let "$strlen = 0"
        if "$text == 9" "length9"
        if "$text == 8" "length8"
        if "$text == 7" "length7"
        if "$text == 6" "length6"
        if "$text == 5" "length5"
        if "$text == 4" "length4"
        if "$text == 3" "length3"
        if "$text == 2" "length2"
        change_state "length1"
    }

    // synchronization issues
    state "show 2nd slide"
    {
        change_closest_object_state ".intro_startup" "show 2nd slide"
        return_to_previous_state
    }

    state "show 3rd slide"
    {
        change_closest_object_state ".intro_startup" "show 3rd slide"
        change_state "wait_fade"
    }

    state "show 4th slide"
    {
        change_closest_object_state ".intro_startup" "show 4th slide"
        change_state "wait_fade"
    }

    state "show 5th slide"
    {
        change_closest_object_state ".intro_startup" "show 5th slide"
        change_state "wait_fade"
    }

    // wait or fade
    state "wait_fade"
    {
        on_timeout 1.25 "main"
    }

    // detect length and play narration
    state "length1"
    {
        let "$displaytime = 10"
        textout "menu.small" -1000 -1000 "$OPENING_1"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 1"
        play_sample "musics/intro/intro1.ogg"
        change_state "text1"
    }

    state "length2"
    {
        let "$displaytime = 10"
        textout "menu.small" -1000 -1000 "$OPENING_2"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 2"
        play_sample "musics/intro/intro2.ogg"
        change_state "text2"
    }

    state "length3"
    {
        let "$displaytime = 11"
        textout "menu.small" -1000 -1000 "$OPENING_3"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 3"
        play_sample "musics/intro/intro3.ogg"
        change_state "text3"
    }

    state "length4"
    {
        let "$displaytime = 9"
        textout "menu.small" -1000 -1000 "$OPENING_4"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 4"
        play_sample "musics/intro/intro4.ogg"
        change_state "text4"
    }

    state "length5"
    {
        let "$displaytime = 10"
        textout "menu.small" -1000 -1000 "$OPENING_5"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 5"
        play_sample "musics/intro/intro5.ogg"
        change_state "text5"
    }

    state "length6"
    {
        let "$displaytime = 9"
        textout "menu.small" -1000 -1000 "$OPENING_6"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 6"
        play_sample "musics/intro/intro6.ogg"
        change_state "text6"
    }

    state "length7"
    {
        let "$displaytime = 9"
        textout "menu.small" -1000 -1000 "$OPENING_7"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 7"
        play_sample "musics/intro/intro7.ogg"
        change_state "text7"
    }

    state "length8"
    {
        let "$displaytime = 3"
        textout "menu.small" -1000 -1000 "$OPENING_8"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 8"
        play_sample "musics/intro/intro8.ogg"
        change_state "text8"
    }

    state "length9"
    {
        let "$displaytime = 1.5"
        textout "menu.small" -1000 -1000 "$OPENING_9"
        let "$length = $_STRLEN"
        let "$typerate = 1.5*$length/$displaytime"
        let "$_introtextout = 9"
        play_sample "musics/intro/intro9.ogg"
        change_state "text9"
    }

    // real text display
    state "text1"
    {
        textout "menu.small" 2 210 "$OPENING_1" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 2"
        on_timeout "$displaytime" "wait_fade"
    }

    state "text2"
    {
        textout "menu.small" 2 210 "$OPENING_2" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 3"
        on_timeout "$displaytime" "wait_fade"
    }

    state "text3"
    {
        textout "menu.small" 2 210 "$OPENING_3" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 4"
        on_timeout "$displaytime * 0.45" "show 2nd slide"
        on_timeout "$displaytime" "show 3rd slide"
    }

    state "text4"
    {
        textout "menu.small" 2 210 "$OPENING_4" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 5"
        on_timeout "$displaytime" "wait_fade"
    }

    state "text5"
    {
        textout "menu.small" 2 210 "$OPENING_5" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 6"
        on_timeout "$displaytime" "wait_fade"
    }

    state "text6"
    {
        textout "menu.small" 2 210 "$OPENING_6" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 7"
        on_timeout "$displaytime" "show 4th slide"
    }

    state "text7"
    {
        textout "menu.small" 2 210 "$OPENING_7" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 8"
        on_timeout "$displaytime" "show 5th slide"
    }

    state "text8"
    {
        textout "menu.small" 2 210 "$OPENING_8" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        let "$text = 9"
        on_timeout "$displaytime*2" "wait_fade"
    }

    state "text9"
    {
        textout "menu.small" 2 210 "$OPENING_9" 316 0 $strlen
        let "$strlen += $typerate*dt()"
        on_timeout "$displaytime*6" "end"
    }

    // end
    state "end"
    {
        next_level
    }
}

object ".cutscene skipper"
{
    requires 0.2.0
    always_active

    state "main"
    {
        on_button_pressed "fire1" "end"
        on_button_pressed "fire3" "end"
    }

    state "end"
    {
        next_level
    }
}

object ".intro_background"
{
    requires 0.2.0
    detach_from_camera

    state "main"
    {
        set_absolute_position 0 0
        set_animation SD_FADEEFFECT 0
    }
}

Re: [SUBPROJECT] Introduction cutscene

... and if you're going to test it, you need an updated intro.lev

// ------------------------------------------------------------
// Open Surge Engine 0.2.0 level
// This file was generated by the built-in level editor.
// ------------------------------------------------------------

// header
name "Introduction Cutscene"
author "OS Team"
version "1.0"
requires 0.2.0
act 1
theme "themes/template.brk"
bgtheme "themes/template.bg"
spawn_point 0 0
grouptheme "themes/template.grp"
startup ".intro_startup"
players "none"

Re: [SUBPROJECT] Introduction cutscene

Revision 558 includes the introduction cutscene!

For the great job, thanks to: Colin Beard, Joao Victor, Johan Brodd, Mateus Reis, opengameart.org wink

easter egg: change your system date to april 1st

Re: [SUBPROJECT] Introduction cutscene

"FATAL ERROR:couldn't load spritesheet "images/intro_cutscene/scepter.png"

BUILD DATE: Qua Abr 20 08:01:21 UTC 2011
SVN REVISION: 560
GAME VERSION: 0.2.0 (work in progress)

PunBB bbcode test
Creating and Editing Sprites.

Re: [SUBPROJECT] Introduction cutscene

Race the Hedgehog wrote:

"FATAL ERROR:couldn't load spritesheet "images/intro_cutscene/scepter.png"

BUILD DATE: Qua Abr 20 08:01:21 UTC 2011
SVN REVISION: 560
GAME VERSION: 0.2.0 (work in progress)

It's fixed now. Please download it again.

Re: [SUBPROJECT] Introduction cutscene

SUPER-MEGA-EPIC-CUTSCENE! lol

LoL, very funny easter egg!

PunBB bbcode test
Creating and Editing Sprites.

Re: [SUBPROJECT] Introduction cutscene

Just played through it.  Good job, though it looks like Gimacian's (sp :s) right hand is on backwards in the art (is that a design feature?)

Re: [SUBPROJECT] Introduction cutscene

you're right.

Redshrike wrote:

(is that a design feature?)

hmm, I don't think so ...