You can *check* if an interaction is available:
IsInteractionAvailable(eModeTalkto)
I was wondering if you can turn off interactions that are already?
You have an interaction for a character (cCharater_Talk() has been set and filled in with some code); how do you turn this off/on at will?
Or do you have to set a custom property and use this to turn it on or off through various mouse cursor trickery?
The short answer is to use a global variable, afaik AGS doesn't have a shortcut to turn off interactions.
There's also Game.DoOnceOnly(), although you'd have to manually call unhandled_event in the else block.
I may suggest using Custom Properties to flag enabled/disabled interactions (you may now change their values at runtime too) because they are already bound to an object.
For a quick example:
bool AllowRunInteraction(Character *c, CursorMode mode)
{
if (mode == eModeTalkto && c.GetProperty("CanTalkTo") != 0) return true;
if (mode == eModeLook && c.GetProperty("CanLookAt") != 0) return true;
return false;
}
function on_mouse_click(...)
{
....
if (btn == eMouseLeft)
{
....
Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
if (AllowRunInteraction(ch, mouse.Mode))
ch.RunInteraction(mouse.Mode);
}
....
}
As I thought - I've created a custom property.
Thanks :)