Sorry for temporarily taking over the forums with the last few topics
I have a little bug that I can't figure out:
13:50: Runtime error. Script 'scripts\game.script', line 44
13:50: Call to undefined method 'CanHandleEvent'. Ignored.
I changed the interface so that it doesn't use the coin, but instead only has two verbs: LookAt (left clicks) and Action (right clicks). It's all in game.script now, not in inventory.script.
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
// what did we click?
var ActObj = Game.ActiveObject;
// if there's an inventory item selected, deselect it
if (Game.SelectedItem != null){
Game.SelectedItem = null;
return; }
// if there's no inventory item selected, but the cursor is hovering above an object, apply the LookAt verb
else if(ActObj!=null && ActObj.CanHandleEvent("LookAt"))
{
ActObj.ApplyEvent("LookAt");
}
// else propagate the LeftClick event to a scene
else
{
Scene.ApplyEvent("LeftClick");
}
}
Any idea why I can't use CanHandleEvent in this context?
The error occurs when left clicking on the floor, not when clicking on objects.