Timer for sound.

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Timer for sound.

Postby Aiden » Fri Sep 28, 2007 9:59 am

Wah, i can't find the code for play sound. :(
Some one give me the code please for play sound after 1 min is passed...
Aiden
Member
 
Posts: 20
Joined: Fri Jun 08, 2007 9:30 am

Postby Candle » Fri Sep 28, 2007 11:42 am

Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Mystery » Fri Sep 28, 2007 1:22 pm

Aiden, look at this thread about how to play video and sound with VBScript:
http://www.adventuremaker.com/phpBB2/vi ... php?t=1405

And for timed events here (scroll down to CreateTimedEvent):
http://www.adventuremaker.com/help/vbsc ... erence.htm

Good luck :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Aiden » Fri Sep 28, 2007 2:14 pm

Mystery wrote:Aiden, look at this thread about how to play video and sound with VBScript:
http://www.adventuremaker.com/phpBB2/vi ... php?t=1405

And for timed events here (scroll down to CreateTimedEvent):
http://www.adventuremaker.com/help/vbsc ... erence.htm

Good luck :)


Thanks, exactly what i need! :)
Aiden
Member
 
Posts: 20
Joined: Fri Jun 08, 2007 9:30 am

Postby Aiden » Fri Sep 28, 2007 5:37 pm

Mystery, one thing i can't undarstand.

For example your code (for hotspot) + PlaySound
Code: Select all
If Lock1+Lock2+Lock3+Lock4 = 4 Then
PlaySound GetPath(2) + "sound.mp3", False
Action.GoToFrame "lock_near01", 1, 1
End If


Work exelent!

But code for "Frame Properties"

Code: Select all
Action.CreateTimedEvent 4 , "PlaySound GetPath(2) + "sound.mp3", False


Doesn't work!
Help Mystery! I want to play sound after 4 sec. *after frame appear*, or (better) play sound after player click on hotspot!
Aiden
Member
 
Posts: 20
Joined: Fri Jun 08, 2007 9:30 am

Postby Mystery » Fri Sep 28, 2007 7:16 pm

Hmmm, first I thought it had to do with the inequality of your quote tags in the code above, but I've tried different things, and I haven't been able to combine the commands for CreateTimedEvent and PlaySound :(
PlaySound alone works in the Frame properties, but not together with the timed event command.

EDIT
It seems that the PlaySound command can just be used as it is, and not combined. I couldn't even combine it with something like
if variable=1 then PlaySound....

I think that either GM or ShadowHunter might be able to help you with that.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Aiden » Sat Sep 29, 2007 12:49 pm

This is strange. I think "play sound timer" may be a good for mystic game.
For example player click on hotspot and then after 1 minute has passed hear scream sound. This path may inspire "casual effect"!
Aiden
Member
 
Posts: 20
Joined: Fri Jun 08, 2007 9:30 am

Postby ShadowHunter » Sat Sep 29, 2007 7:36 pm

Hi,

In the timed event refer to a subroutine that plays the sound. That should work :D

Good luck,

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Sat Sep 29, 2007 7:58 pm

Yes, it works :)
Thank you ShadowHunter! :D
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Aiden » Sat Sep 29, 2007 8:23 pm

Mystery wrote:Yes, it works :)
Thank you ShadowHunter! :D


What work? :? What ShadowHuntar sayd? :shock: :)
Give me a code please!!! :) :) :)
Aiden
Member
 
Posts: 20
Joined: Fri Jun 08, 2007 9:30 am

Postby Mystery » Sat Sep 29, 2007 8:27 pm

Hehe, it's written in Advanced ShadowHunter-ish Language :wink: :lol:

It simply means:

Enter this into the VBS Procedures (where you've put the subroutine to play music with VBScript):

Code: Select all
Sub MySound
  PlaySound GetPath(2) + "Filename.mp3", False
End Sub


Add this code to the Advanced Tab of the Frame Properties of your opened suitcase/chest:
Code: Select all
Action.CreateTimedEvent 4.5 , "MySound", False


*Whereas you can replace "MySound" by another name for it.

Good luck! :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby ShadowHunter » Sat Sep 29, 2007 10:47 pm

Hi,

Thanks for explaining in more detail Mystery... happy to have you as mod on the team :D

Good luck with your project Aiden.

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Mystery » Sat Sep 29, 2007 11:31 pm

Thank you ShadowHunter :D

I'm trying to catch up to be able to translate your ideas and solutions to beginners ;)
But I rely heavily on your huge knowledge, so it's great to have you around, too ! :D
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests