IsKeyPress function during FLIK animations

Started by , Wed 31/05/2006 15:12:48

Previous topic - Next topic

oraclekai

I'm working on a series of flic animations to run one after the other (which is simple) but I also want to has a IsKeyPress(32) function to cancel these videos. I've tried to make if else statements but so far I've come to a halt in SIMPLE scripting...

Example:
A series of flic animations would run one after the other during the script that loads when the first time the character enters the room. During these animations and sounds, I would like to be able to skip them at any given moment pressing the space bar (32).
I've tried several variations of HasPlayerBeenInRoom and IsKeyPress(32)... but I can't seem to interrupt the flic animations. I suppose my actual question is (but not limited to...) how do I stop a series of flic animations after they have started? Any help would be appreciated. ???

Code: ags
function room_a() {
  // script for Room: First time player enters room
if (IsKeyPressed(32) == 1) {
}
else {
PlaySoundEx(1,3);
PlayFlic(1,1);
PlayFlic(2,1);
SetChannelVolume (3, 0);
PlayAmbientSound (1, 3, 255, 0, 0);
PlayFlic(3,1);
StopAmbientSound (1);
SetChannelVolume (3, 255);
PlayFlic(5,1);
PlayFlic(4,1);
PlayFlic(6,1);
PlaySoundEx(2,3);
PlayFlic(7,1);
character[EGO].ChangeRoom(1, 270, 168);
}
}

The behavior of this seems that it only checks if the space bar is held down during the actual statement, but I need it to check repeativly. I've thought of doing this in the repeativly execute section, but I'm not sure where to start if so. I do not know what to check for. I'll be playing with the code some more... if I don't come back... call for help. ;D

Ashen

The second parameter of PlayFlic sets how it can be skipped - you've currently got it set that only pressing Escape will skip them, so obviously pressing Space won't do anything. Does Escape work, or are they totally unskippable? I'm not sure if you can make a specific key (other than Escape) skip Flic animations.

You might want to make the whole thing a cutscene (StartCutscene()) to make it skippable as a block, rather than flic-by-flic, but again I don't know how you'd make it skippable by just the Space key.
I know what you're thinking ... Don't think that.

oraclekai

#2
I believe our solution lies in the StartCutscene() function! The flic files are not unskippable, but I have to press escape for every video file. We split the video and sound up into smaller portions to cut back on the file size as well as to make it easier to edit. Now, if I understand correctly, we will be able to cancel the StartCutscene() function any time.

Okay, I just tried to set it this way.

Code: ags
StartCutscene(eSkipAnyKey);
PlaySoundEx(1,3);
PlayFlic(1,0);
PlayFlic(2,0);
SetChannelVolume (3, 0);
PlayAmbientSound (1, 3, 255, 0, 0);
PlayFlic(3,0);
StopAmbientSound (1);
SetChannelVolume (3, 255);
PlayFlic(5,0);
PlayFlic(4,0);
PlayFlic(6,0);
PlaySoundEx(2,3);
PlayFlic(7,0);
EndCutscene();


This code doesn't allow me to skip ANY of the cutscenes, though I have the flic animations to not skip individually. When I run the game, this doesn't even let me skip the CutScene(). And if I set the PlayFlic to (x,1) it only skips individual flic files.

!EDIT!: Although I still havn't figured this out, I'm just going to use an AVI instead... I don't really want to, but the other stuff just seems to sketchy for just a rip of a scene.

SMF spam blocked by CleanTalk