[SOLVED] Videos non-blocking playback with GUIs

Started by eri0o, Fri 03/02/2023 13:16:39

Previous topic - Next topic

Snarky

Don't play the video in repeatedly_execute(). That's telling AGS to start playing the video again each game cycle.

Crimson Wizard

#41
You should not be calling Video.Open in repeatedly_execute, at least no without any conditions. Call it only once the video should start. I don't know your case. Is it on room enter, or on button press, or else?

Like I said, this is exactly same case as with non blocking animation, non blocking walking, etc. Same kind of logic should be applied.

Vincent

#42
That's right, thanks guys, the problem was that and I got it fixed now. Still thank you so much, I am so happy that this is working all so good!!! ❤️

[EDIT] @Crimson Wizard @Snarky sorry for bothering once again, I know this is outside of AGS's expertise but I wonder to ask this technical question. It's true that if you want to play a video you should have the file inside the compiled folder (unlike the audio files) but is there a way to 'hide' these videos so people won't see them but only inside the game? like having a 'secret' folder?

Crimson Wizard

Quote from: Vincent on Fri 05/07/2024 11:21:55[EDIT] @Crimson Wizard @Snarky sorry for bothering once again, I know this is outside of AGS's expertise but I wonder to ask this technical question. It's true that if you want to play a video you should have the file inside the compiled folder (unlike the audio files) but is there a way to 'hide' these videos so people won't see them but only inside the game? like having a 'secret' folder?

You do not have to put video file inside the compiled folder, on opposite by default AGS packs ogv videos inside the game data if you place it in your project folder root.

Additionally, you may pack any kind of data using "Package custom data folder(s)" in General Settings:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html

Alternatively, you may place videos in the game folder, but rename them to something else.


Returning to the previous discussion, I forgot to mention, that displaying a video on a GUI Button may be slower than on Overlay, because of how GUI is drawn in AGS.

Vincent

Quote from: Crimson Wizard on Fri 05/07/2024 12:27:15You do not have to put video file inside the compiled folder, on opposite by default AGS packs ogv videos inside the game data if you place it in your project folder root.

Is this has been changed? Because I remember on old versions I coulnd't play the video if this wasn't inside the compiled folder or I remember wrong? Btw I just tryied to remove the video from the compiled folder and the game run just fine, I was surprising.


Quote from: Crimson Wizard on Fri 05/07/2024 12:27:15Returning to the previous discussion, I forgot to mention, that displaying a video on a GUI Button may be slower than on Overlay, because of how GUI is drawn in AGS.

Okay this is good to know thanks a lot! I wanted to play the video over a button graphic only for the purpose on having the video in front of the gui but you reminded me that overlay also have the zOrder so that's cool!

eri0o

So if you put a video file in the project root dir it will be picked up automatically and packed into the root of the game package. If you use the custom asset packaging for storing the video you need to pass the full internal path for it ("$DATA$/videodir/videoname.ogv").

The other thing is AGS also looks for files outside the game package - so if you put a video file, that can even be a different video file, that has the same name as the video you packed, in the game binary/exe root dir, ags will play that file instead of what is packed inside. This works for any game asset (except imported sprites), and can be used for patching a game - more useful in platforms that doesn't support binary patching.

SMF spam blocked by CleanTalk