Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mariano Cirigliano on Wed 27/10/2010 19:34:36

Title: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Mariano Cirigliano on Wed 27/10/2010 19:34:36
Thanks!.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Matti on Wed 27/10/2010 20:10:45
Wow, you dig up an ancient thread, start two new ones and now you're randomly sending PMs around so that people will deal with your issue? Jeeez.

Calm down, dude. If you post here, people will read it and help you if they can. Do you want us to make your game for you?
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Chim on Wed 27/10/2010 20:15:56
function on_mouse_click(MouseButton button) {

if (button == eMouseRight)
   show_inventory_window();
}

np
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Lt. Smash on Wed 27/10/2010 20:17:07
so before you open up another topic ;D here is a simple way:

Just go into the on_mouse_click event function of the globalscript and just check for the right mouse button:

[else] if (button == eMouseRight) { 
  gMyGuisName.Visible = true;
}
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Mariano Cirigliano on Wed 27/10/2010 20:33:43
Quote from: Lt. Smash on Wed 27/10/2010 20:17:07
so before you open up another topic ;D here is a simple way:

Just go into the on_mouse_click event function of the globalscript and just check for the right mouse button:

[else] if (button == eMouseRight) { 
  gMyGuisName.Visible = true;
}


This can I write it in the game that comes for Defult?. Because not in that part to write it. Thank you.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: mode7 on Wed 27/10/2010 21:21:19
put it at the beginning or end of the GlobalScript
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Khris on Wed 27/10/2010 21:37:17
What you're asking is really really basic stuff; explaining that while struggling with the language border is not going to be fun at all.
Try to get someone who speaks English and Spanish to help you, otherwise this is going to become a huge mess.

Edit: mode7, that's not going to help. LtSmash's code is a small snippet that's supposed to go into on_mouse_click, not at the beginning or end of Global.asc by itself.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Mariano Cirigliano on Wed 27/10/2010 23:37:10
Quote from: Khris on Wed 27/10/2010 21:37:17
What you're asking is really really basic stuff; explaining that while struggling with the language border is not going to be fun at all.
Try to get someone who speaks English and Spanish to help you, otherwise this is going to become a huge mess.

Edit: mode7, that's not going to help. LtSmash's code is a small snippet that's supposed to go into on_mouse_click, not at the beginning or end of Global.asc by itself.

The problem is: I do not understand very much like they write to themselves the "SCRIPT" and my questions are:

1-have I to use " EMPTY GAME " or " DEFULT GAME "?
2-What I need is that it is opened and the inventory is closed on having touched the right button of the mouse. But I do not manage to do it. How is "SCRIPT" written?.

My English is not good, sorry.

Thank you very much and I wait for answers.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Khris on Thu 28/10/2010 01:31:55
I understand the problem, but there is another problem: you can't speak English good enough.

When this problem is solved, the next one will be right around the corner.

Sorry, I'm out.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Mariano Cirigliano on Thu 28/10/2010 11:25:30
Quote from: Khris on Thu 28/10/2010 01:31:55
I understand the problem, but there is another problem: you can't speak English good enough.

When this problem is solved, the next one will be right around the corner.

Sorry, I'm out.

Ok but, How close the inventory (GUI) to button MouseRight?. ???
I obtained open the inventory (GUI) to button MouseRight!!
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Dualnames on Thu 28/10/2010 11:54:59

[else] if (button == eMouseRight) { 
  gMyGuisName.Visible = !gMyGuisName.Visible;
}


That's what I'm guessing you want to do. Right-click opens and closes the gui.

Sarebbe piu facile di trovare una persona da questo forum che si puo tradurre per te.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Khris on Thu 28/10/2010 12:45:33
That's Italian, right? He's from Argentina and speaks Spanish.

I already told him to get help from a friend who speaks English, he won't listen.

Also he cross-posted and dug up your module thread. Like I said, I'm out.
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Dualnames on Thu 28/10/2010 13:28:13
OMG, I thought he was Italian. EPIC FAIL.

You can't begin to imagine how much I lolled when I saw your reply Khris. :D :D
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Mariano Cirigliano on Thu 28/10/2010 17:42:36
Quote from: Dualnames on Thu 28/10/2010 11:54:59

[else] if (button == eMouseRight) { 
  gMyGuisName.Visible = !gMyGuisName.Visible;
}


That's what I'm guessing you want to do. Right-click opens and closes the gui.

Sarebbe piu facile di trovare una persona da questo forum che si puo tradurre per te.

wrote the code that you me sent but only the "GUI" is opened I do not achieve that it is closed. ???
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Ryan Timothy B on Thu 28/10/2010 18:46:44
Isn't there a spanish AGS forum?
Title: Re: How to do that the inventory is opened touching the right button of the mouse?.
Post by: Icey on Thu 28/10/2010 20:28:34

Paste this in the globalcript under

function on_mouse_click(MouseButton button)


else if(mouse.IsButtonDown(eMouseRight)){
  gGui2.Visible = true;
 
}



then in your gui click it's background and paste this in it's settings for when the player clicks the background.


if (mouse.IsButtonDown(eMouseRight)){
  gGui2.Visible = false;
}


works for me.;)