Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: YotamElal on Wed 02/03/2005 07:06:28

Title: why isn't my setvoicemode button working
Post by: YotamElal on Wed 02/03/2005 07:06:28
    if (button == 9) {
SetVoiceMode(2);
}
   if (button == 10) {
SetVoiceMode(1);
}


?
Title: Re: why isn't my setvoicemode button working
Post by: strazer on Wed 02/03/2005 07:11:33
Have you set the buttons' "Left click" action to "Run Script"?
Title: donno but my other buttons work fine.
Post by: YotamElal on Wed 02/03/2005 07:28:58
donno what that means?
but my other buttons work fine.
Title: Re: why isn't my setvoicemode button working
Post by: strazer on Wed 02/03/2005 07:51:53
In the "GUIs" pane of the editor, when you select the button, does the entry "Left click" in the little white window say "Run Script"?

If it does, are you sure they're buttons 9 and 10 ("Object 9" in title of the little window)?

If you are, can you please post the whole content of your interface_click function?
Title: :?
Post by: YotamElal on Wed 02/03/2005 08:15:50
leftclick=run script (defualt)
objects are corect

here is the script


function interface_click(int interface, int button) {
 
  //  calling our function for clicks over GUISAVELOAD:
  if (interface == GUISAVELOAD) interface_click_SaveLoadDialogGUI(button);
 
  if (interface == ICONBAR) {
    if (button == 1) {  // show inventory
      show_inventory_window();
      }     
    if ((button == 3) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
      // scroll down
      game.top_inv_item = game.top_inv_item + game.items_per_line;
    }
    if ((button == 2) && (game.top_inv_item > 0)){
      // scroll up
      game.top_inv_item = game.top_inv_item - game.items_per_line;
   }
   if (button == 4) {
      SetCursorMode (MODE_WALK);
      // But, override the appearance to look like the arrow
   //      SetMouseCursor (6);
    }
    if (button == 5) {
      SetCursorMode(MODE_TALK);
  }
  if (button == 6) {
      SetCursorMode (MODE_LOOK);
    }
        if (button == 7) {
      SetCursorMode(MODE_USE); 
    }
  }  // end if interface ICONBAR

  if (interface == INVENTORYA) {
    // They clicked a button on the Inventory GUI
    SetCharacterSpeed(EGO,GetSliderValue(1,4));
    SetMusicMasterVolume(GetSliderValue(1,5));
   
    if (button == 0) {
      // They pressed the OK button, close the GUI
      SetCursorMode (MODE_WALK);
      GUIOff (INVENTORYA);
  }
 
    if (button == 1) {  // quit
      GUIOn(QUIT);
      }
    if (button == 3) {   // about
      Display("The Quest To Zooloo [[Copyright (c) 2005 Yotam Elal");
      }
      if (button == 2) {
GUIOn(GUISAVELOAD);
}
    if (button == 9) {
SetVoiceMode(2);
}
   if (button == 10) {
SetVoiceMode(1);
}


}
if (interface == QUIT) {
    if (button == 1) {
      QuitGame(0);
  }
 
    if (button == 2) {  // quit
GUIOff(QUIT);
}
}
}
Title: Re: why isn't my setvoicemode button working
Post by: strazer on Wed 02/03/2005 08:31:12
Hm, looks okay to me, no braces problems.

The buttons are on the INVENTORYA gui, yes?

To check if the script gets executed at all, do this:


if (button == 9) {
Display("Voice only, no text");
SetVoiceMode(2);
}
if (button == 10) {
Display("Both voice and text");
SetVoiceMode(1);
}


If the messages are displayed, how do you know the SetVoiceMode commands are not working?
What does (not) happen in your game?
Title: it displays the speech...
Post by: YotamElal on Wed 02/03/2005 08:58:46
it displays the speech...
but it doesn't shut of the text?????
Title: Re: why isn't my setvoicemode button working
Post by: strazer on Wed 02/03/2005 09:08:20
The text is not displayed only if there's a voice speech file defined and present.
Title: thanks
Post by: YotamElal on Wed 02/03/2005 09:38:32
it works fine...
:o)





(BTW: I Didn't solve random character walking in walkarea)
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19465.0
:o(