Hey guys!
I've been working on a new script, based on the script from one of the twitch streaming videos the developers posted, and somehow I broke it XD
What I'm trying to do is have a series of audio zones. they're custom musicplaytrack1-2 scripts, and I'm not sure they're the best for the job.
Basically what I want is to have a couple small sound zones or trigger zones, where there is one track in music.lua which plays as the standard soundtrack piece. When the player enters a sound zone with the script, the music transitions to a different track, and stops playing the original. When the player leaves the sound zone, the track transitions back to the default track, and the second track stops.
I'd like to have a couple of these available, so I can use different music for different parts of the game. The problem is, the script is broken and gives me an error (probably because I meddled with it), and I'm not sure its the right way to go- this game will have multiple levels, each with its own base soundtrack piece and different sets of sound zone tracks. That would make music.lua useless, since the script only allows for a total of 4 music tracks in an entire game, and it doesn't loop them.
What is the best system for the use of a variety of music tracks in different locations and zones of a game? Could you help me come up with a proper script that would solve my problem? Thanks!
Here is the script I set up (and broke):
musicplaytrack2custom_var = 1
function musicplaytrack2custom_init()
end
function musicplaytrack2custom_main(e)
if g_Entity[e]['plrinzone']==1 then
if musicplaytrack2custom_var==1 then
musicplaytrack2custom_var = 2
music_play(2,1500)
end
end
else
if musicplaytrack2custom_var==2 then
musicplaytrack2custom_var = 1
music_play(1,1500)
end
end
end