You don't use "Start Delay" in your code, just the interval time which should be a numeric value, just like George has said. As the manual states...
PlayMusic( <Integer> Channel, <String> MusicName, <Boolean> Repeat, <Float> Volume, <Integer> StartDelay )
Here's a sample code
Code:
PlayMusic 6, "_before_match",, 1
6 is the channel number (FP has 8 channels total) that I use for this sound. I use different channel numbers, 2 is my background music channel, 5 is for my Engine music (match/tilt/game start etc) 6 is my basic electronic music.
"_before_match" is the name of the music file, as loaded in the music editor
The two commas is the times I want that sound to repeat. Leaving it blank is the same as 0ff so it just plays the music once. If I wanted to play the sound multiple times, or just keep repeating, then the code would be
Code:
PlayMusic 6, "_before_match", TRUE, 1
NOTE you have to add the two commas here, even though Repeat is automatically set to Off if there is no value between them, you still have to tell FP that first before you define the next value, which is Volume.
The 1 is the volume level, which is set to it's maximum volume. ( 0.0 (totally silent) and 1.0 (default) (full volume))
Now StartDelay is a number, in milliseconds (1000 =1 second) so if I want a delay time of 5 seconds, my code would be this:
Code:
PlayMusic 6, "_before_match",, 1,5000
If I want a delay of 2.25 seconds, then my code is
Code:
PlayMusic 6, "_before_match",, 1,2250
If you have no values for Repeat, Volume, and StartDelay, then you do not need to define them in the script, as FP will consider the repeat and StartDelay values to be zero, and the volume set to maximum volume (1). The only code you have to do is the channel number and the name of the sound file.
Code:
PlayMusic 6, "game_start"
And Finally, this is the code I use for my engine for a single background music
Code:
PlayMusic 2, "bg", TRUE,1,50
This uses Channel 2 to play the music, it uses the "bg" music file, it repeats over and over unless I stop it or fade it, it's set to the maximum volume, and it has a delay of 50 milliseconds before it will start every time you call it within your code. (It just sounds better that way)
Hope this helps, and I explained it properly. Unfortunately, the actual manual is full of errors and the examples are very basic, and doesn't go into enough detail in some places.
_________________
_____________________________________
Latest projects and rants at
My Facebook Page_____________________________________
Latest Project: FPx Template Engine