Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » FAQ & Help




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How does the StartDelay variable work?
 Post Posted: Sun Apr 01, 2018 3:30 pm 
Offline
User avatar

Joined: Thu Jun 16, 2016 2:20 pm
Posts: 132
Location: a cave
I don't get it. How does the StartDelay variable work?

Playmusic 4,"music", true, StartDelay 10000

only throws me ScriptErrors. I tried with : , nothing worked (I want to delay the playing of a track because another track has to play first.) Any help?

_________________
life takes a lot of balls


Top 
 Profile  
 
 Post subject: Re: How does the StartDelay variable work?
 Post Posted: Sun Apr 01, 2018 5:04 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1698
Location: Arkansas, USA
gibsmedat wrote:
I don't get it. How does the StartDelay variable work?

Playmusic 4,"music", true, StartDelay 10000

only throws me ScriptErrors. I tried with : , nothing worked (I want to delay the playing of a track because another track has to play first.) Any help?


Gibs,

I've not used this function before but after reading the help file, I think it needs to be set up like this:

Playmusic 4,"music", true, 1.0, 10000

The 1.0 is the volume and 10000 is the delay in milliseconds. 10000 is equal to 10 seconds. The volume needs to be between 0 and 1.0. You often see this much of the code in script:

Playmusic 4,"music", true

it means it is using the default volume which is the max (1.0) with no delay.

George


Top 
 Profile  
 
 Post subject: Re: How does the StartDelay variable work?
 Post Posted: Mon Apr 02, 2018 5:31 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1698
Location: Arkansas, USA
Gibs,

I was thinking it might be difficult to get the delay time for your audio adjusted to start when you want it. I was just thinking, you might want to join the 2 audio files together. Then you wouldn't need to set a delay time.

George


Top 
 Profile  
 
 Post subject: Re: How does the StartDelay variable work?
 Post Posted: Mon Apr 02, 2018 8:27 pm 
Offline

Joined: Tue May 01, 2012 11:13 pm
Posts: 330
Location: Abbotsford
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


Top 
 Profile  
 
 Post subject: Re: How does the StartDelay variable work?
 Post Posted: Tue Apr 03, 2018 3:41 am 
Offline
User avatar

Joined: Mon Sep 21, 2015 10:33 am
Posts: 116
Location: UK - Bridgnorth (Shropshire)
blue wrote:
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.


Blue,

I know that I'm not involved in this thread.... but - This explains and helps a lot.... thank you :)...

Gin


Top 
 Profile  
 
 Post subject: Re: How does the StartDelay variable work?
 Post Posted: Tue Apr 03, 2018 7:22 am 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1698
Location: Arkansas, USA
I have never understood the purpose of channels. It seems to me the music either plays or it doesn't. I guess I am locked into the paradigm of stereo or the number of channels in a home theater system. I suppose it is not like that.

George


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 6 posts ] 

Board index » Future Pinball » FAQ & Help


Who is online

Users browsing this forum: No registered users and 11 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: