Difference between revisions of "Play List Action"

From FSDeveloper Wiki
Jump to: navigation, search
m (External)
m
 
Line 1: Line 1:
 +
{{Infobox-Applicable-FSVersion
 +
| FSXI = false
 +
| FSXA = true
 +
| FSX = true
 +
| FS2004 = false
 +
| FS2002 = false
 +
| FS2000 = unknown
 +
| FS98 = unknown
 +
}}
 
{{:Transclusion-Missions-Oneline-Play List Action}}
 
{{:Transclusion-Missions-Oneline-Play List Action}}
 
{{:Transclusion-Missions-Overview-Play List Action}}
 
{{:Transclusion-Missions-Overview-Play List Action}}

Latest revision as of 15:05, 18 April 2008

Play List Action will play the specified music items on the adventure music track. Individual play list items can be set to a random position within the play list.

Play List Actions play a list of audio files, either serially, or randomly, as background audio.

Play List Actions -

Warning/Caveats

Some important points to note when implementing playlists.


Files

Supported Filetypes

WAV files are apparently the only type supported.

List known working formats.

Some formats of WAV files will not play correctly.

Microsoft ADPCM 11.025 kHz, 4 Bit, Mono, (hence in the example I've posted, the odd sounding thunder, & speeded up dialog on the second playlist).

PCM 22.050 kHz, 16 Bit, Mono


The following formats are not supported - MP3 WMA

Paths

If any files are incorrectly referenced, the mission will not load.

The soundfile must exist on the specified path.


These only work for audio files located in the path -

Microsoft Flight Simulator X\sound

or subfolders thereof.


They will also work for a path relative to that location.

e.g. ..\Missions\Some_Folder\Mission_Name\Sound\any_audio.wav

Naming Conventions

ENSURE you use an appropriate & unique name for your sound clip, otherwise you'll possibly overwrite someone else's clip.

i.e. Don't use song1.wav, song2.wav, etc.

Prefix the clip with your mission name.

e.g. MyRescueMission_song1.wav, MyRescueMission_song2.wav, etc


Suggest adding a common subfolder, and that we all adopt that as a common standard.

e.g. Microsoft Flight Simulator X\Sound\Mission_Playlists

And that you place your soundfiles in mission specific subfolders.

e.g. Microsoft Flight Simulator X\Sound\Mission_Playlists\MyRescueMission

In six months time, or whenever, a user may find themselves short on diskspace, and don't know which files to delete.

File Sizes

Ensure your soundfile is an appropriate format, (radio quality, as maximum), and of a smallish size.

Nobody wants to download 600MB of your favourite music.  :D

You can play a clip indefinitely by repeating it, using multiple calls in the playlist.

See example clips in Microsoft Flight Simulator X\Sound\UIMusic


Testing your playlists

If you fire a playlist,

then exit or reload the mission,

before the playlist is completed.

The interupted track & remaining playlist tracks will continue to play !


Sample Code

Plays two different short playlists, using sounds & UIMusic which already exist in your FSX.

A 5 second timer activates -

a) the first playlist.

b) a 60 second timer, which then fires the second playlist.

NB

For readability this code is laid out in order of firing, and will work as is.

If added to a mission, and then edited with the OPT, the OPT will re-sequence it.

