Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: deadworm222 on March 28, 2004, 09:41:44 AM
-
I have this very very weird problem with right clicking. When right clicking an object in the inventory, it should execute the Examine event - but no.
on "RightClick"
{
// variable ActObj is the object clicked, if any
var ActObj = Game.ActiveObject;
// Was an actual object clicked?
if (ActObj!=null)
{
if (ActObj.CanHandleEvent("Examine"))
{
ActObj.ApplyEvent("Examine");
}else{
ActObj.ApplyEvent("RightClick");
}
}else{
Scene.ApplyEvent("Examine");
}
}
Left clicking works like dream, so what's the problem? There's nothing wrong with the items' .script files. I found out, by using a Game.Msg function, that for some reason when clicking an inveotory item ActObj.CanHandleEvent("Examine") is false! But why?
-
I tried this exact piece of code and it works without any problem. I take it this piece of code is in game.script, right?
Please check if the "RightClick" event isn't stolen by some other handler and also check if there isn't any "endless loop" in the beginning of the game.script. If it is, it must be moved to a separate script otherwise the events cannot be handled.
-
I'll check. Another strange thing: Every time I reopen the project file, the registry path , which I usually keep blank, has changed to M
-
Nothing else uses right click and there's no loops.
-
Registry path bug fixed, don't know about the events though.
-
RightClicking works now. I just had forgot to attach scripts to the items! I need to be flogged. ???