I couldn't re-create the problem in the demo. I have posted my code for an object which is below. I have put the word BLANK in place of things I can't show yet:
#include "scripts\base.inc"
////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
actor.GoToObject(this);
actor.Talk("-BLANK- fly because they take themselves lightly.");
}
////////////////////////////////////////////////////////////////////////////////
on "Take"
{
actor.GoToObject(this);
var randHere = Random(1,2);
if(randHere == 1)
{
actor.Talk("I’d rather leave the -BLANK- there.");
}else{
genRes.takeDis();
}
}
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
actor.GoToObject(this);
genRes.talkDis();
}
on "BLANK"
{
actor.GoToObject(this);
genRes.BLANKDis();
}
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
actor.GoToObject(this);
}
Also for the interactions, instead of using the menu.script, I made a seperate script for each of the interactions. I then attach the script through the window editor. Here is the code for one of those scripts, the rest are the same:
#include "scripts\base.inc"
global MenuObject;
global WinMenu;
on "LeftRelease"
{
WinMenu.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;
}
The last thing is the game script which I edited to make it so the left click button needs to be held down for the interactions to pop up. I also added a LeftRelease because when you hover over an interaction and release the left click that interaction is executed, here is the code for that:
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
rRel = false;
// what did we click?
var ActObj = Game.ActiveObject;
var timeLim = 400;
if(ActObj!=null && Game.InventoryVisible == false)
{
// clicking an inventory item
if(ActObj.Type=="item" && Game.SelectedItem==null)
{
Game.SelectedItem = ActObj;
}
// using an inventory item on another object
else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
{
var Item = Game.SelectedItem;
if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
else actor.Talk("I can't use these things together.");
}
// just a simple click
else ActObj.ApplyEvent("LeftClick");
}
// else propagate the LeftClick event to a scene
else
{
Scene.ApplyEvent("LeftClick");
}
MenuObject = Game.ActiveObject;
if(Game.ActiveObject == "noClick"){
timeLim = 0;
}else{
timeLim = 400;
}
Sleep(timeLim);
if(rRel == false){
if(ActObj!=null)
{
// if the clicked object can handle any of the "verbs", display the right-click menu
if(ActObj.CanHandleEvent("Take") || ActObj.CanHandleEvent("Talk") || ActObj.CanHandleEvent("LookAt"))
{
// store the clicked object in a global variable MenuObject
var Caption = WinMenu.GetWidget("caption");
Caption.Text = MenuObject.Caption;
// adjust menu's position
WinMenu.X = Game.MouseX - WinMenu.Width / 2;
if(WinMenu.X < 0) WinMenu.X = 0;
if(WinMenu.X+WinMenu.Width>Game.ScreenWidth) WinMenu.X = Game.ScreenWidth-WinMenu.Width;
WinMenu.Y = Game.MouseY - WinMenu.Height / 2;
if(WinMenu.Y<0) WinMenu.Y = 0;
if(WinMenu.Y+WinMenu.Height>Game.ScreenHeight) WinMenu.Y = Game.ScreenHeight-WinMenu.Height;
//stop the actor from whatever he was going to do
actor.Reset();
// and show the right-click menu
WinMenu.Visible = true;
// no verbs supported, no menu is needed; just send the LeftClick event to the object
}else ActObj.ApplyEvent("LeftClick");
}
}
}
////////////////////////////////////////////////////////////////////////////////
on "LeftRelease"
{
rRel = true;
var ActObj = Game.ActiveObject;
if(WinMenu.Visible == true){
ActObj.ApplyEvent("LeftRelease");
WinMenu.Visible = false;
}
if(Game.InventoryVisible == true){
if(ActObj.Type=="item" && Game.SelectedItem==null)
{
Game.SelectedItem = ActObj;
}
}
}
////////////////////////////////////////////////////////////////////////////////
on "RightClick"
{
var ActObj = Game.ActiveObject;
if(Game.SelectedItem != null && Game.InventoryVisible == false){
Game.SelectedItem = null;
}else if(Game.SelectedItem != null && Game.InventoryVisible == true){
Game.SelectedItem = null;
}else if(Game.SelectedItem == null)
{
Game.InventoryVisible = false;
interface.Visible = false;
ingGUI = true;
}
}
Sorry for the long post guys. On someone elses computer it runs fine but on mine it doesn't and the machine I am using is the one that needs to run smooth because it has low specs this way everyone can play the game when released. No point of a beast being able to run the game if a low spec machine can't.
Thanks for the help.
Cheers
Myles Blasonato.