Hello.
I wanted to make it so every time the player right click's he "Uses" the corresponding thing. How do I go about that?
GlobalScript.asc, function on_mouse_click:
function on_mouse_click(MouseButton button)
{
// User clicked right mouse button
if (button == eMouseRight)
{
// If user has inventory item selected...
if (player.ActiveInventory != null)
{
// Invoke "using inventory" command
ProcessClick(mouse.x, mouse.y, eModeUseinv);
}
}
}
About ProcessClick: http://www.adventuregamestudio.co.uk/wiki/Game_/_Global_functions#ProcessClick
EDIT: lol I misread what you said.
You probably meant "Interact" action, in which case:
function on_mouse_click(MouseButton button)
{
// User clicked right mouse button
if (button == eMouseRight)
{
// Invoke "interact" command
ProcessClick(mouse.x, mouse.y, eModeInteract);
}
}
Woten, you're using the 9-Verb GUI, correct? (This is something you need to mention when asking a question like that.)
The GUI supports default actions, for instance opening/closing doors, or talking to characters when right-clicking them. Afaik you can set the default action by naming the object something like "door>o". This will set the default action to "open". Refer to the documentation of the 9-Verb GUI for how to use this.