Video Issue

Started by Armageddon, Tue 12/06/2012 05:14:38

Previous topic - Next topic

Armageddon

Hello all, so today I rendered a 320x200(The size of my game) video in 3DSMax. I added it to AGS and have it play when the game starts. I have my game use the 2x nearest neighbor filter, and when the video plays there's about a 20 pixel wide black bar on the left side and I can't figure out how to fix it, I've tried running the game in a non-2x filter and it still shows up, I've tried all the PlayVideo flags but nothing seems to work.

Also I was wondering how you display a quitting GUI when you try to close the game?

Thanks.

Gilbert

I think this is possibly a problem with the codec. As far as I remember PlayVideo() just plays the clips with Media Player DirectShow in general, so there may be due to the settings of driver the of the codec used.

Either try playing around with the codec's setting of your system (if you can) or try encoding the clip with another codec and see whether it makes any difference. Or, (maybe) better, encode the clip as an OGG Theora file (I think the usual extension is .ogv or something) if you haven't already as AGS supports this format natively and does not rely on external player/driver/whatever for proper playback (so players having systems with different settings may not complain to you).

Creator

#2
Quote from: Armageddon on Tue 12/06/2012 05:14:38Also I was wondering how you display a quitting GUI when you try to close the game?

To use the built in Quit GUI, just use
Code: AGS

QuitGame(1);


If you want to make your own GUI, set it up with a label saying "Are you sure you want to quit?" (or whatever you want), and two buttons. The "yes" button (the one that quits the game) to have:
Code: AGS

QuitGame(0);


And the "no" button to close the GUI.
Code: AGS

gQuitGui.Visible = false;


Also, call me stupid, but can you still put code in a little box like you used to? I can't find any option for it. Found it. ;-D

Armageddon

Hey thanks for the replies, I'll try out another codec.

arj0n


Armageddon

#5
I'm sorry, I should have made this clearer. What I meant was how do I get a GUI to pop up when you click this?



Several older games do it.

EDIT: I'm also wondering if you can number the save slots? Thanks.
Oh and if a GUI is visible check whether a key is pressed and if it is do something?

Gilbert

#6
Quote from: Armageddon on Wed 13/06/2012 03:10:35
Several older games do it.
By older games, do you mean AGS games, or arbitrary games in general?
It may not be possible to do this with AGS (I'm not sure about this and I haven't really checked, so I can be wrong).

Quote
I'm also wondering if you can number the save slots? Thanks.
Can you elaborate on this?

Quote
Oh and if a GUI is visible check whether a key is pressed and if it is do something?
Just check in on_key_pressed() with something like (quickly typed, please fix the variables to their correct names):
Code: AGS

if (gBlah.Visible==true&&keycode==eKeySpace) { ... }

Armageddon

#7
Arbitrary games.

The if GUI is visible thing isn't working. It compiles but it has no effect. The no click on gMenu_Gui works though.

Code: AGS
  if (gQuit_Gui.Visible==true&&keycode==eKeyY)
  {
    QuitGame(0);
  }
  else if (gQuit_Gui.Visible==true)
  {
    gMenu_Gui.Clickable = false;
  }
  else if (gQuit_Gui.Visible==true&&keycode==eKeyN)
  {
    gQuit_Gui.Visible = false;
    gMenu_Gui.Visible = false;
  }


Also like this.



Creator

#8
I tested your code out in one of my games and what happened is that the if and first else if statements ran, but the last else if didn't. I think the problem might be that you have every condition has gQuit_Gui being visible, so the middle else if runs no matter what key is pressed and the last one will never run, seeing as it's also an else if (else if statements will only run if the previous if or else if is false).

Code: AGS

if (gQuit_Gui.Visible == true)
{
  if (keycode == eKeyY)
  {
    QuitGame(0);
  }
  else if (keycode == eKeyN)
  {
    gQuit_Gui.Visible = false;
    gMenu_Gui.Visible = false;
    gMenu_Gui.Clickable = true; //See my edit below for why this is here.
  }
}


This works fine for me. I don't know what you needed the middle else if for though. Could you explain?
EDIT - From my understanding, it seems to be that you don't want the menu GUI clickable when the quit GUI is up. Is that right? If so, put gMenu_Gui.Clickable = false; where ever you put gQuit_Gui.Visible = true;
Don't forget to make the Menu GUI clickable again after you press N though.

Armageddon

#9
This is weird, put the code in exactly like you have it and added the clickable = false when you press the Quit button on the menu and it still doesn't work, you press F1 to open the menu so I know key presses work.

EDIT: Oh my, I have the game pause when you open the menu and key presses don't work during pause. /facepalm

I just had to comment out the line that says if paused don't react. Thanks, I'd still like to know about the save slot numbers though.
Also I noticed that if I keep clicking repeatedly the player stalls before walking instead of just going to the newest point. Also is there a 'walk to nearest' type thing if you click outside a walkable area? I know these are all small details but flow in a game really matter to me.

Khris

You shouldn't just comment out the line. Check for keypresses you want to always work, then do if (IsGamePaused()) return; then check for other keypresses.

Regarding your code, if you swap the block in lines 5-8 with the last one, it should work. But yeah, structuring things like Creator suggested is better.

As for numbering the save slots, the 9verb template closely replicates the Lucas Arts system.
You'll have noticed that one types the save name directly into the list, not in a separate text field. This is done by displaying a text field above the list.
Numbering the slots is easy though, just iterate through them and add the number to the text using lstSaveGamesList.Items and String.Format.

Armageddon

Okay so, I've been looking at the 9verb code for a day now and it makes no sense to me. I notice that he has a separate GUI for typing the text and having a number displayed, somehow he puts this in the list? I just don't see where this was done. Any help would be greatly appreciated.

SMF spam blocked by CleanTalk