Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
colltected_item_numbers=colltected_item_numbers+1
if colltected_item_numbers=number_of_collected_items_need then
play sound
other code...
end if
itemscar=itemscar+1
if colltected_item_numbers=number_of_collected_items_need then
play sound code
end if
Sub PlaySoundWin7(SoundFile, NumRepeat, ChannelNumber)
If ChannelNumber < 9 Then
'With VBScript it is currently not possible to interact with the 8 first audio channels.
MsgBox "The specified audio channel is invalid.", vbCritical, "Error"
Exit Sub
End If
If Action.IsComponentInstalled("NSPlay.NSPlayCtl.1") = False Then
MsgBox "Unable to find the media player component.", vbCritical, "Error"
Else
If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = false Then
AddComponent "NSPlay.NSPlayCtl.1", "MediaPlayer" + CStr(ChannelNumber)
End If
Component("MediaPlayer" + CStr(ChannelNumber)).Object.FileName = SoundFile
Component("MediaPlayer" + CStr(ChannelNumber)).Object.PlayCount = NumRepeat
Component("MediaPlayer" + CStr(ChannelNumber)).Object.Play
End If
End Sub
Sub StopSoundWin7(ChannelNumber)
If ChannelNumber < 9 Then
'With VBScript it is currently not possible to interact with the 8 first audio channels.
MsgBox "The specified audio channel is invalid.", vbCritical, "Error"
Exit Sub
End If
If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = true Then
Component("MediaPlayer" + CStr(ChannelNumber)).Object.Stop
End If
End Sub
itemscar=itemscar+1
if colltected_item_numbers=number_of_collected_items_need then
PlaySoundWin7(SoundFile, 1, 10)
end if
itemscar=itemscar+1
if itemscar=5 then
PlaySoundWin7(SoundFile, 1, 10)
end if
Return to Adventure Maker Technical Support and Bug Reports
Users browsing this forum: No registered users and 0 guests