about on_mouse_click function:
Code: ags
Here the script execution goes on even when the game is paused.
Try:
Code: ags
in SCUMM, some inventory items can be used directly (for instance: Use glass of water to drink the water). So, I suggest:
Code: ags
I did nbot try to put it into AGS, so the syntax may be wrong. The check on isIntecactionAvaiable can also be extended to other modes (using isInteractionAvaiable(Mouse.mode)).
Again, I hate games where a non-interaction click reset the status (last 3 lines in the code above).
if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
{
}
Here the script execution goes on even when the game is paused.
Try:
if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
{
return;
}
in SCUMM, some inventory items can be used directly (for instance: Use glass of water to drink the water). So, I suggest:
if (button == eMouseLeftInv)
{
InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (item != null)
{
if (cJustin.ActiveInventory == null)
{
// depending on the verb, we may want to run the interaction on this item
if ((StrComp(verb, vGive) == 0) || ((StrComp(verb, vUse) == 0)
&& (!item.isInteractionAvaiable(eModeIntecact))))
cJustin.ActiveInventory = item;
// Take the item only if the verb GIVE is selected, or if the verb USE is select AND there is no use for the item
else
item.RunInteraction(mouse.Mode);
}
else
{
item.RunInteraction(mouse.Mode);
}
StrCopy(verb, vWalkto);
mouse.Mode = eModeWalkto;
cJustin.ActiveInventory = null;
}
I did nbot try to put it into AGS, so the syntax may be wrong. The check on isIntecactionAvaiable can also be extended to other modes (using isInteractionAvaiable(Mouse.mode)).
Again, I hate games where a non-interaction click reset the status (last 3 lines in the code above).