Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: entity containers at windows  (Read 3343 times)

0 Members and 1 Guest are viewing this topic.

annapad

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • View Profile
entity containers at windows
« on: January 25, 2010, 12:06:31 PM »

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
Code: [Select]
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
Code: [Select]
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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entity containers at windows
« Reply #1 on: January 26, 2010, 08:49:12 AM »

Hm, I don't really see why a Game.DeleteWindow() call should make hidden window content visible... However, you can try explicitly hiding the window before deleting it.

Code: WME Script
  1. on "x"
  2. {
  3.   this.Visible = false;
  4.   Game.DeleteWindow(this);
  5. }
  6.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

annapad

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • View Profile
Re: entity containers at windows
« Reply #2 on: January 27, 2010, 12:07:58 AM »

Mnemonic thanks for your reply... I was hoping that the solution you gave me should work but no...
 it doesn't work either...  ??? and I'm wondering why... everything works perfectly except this... when pressing the x button... ???
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entity containers at windows
« Reply #3 on: January 27, 2010, 12:21:06 PM »

Can you make some small demo reproducing the issue? I guess there must be some other factor involved.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

annapad

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • View Profile
Re: entity containers at windows
« Reply #4 on: January 27, 2010, 01:07:41 PM »

Mnemonic
thanks very much again
I sent you a pm with a link in order to download the demo.,... look at it when you have time...
Thanks again ;D
Logged
 

Page created in 0.077 seconds with 21 queries.