player turn music on / off button

This forum is meant for requesting technical support or reporting bugs.

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

player turn music on / off button

Postby Lazypookzz » Sun Sep 06, 2009 3:46 pm

I don't want to bother others by asking to much, but I am searching to long now, can't figure it out, so I do ask....

I want on every frame a simple button so the player can turn of / on the background music.
I don't want them to turn the other sounds off.
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby Candle » Sun Sep 06, 2009 4:10 pm

I think EZTalk would be help with that.
http://www.adventuremaker.com/plugins.htm
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 Lazypookzz » Sun Sep 06, 2009 4:15 pm

Thanks for your answer Candle

I already tried the EZTalk demo, and there is a lot in it, but just can't figure it out if I only want a hotspot which turns of / on the music.. :oops:
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby reneuend » Sun Sep 06, 2009 11:49 pm

I'll show in a couple hours when I can get back to this. You can use a modified PlaySound routine to play the music on a specific channel. The other sounds would be on different channels from the music. Then when you wanted to stop the music, you would use the StopSound routine for the music channel.

Like I said, I'll show you an example in a couple hours when I have more time!
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lyberodoggy » Mon Sep 07, 2009 12:09 am

User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby reneuend » Mon Sep 07, 2009 2:17 am

Good find Lyberodoggy.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lazypookzz » Mon Sep 07, 2009 8:31 am

Thanks Reneuend & Lyberodoggy,

I did see that post too, I have a feeling I saw every post lol.


I tried it:

Used this in global procedures:

Code: Select all
Sub PlaySound(FileName, Repeat)
  Action.LoadControl MediaPlayerObject(2)
  MediaPlayerObject(2).FileName = FileName
  If Repeat = True Then
    MediaPlayerObject(2).PlayCount = 0
  Else
    MediaPlayerObject(2).PlayCount = 1
  End If
  MediaPlayerObject(2).Play
End Sub

Sub StopSound()
  MediaPlayerObject(2).Stop
  MediaPlayerObject(2).FileName = ""
  Action.UnloadControl MediaPlayerObject(2)
End Sub



Used this in the frame properties advanced

Code: Select all
Playsound GetPath (2) + "blub.mp3", False


Used in the hotspot advanced
Code: Select all
StopSound


When I click this hotspot, it works fine, the music stops.

When I click this hotspot again, it gives an error message.



What I want is when you click the hotspot again the music will continue playing
Attachments
4.jpg
errormessage (this methode isn't supported by this object Mediaplayer object)
4.jpg (22.08 KiB) Viewed 2822 times
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby Lyberodoggy » Mon Sep 07, 2009 10:25 am

Check the stopsound procedure. if the mediaplayerobject index isn't 2 then change it to 2
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Sep 08, 2009 4:38 am

It will give u an error message...if u press it twice in a row...which would make sense..

The code for the music to start playing appears when u enter the frame..Once inside the frame, and you hit "Stop",--then u try to hit ''Stop'' again...well the player hasn't reloaded..* Nothing to stop*-no sound..:)

But it shouldn't give u the error message when u come back to the frame..? Are you hitting it twice in a row, so the player has an option to "re-start" the sound..?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lazypookzz » Tue Sep 08, 2009 9:12 am

Hello Mercedes,

No it doesn't give the error message when I come back to the frame. The music starts playing again so you can hit 'stop' again :lol:

you see this in so many games, a little button to turn the sound on or off. I like my background music but it can annoy someone else.
Can't imagine someone here did not use this?


While i am writing i thought of something simple..2 hotspots on top of each other and with variables you only see on or of..
And it works. I only have to make sure that I only can visit the first frame once (where the music is already playing).

I am sure you can do this much better in ShadowHunter's plugin, but I can't figure that out for now.
I have enough work on the artwork, so don't have the time to know much of Vbscript.

Thanks for your time!

edit: I was too fast. it doesn't work properly when I go to another frame. Maybe I will figure it out later.
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby mercedes » Wed Sep 09, 2009 8:44 am

Hi there...Ok this is what you have to do...This worked for me..

I have 2 Hotspots;

I have 1 variable; Music_1

In the Frame's Properties I have this;
Code: Select all
Playsound GetPath (2) + "bachos2.mid", False


The 2 Hotspots;

Hotspot(1) has the Colored_HandPickDisabled.ico
Hotspot(2) has the Colored_HandPick.ico

They are right on top of each other~

In Colored_HandPickDisabled.ico [Hotspot(1)]
Under Variable TAB
Music_1 must become = 1
In the AdvancedTAB
Code: Select all
StopSound
Action.LoadAPicture Hotspot(1),""

This way the disabled hand goes away when you click it..[it comes back after]

*****************************************
In the Colored_HandPick.ico [Hotspot(2)]
Bottom of Variable TAB
Hotspot must not be enabled till ''Music_1" is =1
Top Portion of the Variable TAB
Variables of the value which must be inverted--ADD
Music_1

In the Advanced TAB
Code: Select all
Playsound GetPath (2) + "bachos2.mid", False
Action.LoadAPicture Hotspot(1),"Colored_HandPickDisabled.ico"


And Thats it...:)

I Hope this helps..:) Only 1 Variable which gets inverted...and 2 Hotspots..I used these pictures cause it looks like one is disabled, and one is enabled..~ If you don't quite get what i've done here..then test it with those pictures and u will see what I mean..~:)

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

Postby Lazypookzz » Wed Sep 09, 2009 12:22 pm

Amazing Mercedes, you're the greatest :D

I tried it and it works like a charm!

I'm missing some emoticons here...I would use a dancing emoticon right now lol.

:mrgreen: thankyou thankyou thankyou :mrgreen:
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby mercedes » Wed Sep 09, 2009 3:36 pm

Np...:D Glad it got figured out..~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Wed Sep 09, 2009 4:26 pm

Image Image Image Image Image
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lazypookzz » Wed Sep 09, 2009 4:57 pm

Image
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby mercedes » Wed Sep 09, 2009 5:44 pm

http://www.adventuremaker.com/phpBB2/viewtopic.php?t=4359&highlight=emoticons

Here is a thread with a bunch of them in it...for future reference..if u like..:D..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lazypookzz » Wed Sep 09, 2009 5:50 pm

Do you know everything??

Image
User avatar
Lazypookzz
Frequent Poster
 
Posts: 135
Joined: Wed Jun 17, 2009 2:25 pm
Location: below sea level

Postby juhuwoorps » Wed Sep 09, 2009 6:15 pm

It seems so :D
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron