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

Sound

Postby mercedes » Tue Dec 09, 2008 8:17 am

Hi there...

I'm not sure if i've asked this before or if it's been asked...I looked around..

anyhow..is there a way to make sound appear randomly..or every few seconds..I don't want it to loop, cause its a crow...and that could get annoying..lol..but I do want it to play every 5-6 seconds or so..



Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue Dec 09, 2008 8:49 am

Just create a random loop:

Code: Select all
Sub randomcrow
randomize
rndnum=int(rnd*30)
if rndnum=5 then
playsound "crow.mp3"
end if
end sub

Action.CreateTimedEvent 1, "randomcrow", True



The bigger the number by which rnd is multiplied, the smaller the chances to get the sound.
Remember to add the playsound code
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Dec 09, 2008 8:53 am

Ok..Thanks..i should have mentioned..sorry..

I wan't this to play when frame loads..sorry forgot to mention that..Not when the hotspot is clicked..which is why i gathered u put 5..

Is an animation i have in the frame of a crow i made..and one i have also in another frame...Juhu made for me..These hotspots are not being clicked..

There are 2 sound i would like to play with...One plays..then the other..after a few seconds..the first one plays again..

Thanks Kiddo..~:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue Dec 09, 2008 9:56 am

5 is just a random number I picked, nothing more.

Well, just modify the code to fit...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Dec 09, 2008 1:45 pm

ya but this code is so u put in a hotspot...I will mess around with it..so hopefully it can be put in the Frames Advanced...would be cool if this could be pulled off...lol

Thanks anyways all the same...:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue Dec 09, 2008 2:11 pm

mercedes wrote:ya but this code is so u put in a hotspot...I will mess around with it..so hopefully it can be put in the Frames Advanced...would be cool if this could be pulled off...lol

Thanks anyways all the same...:D


There's no difference between using this on a hotspot or on the frame's advanced. It's the same...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Dec 09, 2008 2:57 pm

Oh ok...I looked at it quickly..when i saw 5..I thought 5 clicks..:P


THanks Lyberodoggy..I will try this tonight..let u know...:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby ZeornWarlock » Fri Dec 12, 2008 9:03 am

mercedes, you beat me to it! I was just about to ask the same kind of code. :P

This will be quite useful. :)

Thanks.

ZW.
You have to make some to understand some.
User avatar
ZeornWarlock
Expert Member
 
Posts: 347
Joined: Tue Jun 05, 2007 12:52 am
Location: In front of the monitor.

Postby mercedes » Sat Dec 20, 2008 1:20 pm

Here is the fixed version...[THanks Lyberodoggy..]

Code: Select all
Sub randomcrow
randomize
rndnum = int(RND * 3)+1
If rndnum=1 Then
PlaySound GetPath(2) +  "crow.mp3", False
End if
If rndnum=2 Then
PlaySound GetPath(2) + "caw.mp3", False
End If
If rndnum=3 Then
PlaySound GetPath(2) + "crowcaw.mp3", False
End If
End Sub



Put this in the frames advanced..

Code: Select all
Action.CreateTimedEvent 1, "randomcrow", True


Create a variable called "rndnum"

and thats it..i have random sound...yayyy..!~ Thanks Kiddo..~ :D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Sat Dec 20, 2008 2:09 pm

Hehe, no prob.
BTW I 've got something coming soon...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests