Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: KyriakosCH on Fri 10/07/2020 19:09:55

Title: Basic question about using a video
Post by: KyriakosCH on Fri 10/07/2020 19:09:55
Hi, I want to ask

1) if I can use mp4 directly

2) if I have to convert to some other format, which format should it be (also feel free to suggest any free program to do this...)

3) in either case, what command do I use to call the video, and how do I link the file to the game? (eg with soundfiles one has to save them through the sound menu)

Thanks :)
Title: Re: Basic question about using a video
Post by: Cassiebsg on Fri 10/07/2020 20:04:55
You can use mp4, I think, but that will mean that the player will need to have the same codec installed.

It's better to encode/convert to ogg, since AGS can play that without the player needing to have the codec installed.

If it's ogg, just place it with the game files and it will be included in the final game automatically.

From the manual:
Quote
PlayVideo

PlayVideo (string filename, VideoSkipStyle, int flags)

Plays an AVI, MPG or OGG Theora file, or any other file type supported by Media Player. The game is paused while the video plays.
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 10/07/2020 20:57:30
Οκ!
Title: Re: Basic question about using a video
Post by: KyriakosCH on Thu 16/07/2020 01:38:01
Hm, the video is not loading. I placed it where I should (I know this, given at first I hadn't and got the message by AGS), in the windows/compiles folder.
The game clearly identifies the file as being there, but doesn't run it (it does stop the in-game music, as it should due to the flag).

Any ideas as to why? I tried with avi and ogg. Maybe the video resolution being different from the game one is to blame?
Title: Re: Basic question about using a video
Post by: Khris on Thu 16/07/2020 07:55:25
ogg files go in the main game folder (because they're compiled into the exe); please state which format you ended up using, ideally show the line of code you're using, etc.
Title: Re: Basic question about using a video
Post by: KyriakosCH on Thu 16/07/2020 12:32:51
Filename is Theend

I used the line:

PlayVideo ("Theend.avi", eVideoSkipNotAllowed, 0);

The .avi was placed in Compiled/Windows
Title: Re: Basic question about using a video
Post by: Khris on Thu 16/07/2020 13:12:10
So the in-game music stops. What else are you getting? A black screen? An error message of some kind? Sound or no?
Does the video play when you double click it in Windows Explorer?
Title: Re: Basic question about using a video
Post by: KyriakosCH on Thu 16/07/2020 13:15:31
Quote from: Khris on Thu 16/07/2020 13:12:10
So the in-game music stops. What else are you getting? A black screen? An error message of some kind? Sound or no?
Does the video play when you double click it in Windows Explorer?

1) the video plays fine on WE (I am using Win7 if that matters)
2) no black screen (just the same as the room was before - even the hotspots work if you click them)
3) no error message
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 10:44:20
Guys, any ideas? :) I want to release the game by the end of the month.
I will also today try with .ogg in the main folder.

Another question: originally the game had another name, so the game folder has that other name, now:
1) can I change the game folder name? (if I just do it manually, AGS does not track the game...)
2) perhaps this creates an issue with the video?

Thanks for all your help!!!  (nod)
Title: Re: Basic question about using a video
Post by: Crimson Wizard on Fri 17/07/2020 11:21:11
Quote from: KyriakosCH on Fri 17/07/2020 10:44:20
Another question: originally the game had another name, so the game folder has that other name, now:
1) can I change the game folder name? (if I just do it manually, AGS does not track the game...)

What do you mean by "does not track the game"?
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 11:25:49
Quote from: Crimson Wizard on Fri 17/07/2020 11:21:11
Quote from: KyriakosCH on Fri 17/07/2020 10:44:20
Another question: originally the game had another name, so the game folder has that other name, now:
1) can I change the game folder name? (if I just do it manually, AGS does not track the game...)

What do you mean by "does not track the game"?

I mean that if I change the name of the file folder, which is stored at documents/ , AGS stops giving the option to continue working on the game (so cannot track it). Granted, I didn't try to manually track it - may this can be done (?). But AGS doesn't automatically locate the game :)

Maybe I can load the game in AGS, erase the entire folder, have AGS remake the files and then the folder name will be the new one?

More importantly, the game.exe would be nice to have with the new name :D I can always change the folder name when I save the finished game...
Title: Re: Basic question about using a video
Post by: Crimson Wizard on Fri 17/07/2020 11:41:43
Quote from: KyriakosCH on Fri 17/07/2020 11:25:49
I mean that if I change the name of the file folder, which is stored at documents/ , AGS stops giving the option to continue working on the game (so cannot track it). Granted, I didn't try to manually track it - may this can be done (?). But AGS doesn't automatically locate the game :)

Of course this can be done, there's  "Continue existing game.." option at startup which lets you find your game in explorer.
The "recent games" list is merely for convenience.


Quote from: KyriakosCH on Fri 17/07/2020 11:25:49
More importantly, the game.exe would be nice to have with the new name :D I can always change the folder name when I save the finished game...

Which version do you use? Newest has a "Game file name" property in General Settings.
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 12:28:27
Thanks! Did that now :D

Using 3.4.3 Yes, I had already changed the game name in that list. I was thinking of customizing the actual .exe itself, though... I recall you can even have a custom graphic for it :)

Also, any ideas regarding the videos? Cause they will really make the game more appealing...
Title: Re: Basic question about using a video
Post by: Crimson Wizard on Fri 17/07/2020 12:31:40
Have you tried OGV for video? These are more portable too. AVI can only be played by AGS on Windows.
Title: Re: Basic question about using a video
Post by: Matti on Fri 17/07/2020 12:48:29
Quote from: KyriakosCH on Fri 17/07/2020 12:28:27
Thanks! Did that now :D

Using 3.4.3 Yes, I had already changed the game name in that list. I was thinking of customizing the actual .exe itself, though... I recall you can even have a custom graphic for it :)

Changing the game name in the properties does change the name of the .exe too.

To use a custom graphic, put a USER.ico into the game's folder (at least that's how you did it in some older version of the editor).
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 12:53:40
Quote from: Crimson Wizard on Fri 17/07/2020 12:31:40
Have you tried OGV for video? These are more portable too. AVI can only be played by AGS on Windows.

I now did try with OGG. The OGG itself runs just fine, outside of the game. I even tried to set a different program to run it (by default it had VLC media player, so I switched it to Windows Player...), but in-game it just does not run.
Also, I got the message that even the OGG must be in the compiled/windows folder (placed it there too - still didn't run, no error, just nothing).
By now I am seriously thinking of just breaking up the video into frames and importing it as an animation (given it only runs for 12 seconds anyway)... But it would be great if I can run videos, so I can use more!

Quote from: Matti on Fri 17/07/2020 12:48:29
Quote from: KyriakosCH on Fri 17/07/2020 12:28:27
Thanks! Did that now :D

Using 3.4.3 Yes, I had already changed the game name in that list. I was thinking of customizing the actual .exe itself, though... I recall you can even have a custom graphic for it :)

Changing the game name in the properties does change the name of the .exe too.

To use a custom graphic, put a USER.ico into the game's folder (at least that's how you did it in some older version of the editor).

Indeed... Thanks!
Title: Re: Basic question about using a video
Post by: Crimson Wizard on Fri 17/07/2020 12:58:31
Quote from: KyriakosCH on Fri 17/07/2020 12:53:40
Also, I got the message that even the OGG must be in the compiled/windows folder (placed it there too - still didn't run, no error, just nothing).

No, it does not need to be in compiled folder, AGS editor takes it from project folder root and compiles into game package.

What is the actual name of a video file? Extension should be exactly "ogv", not "ogg".
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 14:00:11
Quote from: Crimson Wizard on Fri 17/07/2020 12:58:31
Quote from: KyriakosCH on Fri 17/07/2020 12:53:40
Also, I got the message that even the OGG must be in the compiled/windows folder (placed it there too - still didn't run, no error, just nothing).

No, it does not need to be in compiled folder, AGS editor takes it from project folder root and compiles into game package.

What is the actual name of a video file? Extension should be exactly "ogv", not "ogg".

Omg, for some reason I thought the file type should be ogg, when it was ogv...

Works fine now...

Thanks, and sorry for the trouble!!!!  8-0
Title: Re: Basic question about using a video
Post by: Khris on Fri 17/07/2020 14:53:58
After you have published your game, could you upload the avi version somewhere? I'd like to find out why AGS didn't play it.
Title: Re: Basic question about using a video
Post by: KyriakosCH on Fri 17/07/2020 22:29:58
If you want the avi file, just pm me an email :)