Game Development Community

Splash screens are a pain... :(

by Shane09 · in General Discussion · 02/15/2009 (9:15 pm) · 29 replies

PLEASE NOTE: Reading through the other posts will help you to better help me :)

If you can help me identify what I am doing wrong, or what I have left out, that would be greatly appreciated. Thanks in advance :)

Page«First 1 2 Next»
#21
02/18/2009 (4:15 pm)
Whoops. Still not working after deleting 'init.cs'. I also took out the functions that attempted to execute it from before.
#22
02/21/2009 (7:00 am)
I even grabbed completely new folders to test this to make sure it was 100% "stock". However, it still goes straight to the main menu.
#23
02/21/2009 (10:54 am)
Oops! I forgot to list one step for you. A minor but critical step. I'll update the "instructions" in post#20 once I post this.

This is the final instruction that tutorial.base needs in order to have splash screens. In the same main.cs "tutorial.base/main.cs" that you added the exec("./client/ui/startupGui.gui"); to, go down to line#98 where it says Canvas.setContent(MainMenuGui); comment/delete that line and replace it with loadStartup();

I had just re-installed my SDK just to make sure I had a fresh set of scripts before I made this a resource and I missed that step myself this time around -- left me scratching my head -- but that one line should fix you up.
#24
02/21/2009 (11:01 am)
Ahh! Thank you so much! It works exactly fine now! Finally, something in my game works :)
#25
02/21/2009 (11:38 am)
If I wanted to turn my splash screen to play '.ogg' video, how is this done? Or instead, how could I add a music function to the splash screen? This was, the splash screen can be more dramatic then just a few images & some words.
#26
02/21/2009 (1:07 pm)
Adding sound/music is easy. There's a line in function loadStartup() "alxPlay(startsnd);" which will cause a sound to be played if an AudioProfile is setup for it -- can be either a sound effect or a piece of music. Copy the "drill/ratchet" sound effect, it's called "startup.ogg", from "demo/data/sound/gui" to "tutorial.base/data/sound".

And then open up audioProfiles.cs in "tutorial.base/client" and add:
new AudioProfile(startsnd)
{
    filename = "~/data/sound/startup.ogg";
    description = "AudioGui";
    preload = true;
};


#27
02/21/2009 (1:12 pm)
And if you want to use a ogg video for a splash screen, add a sample theora/ogg video to "tutorial.base/data/video" -- I called mine "demoVid" -- and then simply replace your other StartupGui.gui with this code:
new GuiTheoraCtrl(StartupTheoGUI)
{
    canSaveDynamicFields = "0";
    Profile = "GuiDefaultProfile";
    HorizSizing = "relative";
    VertSizing = "relative";
    position = "0 0";
    Extent = "640 480";
    theoraFile = "tutorial.base/data/video/demoVid.ogg";
    MinExtent = "8 8";
    canSave = "1";
    Visible = "1";
    hovertime = "1000";
    done = "0";
    stopOnSleep = "1";
    backgroundColor = "0 0 0 255";
};

function loadStartup()
{
    Canvas.setContent(StartupTheoGUI);
    schedule(100, 0, checkStartupDone);
}

function checkStartupDone()
{
    if (StartupTheoGUI.done)
    {
        echo ("*** Load Main Menu");
        Canvas.setContent(MainMenuGui);//loadMainMenu();
        return;
    }
    else
        schedule(100, 0, checkStartupDone);
}

You can't "click" on a theora video and skip the video like you can a splash screen. But you can add a button to the screen, and issue a stop() command when you click it and then go to the main menu or even another splash screen setup.
#28
06/13/2009 (2:12 pm)
Michael,

Thanks for sharing how to do multiple splash screens. I was trying to follow what was on TDN and couldn't get it to work and had no console errors. I plugged in and changed what you have posted here and it works perfectly!
#29
06/13/2009 (2:47 pm)
@Chris: glad to have been of help.
Page«First 1 2 Next»