On 1/18/07, Troman <[EMAIL PROTECTED]> wrote:
I had some musings about the way this should work. Playlist script interface
will be most used by scriptors I assume. I see two main occasions when such
an interface might be used:

1) when it is time to interrupt any background music that might be played
and kick in some moody piece to create atmosphere, like it is usually done
in campaigns.

2) when someone wants to attach a custom playlist to his map, the way it is
done with Unreal Tournament maps for example.

Agreed.

As for the implementation, looks like wz uses 'tracks' to store songs. Track
2 corresponds to menu, track 1 to the in-game music.

I do not think we should let that get in the way of a decent API. We
can change the way Warzone stores songs, if necessary.

When modder wants his custom playlist to be played when someone is using his
map he either loads all songs manually to the user track using scripts, like

playlistAddUserSong("mySong1.ogg");
playlistAddUserSong("mySong2.ogg");

Sounds good.

Since this is not the most convenient approach it might be a better idea to
load playlist from an external playlist file, which will come with the mod

Well, to me the in-script version above seems more convenient than
adding yet another file, since the number of songs will probably never
be high.

In case of a map with custom playlist it is simple, just call something like
playlistPlayUserTrack(); from within the scripts (or again we can make wz
start playing user track automatically if a map comes with a user playlist)
for wz to switch from player playlist to the custom map playlist.

I think starting the script-supplied playlist automatically seems like
the simpler and better way.

In cases when some music must kick in from time to time depending on some
in-game conditions it is a bit more complicated.

There are probably two different needs here:
1) Scripter wants to play a short song to set the theme of some event,
then resume the playlist as normal. The new song should then not be in
the playlist afterwards.
2) Scripter wants to change the whole theme of a level by playing a
new song or songs throughout the remaining time (or until it changes
again). So we need a way to reset the playlist; then the scripter can
add the new songs.

So how about an API like this:
playlistReset() -- deletes existing playlist (eg to remove game
supplied playlist)
playlistAdd(song) -- adds song to top of playlist (eg to add to game's
supplied playlist)
playlistInterruptWith(song) -- play a song once, then resume playing
playlist (eg for event)

I'm not sure if we really need an additional 'user track', but it has
following advantages: songs defined by player and modder are present at the
same time and are kept in separate places. While playing player playlist
(sorry for the tongue twister) wz will not accidentally start playing a song
which might be reserved for a special occasion by the modder.
On startup wz can switch to the 'user track' to play songs defined by modder
while still leaving the player ability to switch back to his own playlist.

I did not quite understand the above.

 - Per

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to