Sound effect switch not working??

GLGAMESGLGAMES SingaporeMember Posts: 988
edited March 2012 in Working with GS (Mac)
Ok i have a rule thats says if xxxx attribute =0 play sound effect 1
if xxxx attribute =1 play sound effect 2
however it just plays sound effect one and the effect2 does not play even if attribute=1 just no sound at all.
when attribute changes back to 0 effect1 starts playing again.
the strange thing is nothing wrong with the sound file if i swap the effects both plays properly on attribute=0 but doesn't change after =1.

Comments

  • pinata14pinata14 Member Posts: 150
    I haven't worked with sound yet, but i was wondering is it one or two rules? Meaning do you have two separate, or is one in the other, or is there a double rule?
  • POMPOM Member Posts: 2,599
    Can you make sure your "xxxx attribute" is actually changes to 1 ? use display text to see its value and confirm ..

    Photobucket Roy
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    yes it did changed, when 0 effect1 plays, then when 1 all sound gone. then switch back to 0 effect1 plays again. thats why i find it very strange.
  • POMPOM Member Posts: 2,599
    edited March 2012
    Do you mind posting an image of the block of code for the sounds rules ?

    Photobucket Roy
  • pinata14pinata14 Member Posts: 150
    ^^^ that would be helpful to the situation
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    edited March 2012
    Here it is.
    Basically one offscreen actors with only these conditions inside nothing else.
    image
    I have a button when pressed changes the value to 1 from the menu screen. so at menu screen it's playing effect1 and once inside game scene it's supposed to be effect2.
  • pinata14pinata14 Member Posts: 150
    well once again since i haven't worked with sound yet, i can't be too sure, but I would suggest putting a slight delay between the rule and play sound, so it has time to stop the first sound. If anything, you could just have 2 seperate actors in each scene that don't appear in the other scene. Tell those to always play sound1/2.
    hope one of those helps,
    -Ryan
  • pinata14pinata14 Member Posts: 150
    edited March 2012
    oh, make sure that teh actor is actually there in both scenes. You might have placed it in the menu scene, but forgot to place anotehr one down in game scene :)
    -Ryan
  • POMPOM Member Posts: 2,599
    Four options :
    1) your sound file is corrupted , but you said its fine so...
    2) your rule is corrupted , delete it and create it from scratch .
    3) you "xxxx attribute" is not changing to 1 , or even if it does , its comes back to 0 too quick .
    4) its a GS bug.. (unlikely )

    If you want , you can send me a part of the project to roysadaka (at) gmail (dot) com and ill take a look ..

    Photobucket Roy
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    My menu and game scene is the same scene i just changed camera position to the game area.
    hmm.. probably i will try to create the rule again, dunno why such a simply rule can get corrupted.
    when i pressed start game attribute changes to one and won't change back to 0, only changes back to 0 when i press return to menu from game area.
    Anyway i'll try again.
  • pinata14pinata14 Member Posts: 150
    edited March 2012
    Why don't you make 2 separate scenes for the menu and game? that would probably help a little. Once again I don't think it has a high probability of working, but try to make a delay before the game plays the sound.
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    It is still not working after deleting and recreating that actor. Switched the sound file again but still the same. don't know whats wrong :(
    how come the sound effect 1 can always play but not effect 2.
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    Cool, the delay works , thanks @pinata14.
    Seems GS needs a bit of loading time??
  • cbtcbt Member Posts: 644
    Instead of doing that you can make;

    if effect=0 play1
    OTHERWISE
    play2

    (I think)
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    Yuh i thought of that as well but otherwise doesn't work too that's why i split it into 2 separate rules. Somehow i need a timer delay to load the sound i guess.
Sign In or Register to comment.