Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Amo on August 22, 2006, 10:05:46 AM

Title: Get name of an window
Post by: Amo on August 22, 2006, 10:05:46 AM
Hi there. As written in the script reference we can get the name of a scene with scene.name.
Is there an eqal way to get the name of a window? name.window doesn't work.

Thanks for help
Title: Re: Get name of an window
Post by: metamorphium on August 22, 2006, 11:01:33 AM
var name = YourWindow.Name; works fine for me.

see documentation -> scripting reference -> window object

Title: Re: Get name of an window
Post by: Amo on August 22, 2006, 11:59:22 AM
Thank you, we try it out, but one thing: Maybe I am blind, but I cannot find it in the scripting reference.
Title: Re: Get name of an window
Post by: metamorphium on August 22, 2006, 12:36:30 PM
you should look in the window object into attribute sections. if you press ctrl+f in help file and type there Name, it will eventually lead you there.
Title: Re: Get name of an window
Post by: Amo on August 23, 2006, 04:30:42 PM
Somehow we are lost in WMEs scripting, or never found really a red line. Anyway. We got that, but somehow on another way.

Nearly the similar problem, but other objects.
When we add an entity object (or defining a region) and call it e.g. "test" we want to add an variable
e.g.

var test = ...
Game.Msg(test);

to it inside the scene_init.script. The three dots mean, that we do not know what we have to add there. The goal in this test is, to get the test message. WME got the name already and shows it in the debugger, but we get an error.

=======================
Also unclear is the following:

var test;
test = Scene.GetNode("test");
Game.Msg(test);

With this code snippet we get in debugging mode the following line:
[entity objects]
When we change the last line of the script to:

Game.Msg(test.Name);

We get the following in the debugger:
[test]
As far as good. If we want to deactivate the object with the following line:

test.Visible = false;

The object doesn't react in anyway. No errors, still visible.
Interesting is, that the "test" reacts on

Skip.To(500,500)

 ???



Title: Re: Get name of an window
Post by: Mnemonic on August 23, 2006, 05:38:53 PM
Somehow we are lost in WMEs scripting, or never found really a red line. Anyway. We got that, but somehow on another way.

Nearly the similar problem, but other objects.
When we add an entity object (or defining a region) and call it e.g. "test" we want to add an variable
e.g.

var test = ...
Game.Msg(test);

to it inside the scene_init.script. The three dots mean, that we do not know what we have to add there. The goal in this test is, to get the test message. WME got the name already and shows it in the debugger, but we get an error.
I'm sorry, but I really don't know what you're asking about. I though you were asking about how to reference a scene entity in a script, but obviously you already know of the Scene.GetNode() method, so...


As far as good. If we want to deactivate the object with the following line:

test.Visible = false;
Entities don't have .Visible attribute. It should be:

test.Active = false;
Title: Re: Get name of an window
Post by: Amo on August 23, 2006, 05:46:59 PM
The first thing, was the original problem, than we solved it under the equals I added the rest. Thank you, you solved the rest, with active, everything is nice.
Very fine.