On screen notices & timers are included for test purposes.

       <SimMission.TimerTrigger InstanceId="{A8498446-0335-4E76-BB37-82B9AEAD1A76}">
           <Descr>_Init_TTimer_S5</Descr>
           <StopTime>5.000</StopTime>
           <OnScreenTimer>True</OnScreenTimer>
           <Actions>
               <ObjectReference id="_Triggered_TTimer_S120_AA_On" InstanceId="{35CE0E66-F666-4E9C-8CCD-929C54BCE3C7}">
               </ObjectReference>
               <ObjectReference id="_First_PLAYLIST_DIALOG_AD" InstanceId="{D3BDAB41-B690-499F-B63D-1ECDAB56C1AA}">
               </ObjectReference>
               <ObjectReference id="_First_PLAYLIST_AP" InstanceId="{6DA689F9-67C1-49BD-AD95-3A633E428709}">
               </ObjectReference>
           </Actions>
       </SimMission.TimerTrigger>
       <SimMission.ObjectActivationAction InstanceId="{35CE0E66-F666-4E9C-8CCD-929C54BCE3C7}">
           <Descr>_Triggered_TTimer_S120_AA_On</Descr>
           <ObjectReferenceList>
               <ObjectReference id="_Triggered_TTimer_S60" InstanceId="{860011FB-F217-4FEF-BE94-C33C4F648AE9}">
               </ObjectReference>
           </ObjectReferenceList>
       </SimMission.ObjectActivationAction>
       <SimMission.DialogAction InstanceId="{D3BDAB41-B690-499F-B63D-1ECDAB56C1AA}">
           <Descr>_First_PLAYLIST_DIALOG_AD</Descr>
           <Text>5 second Timer activated _First_PLAYLIST_AP</Text>
       </SimMission.DialogAction>
       <SimMission.PlayListAction InstanceId="{6DA689F9-67C1-49BD-AD95-3A633E428709}">
           <Descr>_First_PLAYLIST_AP</Descr>
           <PlayListItem>
               <Descr>PlayListItem 1</Descr>
               <SoundFileName>MRSDAHL.wav</SoundFileName>
               <RandomizeInList>True</RandomizeInList>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 2</Descr>
               <SoundFileName>backcourse_marker.wav</SoundFileName>
               <RandomizeInList>True</RandomizeInList>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 3</Descr>
               <SoundFileName>UIMusic\FSX08.wav</SoundFileName>
           </PlayListItem>
       </SimMission.PlayListAction>



       <SimMission.TimerTrigger InstanceId="{860011FB-F217-4FEF-BE94-C33C4F648AE9}">
           <Descr>_Triggered_TTimer_S60</Descr>
           <StopTime>60.000</StopTime>
	    <Activated>False</Activated>
           <OnScreenTimer>True</OnScreenTimer>
           <Actions>
               <ObjectReference id="_Second_PLAYLIST_DIALOG_AD" InstanceId="{7808D1CE-FFDB-4727-A05E-093DB452DB0C}">
               </ObjectReference>
               <ObjectReference id="_Second_PLAYLIST_AP" InstanceId="{E768BFC8-F32E-450D-B095-C23F819AFD31}">
               </ObjectReference>
           </Actions>
       </SimMission.TimerTrigger>
       <SimMission.DialogAction InstanceId="{7808D1CE-FFDB-4727-A05E-093DB452DB0C}">
           <Descr>_Second_PLAYLIST_DIALOG_AD</Descr>
           <Text>60 second Timer activated _Second_PLAYLIST_AP</Text>
       </SimMission.DialogAction>
       <SimMission.PlayListAction InstanceId="{E768BFC8-F32E-450D-B095-C23F819AFD31}">
           <Descr>_Second_PLAYLIST_AP</Descr>
           <PlayListItem>
               <Descr>PlayListItem 1</Descr>
               <SoundFileName>thunder\xthun4c.wav</SoundFileName>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 2</Descr>
               <SoundFileName>lessons\atpding39.wav</SoundFileName>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 3</Descr>
               <SoundFileName>UIMusic\FSX03.wav</SoundFileName>
           </PlayListItem>
       </SimMission.PlayListAction>


Related

Internal

Actions

Generic Action Properties are integral, and applicable, to all action types, (except where noted).

Activate Waypoints Action provides one or more AI object with a new list of waypoints. Waypoints are essential for the movement of certain AI objects.

Adjust Payload Action is used to set, or add to, the weight on a payload station.

Attach Droppable Payload Action is used to change the payload that gets dropped when the user presses a key configured to drop the payload.

Attach Effect Action attaches a single special effect (such as smoke, fire, contrail etc.) to one or more objects.

Change Object Type Action changes the object the user is in. For example, it can be used to change from one type of aircraft to another.

Count Action will add the value of the Count property to the Counter value in the given list of triggers (which should all be Counter triggers). Counter triggers will fire when a certain specified count is reached.

Custom Action is used to enable communications between a mission and a SimConnect client application.

Dialog Action is used to add speech to be rendered over the audio system, and/or text to be displayed on the screen.

Failure Action is used to change the behavior of one of the aircraft's systems.

Goal Resolution Action is used to set whether goals have been completed or not.

Grant Reward Action rewards the user with a single reward, to be placed in their Pilot Records.

Object Activation Actions will change the state of most different types of object, Triggers, AI Objects, Scenery Objects and some Mission Objects. Do not use it for a Point Of Interest.

One Shot Sound Action renders a single wave file. Use this for sound effects rather than dialog (use the Dialog Action for speech audio).

Play Animation Action will initiate an animation sequence on one or more objects.

Play List Action will play the specified music items on the adventure music track. Individual play list items can be set to a random position within the play list.

Point Of Interest Activation Action will change the state of one or more Point Of Interest objects.

Random Action is used to initiate one randomly selected action from a list of possible actions.

ResetTimer Action is used to set the current time of one or more timers back to their start times.

Rumble Action is used to initiate rumble in the Universal Controller (typically an XBox controller).

Spawn Action will create all the new objects (including AI aircraft, scenery, actions and triggers) specified in a Spawn List object.

Timer Adjust Action adds the DeltaTime property value to the timer trigger's internal clock.

Link - Description

External

If you haven't found what you're looking for here, then we'd recommend, (in order of preference) -

  • AVSIM - Mission downloads (newest first).

Site page title - Description

Reference

'Reference' documents specifically related.

Link - Description