Jump to content

Scripters Help Needed


X13Studios

Recommended Posts

Hey i got this script from the wiki, it all works except it keeps playing one song for every choice? it did say if there is a break or something it will loop the first choice. I've looked over it and cant find the problem.

 

Scn 1ZSmusicObjectScript

Short Choosing
Short Choice
Short Choice2
Short MusicChoice
Short MusicChoice2

Begin onActivate player
    if Choosing == 0
         set Choosing to -1
    endif
end

Begin onEquip player
    if Choosing == 0
         set Choosing to -3
    endif
end

Begin gameMode
    If (Choosing == -1)
         MessageBox "What would you like to do?", "Take", "Select Music", "Done"
         set Choosing to 1
         set Choice to GetButtonPressed
    elseif (Choosing == 1)
         if (Choice == -1)
              set Choice to GetButtonPressed
         elseif (Choice == 0)
              Activate
              Set Choosing to 0
         elseif (Choice == 1)
              Set Choosing to -2
         elseif (Choice == 2)
              Set Choosing to 0
         endif
    Endif

    If (Choosing == -2)
         MessageBox "Wich music would you like to play?", "A Little Piece Of Heaven", "Critical Acclaim", "Danger Line", "Fiction", "Save Me", "Back", "Cancel"
         set Choosing to 2
         set MusicChoice to GetButtonPressed
    elseif (Choosing == 2)
         if (MusicChoice == -1)
              set MusicChoice to GetButtonPressed
         elseif (MusicChoice == 0)
              StreamMusic "Data\Music\MyMusic\A Little Piece Of Heaven.mp3"
              Set Choosing to -1
         elseif (MusicChoice == 1)
              StreamMusic "Data\Music\MyMusic\Critical Acclaim.mp3"
              Set Choosing to -1
         elseif (MusicChoice == 2)
              StreamMusic "Data\Music\MyMusic\Danger Line.mp3"
              Set Choosing to -1
         elseif (MusicChoice == 3)
              StreamMusic "Data\Music\MyMusic\Fiction.mp3"
              Set Choosing to -1
         elseif (MusicChoice == 4)
              StreamMusic "Data\Music\MyMusic\Save Me.mp3"
              Set Choosing to -1
         elseif (MusicChoice == 5)
              Set Choosing to -1
         elseif (MusicChoice == 6)
              Set Choosing to 0
         endif
    Endif
End

Begin menuMode
    If (Choosing == -3)
         MessageBox "What would you like to do?", "Drop", "Select Music", "Done"
         set Choosing to 3
         set Choice2 to GetButtonPressed
    elseif (Choosing == 3)
         if (Choice2 == -1)
              set Choice2 to GetButtonPressed
         elseif (Choice2 == 0)
              DropMe
              Set Choosing to 0
         elseif (Choice2 == 1)
              Set Choosing to -4
         elseif (Choice2 == 2)
              Set Choosing to 0
         endif
    Endif

    If (Choosing == -4)
         MessageBox "Witch music would you like to play?", "A Little Piece Of Heaven", "Critical Acclaim", "Danger Line", "Fiction", "Save Me", "Back", "Cancel"
         set Choosing to 4
         set MusicChoice2 to GetButtonPressed
    elseif (Choosing == 4)
         if (MusicChoice2 == -1)
              set MusicChoice2 to GetButtonPressed
         elseif (MusicChoice2 == 0)
              StreamMusic "Data\Music\MyMusic\A Little Piece Of Heaven.mp3"
              Set Choosing to -3
         elseif (MusicChoice2 == 1)
              StreamMusic "Data\Music\MyMusic\Critical Acclaim.mp3"
              Set Choosing to -3
         elseif (MusicChoice2 == 2)
              StreamMusic "Data\Music\MyMusic\Danger Line.mp3"
              Set Choosing to -3
         elseif (MusicChoice2 == 3)
              StreamMusic "Data\Music\MyMusic\Fiction.mp3"
              Set Choosing to -3
         elseif (MusicChoice2 == 4)
              StreamMusic "Data\Music\MyMusic\Save Me.mp3"
              Set Choosing to -3
         elseif (MusicChoice2 == 5)
              Set Choosing to -3
         elseif (MusicChoice2 == 6)
              Set Choosing to 0
         endif
    Endif
End

Link to comment
Share on other sites

I don't see anything wrong with the code. You can try adding some debug messages to make sure it's working right. Example:

 

StreamMusic "Data\Music\MyMusic\A Little Piece Of Heaven.mp3"
Message "Playing: A Little Piece of Heaven"

;...

StreamMusic "Data\Music\MyMusic\Critical Acclaim.mp3"
Message "Playing: Critical Acclaim"

;etc.

 

If the messages correspond to your choices, then the script is working properly... In that case, you should check and make sure you have the file paths correct, and try playing the mp3 files to make sure that there's nothing wrong with them.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...