Hello everybody!
I was trying to create an inventory that appears when you rightclick on the screen. I've been able to do that using this simple piece of code on Game.script:
on "RightClick"
{
if (Game.SelectedItem != null){
Game.SelectedItem = null;
return;
}
Game.InventoryVisible=true;
}
The inventory is closed when you move the mouse outside of it:
if(Game.MouseY > 487 || Game.MouseY <120 || Game.MouseX > 635 || Game.MouseX <160 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = false;
The problem is this: the code works, but the game won't read the RightClick command anywhere else in the game... for example, if I put a RightClick event on an object's script:
on "RightClick"
{
Game.Interactive=false;
actor.Talk("A voler essere onesti ho un paio di monete di ottone e basta.");
Game.Interactive=true;
}
The program doesn't do a thing. What I want to achieve is to have the Righclick as default command to examine, but when I rightclick on a point in the screen where there's nothing active, as objects or entities, the inventory is automatically loaded.
How the code should look like?