Results 1 to 7 of 7
  1. #1
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    209

    Default Video popup (..or playback)

    Hey all, I'm trying to figure out how to place videos that appear when the player activates a trigger. Ideally, they would appear as a frame in game. I've tried adding video to a UIScene and it works (imported bik video and added it to an image widget in the UIScene), however there are two problems:

    1) When I close out of the scene I can still hear the sound from the video, and it just keeps looping with no way to stop it. How can I fix this, is it just some step I did erroneously in kismet or UI editor? Or does this need a whole other approach?
    2) It keeps looping when I keep the window open too (less of a problem than 1, but to have it stop or exit automatically would make it more professional).

    "Bonus" question: Is this the most effective way of playing movies at all in this context? Could I somehow play it directly from a file or do something to make it less memory intensive (as I understand it the game keeps it loaded all the time)?
    Last edited by Crozz; 01-22-2010 at 11:00 PM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    209

    Default

    Just asked a more general question about this in the general forum section.
    http://forums.epicgames.com/showthread.php?t=715398
    Consider answering there instead of here if you got anything Thanks

  3. #3
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Posts
    230

    Default

    I'd like to know how to work with videos in a UIScene, since puting animations of skeletal meshes seems out of the question for now, it would be a nice touch for my inventory. Did you make any progress so far?

  4. #4
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    209

    Default

    I tried looking into the script library. I found two interesting-sounding classes; SeqAct_ControlGameMovie and CodecMovie. CodecMovie pretty much only contains cpptext and as far as I've understood things you can't call that from unrealscript anyway. And after looking a bit at SeqAct_ControlGameMovie, I found it in Kismet - it's new action->"undefined latent", and it has inputs for play, stop, movie name etc. I don't know if this refers to a real movie file or something else like matinee. I tried feeding it with the UE3_logo movie file that comes with UDK but any combination of paths and names did not work for me. I don't know if I'm doing something wrong or if those are scripts that just doesn't work. So just another dead end maybe.

    edit: The CodecMovie class is mostly cpptext as mentioned, but it looks so awesomely convenient.. too bad I can't call any of that (right?) :
    /**
    * Initializes the decoder to stream from disk.
    *
    * @param Filename Filename of compressed media.
    * @param Offset Offset into file to look for the beginning of the compressed data.
    * @param Size Size of compressed data.
    *
    * @return TRUE if initialization was successful, FALSE otherwise.
    */
    virtual UBOOL Open( const FString& Filename, DWORD Offset, DWORD Size ) { return FALSE; }
    Wasn't this one of the great features of udk... movie integration? Somebody has to know something..
    Last edited by Crozz; 01-22-2010 at 10:58 PM.

  5. #5
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Posts
    230

    Default

    Ok i did it, i'm a genius i know (?) xDDDD.

    Well here's what i did, i don't know if it's gonna be of any use to you but here's the info i think i got xD:

    When you place a video, the game doesn't spawn an "instance" for that video, it's always the same video that gets played (i think xD).

    The TextureMovie class has "play()" "pause()" and "stop()" functions.

    You can change the texture of an image with the SetValue() function.

    So for my needs i placed an image in my uiscene, and when i press a button i set it's value to TextureMovie'MyMovie' and set the variable VideoSource to TextureMovie'MyMovie' so when i click another button i use:

    VideoSource.Stop(); (that should stop all the sounds, i think)

    And then i change the texture of the image or whatever i need to do next in the uiscene.



    For your case i think you could do this:

    1. Extend UTUIScene.
    2. Make a UIScene of that class and put an image where you want the video to be played and set it's image to your video.
    3. You have two choices for making the video stop, a timer or a close button.

    For the close button:

    1. In the uiscene place a button.
    2. In your extended uiscene class declare the UIButton variable and the TextureMovie variable.
    3. Set the Onclicked parameter of the button to call a function that should do this:

    1. TextureMovieVariable.stop();
    2. Close the uiscene.

    For the timer:

    1. In the extended uiscene class declare the TextureMovie variable.
    2. Make a function without parameters that stops the video (TextureMovieVariable.stop().
    3. Put a timer in the postbeginplay or somewhere like that that triggers the function when the movie is finished (set the timer to the duration of your movie).


    Guess that should work for you, i don't know exactly what you need but that's a way to stop the video in your uiscene.

    Well, sorry for my english and i hope you get it to work :P. Cyaz-

  6. #6
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    209

    Default

    Ok you are my hero this week Wow that class looks interesting. Can't believe my local search didn't bring it up. Thanks so much.
    Going to play around with it. I think I'll also try to make it play from a file. I'll post here with whatever I come up with!

  7. #7

    Default

    To make video stop automatically just double click on movie texture and uncheck "Looping". Some other interesting options include AutoPlay, Movie Stream Source and NeverStream. Not sure what Kismet node you were talking about, but there's New Action -> Cinematics -> Control Movie Texture, and it works flawlessly, you just have to supply it with a name of movie resource in Movie Texture field. Didn't try it with UIScenes yet..
    The only problem i still see is that there's no way to know if movie has ended.. unless those two variables inside TextureMovie could help XD:

    Code:
    /** Whether the movie is currently paused. */
    var const transient bool Paused;
    /** Whether the movie is currently stopped. */
    var const transient bool Stopped;


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.