Boy, I'm asking a lot here.
What I'm looking for is a Broken Sword interface (left click interact, right click look at etc etc.) I've had a look around and I've found a couple of interfaces but they're all written for older versions of AGS. The functions don't work now, and I'm not good enough to figure out the replacement code I need despite trying.
Would anybody be able to help with this?
Thanks very much.
FSi wrote a mouse script for that once, I think.
I've had a look around, but I can't find the script you're refering to. Could you point me in the right direction?
Well, you should probably PM him.
I have the mouse script you need. I used it in Red Dwarf. And yeah, it's made by FSi. Clever bloke, he is.
Here's the script:
#sectionstart on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
// script fixed for non-popup modal inv guis
int x = mouse.x;
int y = mouse.y;
if (button == eMouseLeftInv) {
if (mouse.Mode == eModeLookat) {
player.ActiveInventory = InventoryItem.GetAtScreenXY(x, y);
mouse.Mode = eModeUseinv;
}
else if (mouse.Mode == eModeUseinv) { // tries to combine something
InventoryItem * item = InventoryItem.GetAtScreenXY(x, y);
item.RunInteraction(eModeUseinv);
mouse.Mode = eModeLookat;
}
}
else if (button == eMouseRightInv) {
InventoryItem * item = InventoryItem.GetAtScreenXY(x, y);
item.RunInteraction(eModeLookat);
if(mouse.Mode == eModeUseinv) {
mouse.Mode = eModeLookat;
} // re-setting mouse mode if it was useinv
}
else if (button == eMouseLeft)
{
if(GetLocationType(x, y) == eLocationNothing) {
ProcessClick(x,y, eModeWalkto);
}
else {
if (mouse.Mode == eModeLookat) { // look
ProcessClick(x, y, eModeLookat);
}
else if (mouse.Mode == eModeUseinv) { // tries to useinv
ProcessClick(x, y, eModeUseinv);
}
}
}
else if (button == eMouseRight)
{
if (mouse.Mode == eModeUseinv) {
mouse.Mode = eModeLookat; // kick off inventory
}
else if(GetLocationType(x, y) != eLocationNothing) {
ProcessClick(x,y, eModeInteract);
mouse.Mode = eModeLookat;
}
}
}
#sectionend on_mouse_click // DO NOT EDIT OR REMOVE THIS LINE
Ah perfect! Thankyou very much.
I want the left click/right click effects to be switched round. I've gone through the code and swopped left/right, but when I play the game, right click doesn't get recognised until there has been a left click. Could anybody tell me how to fix this?
Thanks
I suggest you leave it like the original, frankly :).
Hmm yes. Turns out walking works with right click now too.
This is getting more complicated lol.