AUDIO change..

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

AUDIO change..

Postby mercedes » Sat May 10, 2008 4:03 pm

Hi there..

I have text box..on a frame..in the frame propertes i have the load control box..textbox.

On the frame itself I have a hotspot with the word OK. In the hotspot properties of OK is the answer, and go to frame if the answer is correct..also message.."password seems to be wrong" if wrong.

I want to do this..

I want to have two hotspots on top of each other..2 OK'S..1 OK has one noise so that if they get it right..and go to frame...it has a positive sound..

I want the other OK hotspot to have a negative sound..password is wrong sound.. and also display password is wrong..as opposed to the other one saying it.

I can't seem to do this with the script in the OK hotspot..

Normally i would just set the one hotspot to do nothing..but make noise..and not go anywhere..and the one underneath it..i would have it so it had a positive sound and then go to another frame..And I would do this with a variable..

Create variable password_correct.


The word OK with positive sound wouldn;'t be visible until password_correct becomes 1.

i can't seem todo this with script in the box with variables at the same time..unless i'm doing it wrong..?

any ideas..Not sure if im making myself clear..

I want two hotspots on top of each other..with different sounds..one go to a frame and another do nothing..but with script in the advanced..is not working for me
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Sun May 11, 2008 11:54 am

As far as I can judge - if I have understood you correctly - you don't need 2 hotspots on top of each other.

Just use the technique from the tutorial and change it according to your needs
http://www.adventuremaker.com/phpBB2/vi ... php?t=3365

You can use the technique to play sound from VBScript.
Add the following code to the "VBScript Global Procedures" (no need to change anything, just copy-paste it):

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


Then import the both sounds (positive and negative) to your External Folder.

And the code in the Hotspot Properties of your "OK" word would then look something like this:

Code: Select all
If TextBoxObject(1).Text <> "Your_Password" Then
   PlaySound GetPath(2) + "Name_of_negative_sound.mp3", False
Else
   PlaySound GetPath(2) + "Name_of_positive_sound.mp3", False
   Action.GoToFrame "FrameName"
End If
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon May 12, 2008 3:00 am

Why isn't this working..
where do i put the first code..the one i copy and paste..in the procedures in the same box..where it says "procedures and variables".the same box i put the actual code in.. the OK box? Global procedures there..?

First error i got was "Playsound" something about that ..

When u say External Folder, you mean by just having it in the project's folder right..?..

here's whats in there..

Code: Select all
If TextBoxObject(2).Text <> "dozens" Then
Message "The password seems to be wrong."
Else
Action.GoToFrame "New_3_B"
End If
If TextBoxObject(2).Text <> "dozens" Then
   PlaySound GetPath(2) + "Double.mp3", False
Else
   PlaySound GetPath(2) + "Doneech.mp3", False
   Action.GoToFrame "New_3_B"
End If



Many thanks..for you help and response..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Mon May 12, 2008 7:20 am

You just copy-paste the script for playing sound to the "VBS Procedures" (not to the Hotspot Properties).


Copy the sound files into the External Folder of your AM Project (where it says "External Files").


Your code for the Hotspot Properties seems to have things double in there...
Why don't you just use the second part?

Code: Select all
If TextBoxObject(2).Text <> "dozens" Then
   PlaySound GetPath(2) + "Double.mp3", False
Else
   PlaySound GetPath(2) + "Doneech.mp3", False
   Action.GoToFrame "New_3_B"
End If


If you still get an error, please check if the spelling of the sound names, and the file extension are correct.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon May 12, 2008 7:29 am

hi there..

I have double things in there cause you guided me in your answer to follow it first [link] then add the code...and i had it in there already from before..is why it's still in there..also..so i just left it in there..

This is what its in there now..

I put the first code in the vbs procedure [link] in the menu

then added code to the hotspot of handle.

Code: Select all
If TextBoxObject(2).Text <> "dozens" Then
   PlaySound GetPath(2) + "Double.mp3", False
Else
   PlaySound GetPath(2) + "Doneech.mp3", False
   Action.GoToFrame "New_3_B"
End If


As for external folder..wher is it exactly..im assuming you mean the folder i go to when i add any sound which is sound files folder of project..

is this what u mean

still not working..file names are correct and so is extention..is what i see..The long path of song is..in "areas."

I see you edited your answer..ill go and look for it..external files..Thanks..!:)


*EDIT* perfect..that worked...THANK YOU..!~~ i had a feeling it had something to do with external folder..and me not know where it was..lol..i just assumed it was in the project folder..yayyy..
Last edited by mercedes on Mon May 12, 2008 7:35 am, edited 1 time in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Mon May 12, 2008 7:34 am

I hope that with adding the sound files to the external folder, the problem will be solved.
Attachments
external.jpg
external.jpg (47.18 KiB) Viewed 4097 times
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon May 12, 2008 7:37 am

thank you..thank you.. thank you.. thank you.. thank you.. it worked perfectly...!~!! You are the woman.!~ Can't say "man" here.. :lol:
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Mystery » Mon May 12, 2008 7:39 am

Lol, no, "man" would be in this case not really true :P

Glad it works now :)
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