Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: How address a container entity  (Read 2793 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
How address a container entity
« on: December 24, 2008, 06:35:09 PM »

I know how to load and access a normal button, static and nested window and am experimenting now with container entities held by a window.

How do you address (access) a container entity held in a window?

After I insert a container entity in a window and link it to a sprite, if I try to load the window it's in in game.script this way (there's a global contwin; in base.inc--contwin is the name of the window; container is the name of the container; ent is the name of the sprite entity that the container holds):

Code: WME Script
  1. contwin = Game.LoadWindow("scenes\contwin.window");
  2. contwin.Visible = true;
  3. var c = contwin.GetControl("container");
  4. var ent = contwin.GetEntity("ent");
  5.  

I get a black screen and freeze.

Also to refer to the sprite entity held in the container, do you have to put its path or just its name?

And lastly--can you put a container entity that holds a sprite inside a static and access it--then how would you access that?

Any help is appreciated.  :  )
« Last Edit: February 19, 2009, 08:30:31 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How address a container entity
« Reply #1 on: December 24, 2008, 08:52:42 PM »

It should look like this:
Code: WME Script
  1. contwin = Game.LoadWindow("scenes\contwin.window");
  2. contwin.Visible = true;
  3. var c = contwin.GetControl("container");
  4. var ent = c.GetEntity();
  5.  

You need to ask the container to give you the entity it contains.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: How address a container entity
« Reply #2 on: December 24, 2008, 09:22:18 PM »

Thanks, Mnemonic.  :)
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
 

Page created in 0.06 seconds with 25 queries.