You can add a video to play when a switch is pressed by editing the switch's fpi script and adding the following into the script:
video=videobank\<path\video_file_name>
For example, let's look at the script in the scriptbank called
switch.fpi.
;Artificial Intelligence Script
;Header
desc = Switch Activate (toggle on and off)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=50:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=50,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,plrusingaction=0:state=2
:state=2,plrdistwithin=50,plrusingaction=1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10
;End of Script
To understand how the script and switch work, we need to know where the action occurs when the switch is pulled. Look at this line:
:state=10,plrdistwithin=50,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
This line shows when the player walks up to the switch and "presses Enter to use it" (plrusingaction=1), then it activates the If Used field (usually a door) and continues to state 1, etc.
To play a video when they pull the switch, you can insert the video= line in the following way:
:state=10,plrdistwithin=50,plrusingaction=1:video=videobank\your_video_file_name_extension,state=1,plrsound=$0,activateifused=1,alttexture=1
Or you can put the video= line in the state=2 line:
:state=2,plrdistwithin=50,plrusingaction=1:video=videobank\your_video_file_name_extension,state=3,plrsound=$1,activateifused=0,alttexture=0
It depends on how you want to do it, but that is how to do it effectively.
For future reference, you might want to look at some of the switch scripts and learn how the commands fit and what they do. Such as the
plrusingaction=1,
activateifused=1, etc. This will help you get an idea of how the scripts work. Sometimes it is a trial and error when making a script. You may have one where commands are in the wrong place, either a comma instead of a colon, etc.
Regarding the video=command I used above, replace your_video_file_name_extension with something like this:
videobank\ww2_bf\intro_video.wmv
or
videobank\ww2_bf\cutscene_video01.avi
Hopefully this makes some sense and helps get you into the right track. I've attached a pdf called FPI Scripting Language, which lists the various commands,etc of scripting. Study it, learn it. It will help you.
- BlackFox
RPG Mod- Create a world full of adventure