Play webm during attack animation

Aerisetta

Active member
I'm trying to get a webm video to play during an attack (like a super move cinematic). Here's what I wrote

anim freespecial30
@script
if(frame==5){
void self = getlocalvar("self");

playwebm (data/scenes/fjtest.webm, 0)
}
@end_script
fastattack 1
delay 6
offset 145 300
bbox 86 2 116 308
sound data/sounds/punch_.wav
frame data/chars/aerisetta/finisher01.png
frame data/chars/aerisetta/finisher02.png
frame data/chars/aerisetta/finisher03.png
frame data/chars/aerisetta/finisher04.png
frame data/chars/aerisetta/finisher05.png
frame data/chars/aerisetta/finisher06.png

The error comes back as

Script error: data/chars/aerisetta/aerisetta_Test.txt, line 536: Invalid function call or expression '}' (in production 'postfix_expr2')

}
^



Script error: data/chars/aerisetta/aerisetta_Test.txt, line 1856: Unknown error '' (in production 'opt_else')


^



Script error: data/chars/aerisetta/aerisetta_Test.txt, line 1856: Unknown error '' (in production 'stmt_list')


^


Script compile error in 'Aerisetta_Test': data line 535, column 14

********** An Error Occurred **********
* Shutting Down *

Please advise if this is how it can be used and what I'm doing wrong.
 
You're missing a closing semicolon on your playwebm() function, and the path parameter is a string.

C:
@script
 if(frame==5){
   void self = getlocalvar("self");
   playwebm ("data/scenes/fjtest.webm", 0);
 }
@end_script
 
Hihi

I have 2 follow up questions regarding WebM during gameplay.

1. WebM and Stage BGM
I would like to play a webm during the game, something like a supermove cinematic. I am now able to do that.

However, by default the background music will completely count out once that happens.

I think this will need a script, but can anyone help me find a solution so that the stage's normal background music can continue to play during Webm? Based on difficulty of implementation I am okay with several options, in order of preference

a. stage BGM stop during Webm, resume stage BGM from where it stopped after Webm is finished.
b. stage BGM never stops stays playing during Webm is playing.
c. stage BGM stop during Webm, resume stage BGM after Webm is finished, the BGM can start from the beginning.

2. WebM on Repeat
I would like to keep the webM video playing on a repeat loop until the player presses a button to skip the scene.

Any help would be appreciated, Thank you!
 
Someone suggested to me that I could render Webm without sound, and that way the game's background music will continue to play. However I have not been able to find any information on how to render the Webm without sound. Anyone have clues?
 
playwebm(path, int noskip)

  • Play a webm file as a cut scene, you can call it in game.
  • path, the gif file path, like first parameter of command animation in scene txt.
  • noskip, when set to 1, you can’t press button to skip it.
  • Notice: path is required. All other parameters are optional, and default value is 0.
  • Notice: a webm is played ONLY if the device has the webm support.

pausemusic(toggle)

  • toggle: 1 or 0. 1 to pause music

@Aerisetta both found on the legacy manual Legacy Manual – OpenBOR Wiki
 
@Aerisetta,

Just updated my answer; I saw another issue. You didn't enclose the path string in quotes.

Also, in general, I would advise you encapsulate stuff like this into a function, it's the very first item in Optimizing Scripts. You generally want to stay away from using inline code unless it's the only way to solve a problem.

DC
Can you please explain what "inline code" is?
I was using the existing game and they did exact the same as Aerisetta to a lot of files.
If you would, an example would be better :-)
Thank you
 
Can you please explain what "inline code" is?
I was using the existing game and they did exact the same as Aerisetta to a lot of files.
If you would, an example would be better :)
Thank you

Inline code is exactly what it says. When you stick code directly into model animations using @script and @end_script tags. The link I provided explains it in detail.

DC
 
Back
Top Bottom