goodmorning to everyone.
I hope you re all ok
In my game I have a "suitcase" inventory item , when the player looks at this object I have set an exclusive window to popup showing the contentsof the suitcase.In that window there are some entities the player can interact with and could if he wants, to add them to the inventory.. I have set that when one of those entities is left clicked this enity will be invisible and current item will be added to inventory... its working fine.... but when I press the X button in order to unload the window it makes them visible for a moment and then it closes. That happens , only the first time, If I have taken one item from the suitcase and added to the inventory... and re Lookat the suitcase the entity is correctly invisible....
I know that my English are bad so I will write the code....
window script
global rt = Game.LoadWindow(this);
global itema = this.GetControl("itema");
var EditorControl;
var EditorText;
actor.Active = true;
itema.Visible = true;
CheckStatus();
if(itema.IsTaken || Game.IsItemTaken("itema"))
{
itema.Visible = false;
itema.GetEntity = false;
} else {
itema.Visible = true;
}
on "x"
{
Game.DeleteWindow(this);
}
and enity script
on "leftclick"
{
global rt = Game.LoadWindow("objects\makeupkitcloseup.window");
global itema = rt.GetControl("itema");
Game.PlaySound("sounds\take.ogg");
Game.TakeItem("itema");
itema.IsTaken = true;
itema.Visible = false;
}
thanks in advance