thank you, it was a good start, but i modified it a bit:
I have a timer named MusicTimer set to 1000ms, that is disabled and will be enabled when the wizard mode starts.
Dim countercounter = 0Sub MusicTimer_Timercounter = (counter + 1000)Select Case counterCase 10000' Do something at 10 secondslight032.State = 2Case 20000' Do something at 20 secondslight032.State = 0Case 30000' Stop the timer at 30 secondsMusicTimer.enabled = 0counter = 0scoretext.text = "timer stopped" 'for testing purposesCase Else' Do nothing for other casesEnd SelectEnd Sub
This works, but maybe somebody can tell me if this isn't the best approach. By using the select case method i find it easier to specify exactly when i want events to happen. I am trying to create a light, flasher, and DOF show that will sync with the music for the final wizard mode. also by using Milliseconds in the script, i can fine tune the timing better
I use Select Case extensively for the timing of events.
It might help you get a 'mental image' of the logic if you just use 1 as your counter increment. There's no need to use 1,000 as it's not about milliseconds, and it may end up confusing you.
This way, the Timer is only called 6 times in 10 minutes (instead of 600 times)
Also, you can stop whatever music is playing with this:
StopSound CurrentMusic
You can select a particular song number (x) with:
CurrentMusicNum = x-1 ' (x gets incremented in the Music sub, so I subtract 1 before calling)
MusicTimer_Timer
Edited by Sir Random, 14 November 2023 - 02:44 PM.




Top








are all trademarks of VPFORUMS.