Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Eggie on Sun 02/11/2003 20:45:34

Title: Trouble with a Broken Sword-ish interface.
Post by: Eggie on Sun 02/11/2003 20:45:34
I'm using a ProcessClick() command in my on_mouse_click function. And, of course it doesn't work on the GUI's....

So...Could i please request some help from people more inteligent than myself?
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Ishmael on Mon 03/11/2003 05:38:12
Sorry, I haven't played Broken Sword, so I can't straight off tell what you need to do... If you explain a bit better *what* should happen wen you do *what*? I would gladly help if I knew better what you're after... :)
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: SSH on Mon 03/11/2003 12:56:57
Do you mean right-clicks on the inventory, or something like that? I have been thinking about doing a BS style GUI myself. The dialogs are too much work at the moment, but the rest aint too bad.

Are are you looking for the interface_click function or RunInventoryInteration, or what?

Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Eggie on Mon 03/11/2003 17:01:02
Ah...I should explain myself in a more coherent fashion.
Spibbly jibbly plop.

I have the script set up sp that if you right click it runs the 'look' interaction and if you left-click it runs the 'use' interaction.

The trouble is it doesn't register GUI button clicks.
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Ishmael on Mon 03/11/2003 17:05:41
function on_mouse_click (int button) {
if (button == LEFTINV) // left click on inv item
if (button == RIGHTINV) // right click on inv item
}

and check the 'handle inventory clicks in script' in the General Settings.

;)
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: SSH on Mon 03/11/2003 17:06:03
Have you got the Game Option "Handle Inventory clicks in script" option set? Are you using LEFTINV, RIGHTINV instead of LEFT/RIGHT for button matching?
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Ishmael on Mon 03/11/2003 17:06:55
Ha! ;D
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: SSH on Mon 03/11/2003 17:26:18
Beaten by "Quick Draw  TK"  :(
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Eggie on Mon 03/11/2003 18:58:00
Okay...it seems that ,yet again, I have mislead you.
Look like i'll have to re-explain myself...again.

I can't use it on GUI buttons. By this I mean things such as 'Inventory' and 'Save Game'. I'm pretty sure the inventory objects will will work fine.

Here's a section of the code:

function on_mouse_click(int button) {
 // called when a mouse button is clicked. button is either LEFT or RIGHT
 if (IsGamePaused() == 1) {
   // Game is paused, so do nothing (ie. don't allow mouse click)
 }
 else if (button==LEFT) { //left-click, use
   ProcessClick(mouse.x,mouse.y,MODE_WALK);
   ProcessClick(mouse.x, mouse.y, MODE_USE);
   //This is my code. But it doesn't work on GUI
  //   buttons.
 }
 else {   // right-click, look
   ProcessClick(mouse.x, mouse.y, MODE_LOOK);
 }
}

function interface_click(int interface, int button) {
 if (interface == ICONBAR) {
   if (button == 0) {  // show inventory
     show_inventory_window();
  //and these are the GUI buttons that don't work
   }
   else if (button == 1)    // save game
     SaveGameDialog();
   else if (button == 2)   // load game
     RestoreGameDialog();
   else if (button == 3)   // quit
     QuitGame(1);
 }  // end if interface ICONBAR
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Eggie on Mon 03/11/2003 18:59:55
On second thought, it's probably because I forgot to set the Left-click actions for the GUI buttons...

:-[
Title: Re:Trouble with a Broken Sword-ish interface.
Post by: Dave Gilbert on Mon 03/11/2003 21:06:43
Ahh, you beat me to it.  Yes, I once had that same problem myself.  I spent AGES going over my damn code only to discover that little checkbox that I didn't click...