1
Technical forum / Interface menu not opening on right click
« on: June 24, 2014, 03:02:42 PM »
Hi
I am confused as to why when I click on an item, no menu appears with the option to LookAt and talk etc. If I use the bog standard demo wme_demo it opens fine. I guess that I have made a nOOb error and would be grataeful if someone could help with this as it is driving me nuts. Thanks
FYI: The game.script and game_loop.script are in place and point to the correct paths.
Interface menu script
Book script in items
book script in scenes folder
I am confused as to why when I click on an item, no menu appears with the option to LookAt and talk etc. If I use the bog standard demo wme_demo it opens fine. I guess that I have made a nOOb error and would be grataeful if someone could help with this as it is driving me nuts. Thanks
FYI: The game.script and game_loop.script are in place and point to the correct paths.
Interface menu script
Code: [Select]
#include "scripts\base.inc"
global MenuObject;
////////////////////////////////////////////////////////////////////////////////
on "Take"
{
this.Close();
if(MenuObject!=null)
{
if(MenuObject.CanHandleEvent("Take")) MenuObject.ApplyEvent("Take");
else actor.Talk("I can't take this.");
}
MenuObject = null;
}
////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
this.Close();
if(MenuObject!=null)
{
if(MenuObject.CanHandleEvent("LookAt")) MenuObject.ApplyEvent("LookAt");
else actor.Talk("I don't know what to say about it.");
}
MenuObject = null;
}
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
this.Close();
if(MenuObject!=null)
{
if(MenuObject.CanHandleEvent("Talk")) MenuObject.ApplyEvent("Talk");
else actor.Talk("Can't talk to this.");
}
MenuObject = null;
}
Book script in items
Code: [Select]
#include "scripts\base.inc"
////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
actor.Talk("Guess I should read through this...");
}
////////////////////////////////////////////////////////////////////////////////
on "Take"
{
Game.SelectedItem = "book";
}
book script in scenes folder
Code: [Select]
#include "scripts\base.inc"
var ActObj = Game.ActiveObject
////////////////////////////////////////////////////////////////////////////////
on "Take"
{
// walk to the desk
//actor.GoTo(782, 645);
//actor.TurnTo(DI_UPLEFT);
Game.Interactive = false;
actor.Talk("OK, I'll take it.");
// play "take" animation
//actor.PlayAnim("actors\molly\ul\take1.sprite");
// hide the book entity and place "book" item into the inventory
Game.TakeItem("book");
var EntBook = Scene.GetNode("book");
EntBook.Active = false;
// play the second "take" animation
actor.PlayAnim("actors\molly\ul\take2.sprite");
Game.Interactive = true;
}
////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
// walk to the desk
actor.GoToObject(this);
actor.Talk("~"Wintermute Engine: User's manual.~"");
actor.TurnTo(DI_DOWN);
actor.Talk("Sounds interesting.");
actor.TurnTo(DI_UPRIGHT);
}
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
//Game.Msg("You found the book");
}