Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: TomGamer on August 04, 2015, 12:10:22 AM

Title: Mainmenu scene problem? Book creation.
Post by: TomGamer on August 04, 2015, 12:10:22 AM
Hi i have some problems with mainmenu scenes.

as you can see here in 0:20 - 0:24
https://www.youtube.com/watch?v=aTqKWvm2hn0

Between menu clicks i spot dark background with actor.

I know maybe its a newbiew question but very thanks for help.

What i use:

on "buttonBonus"
{
   Game.ChangeScene("scenes\001_MainMenu\mmBonus\mmBonus\mmBonus.scene");
   Game.UnloadObject(this);
}


My second question is, it is possible to create "book" with topics? In my video above is in 0:40.
I have buttons but dont know how to on buttonclick se different text?

Very very thanks for any help!
Title: Re: Mainmenu scene problem? Book creation.
Post by: anarchist on August 04, 2015, 08:42:21 AM
Hi TomGamer, welcome to Wintermute!

For your first question:

It seems that in the current scene (Menu) you have loaded your main actor but forgot to hide him. This is probably done in your scene_init.script. You probably don't see the actor because in this scene you are showing a window with buttons etc. which overlaps the actor. In the Menu scene_init.script, you should have something like the following:

Code: WME Script
  1. actor.Active = false;
  2.  

which will hide the actor in the current scene. Take care to show the actor in the scenes you want him visible:

Code: WME Script
  1. actor.Active = true;
  2.  

You can refer to http://docs.dead-code.org/ in Scripting in WME -> Script language reference -> Actor for explanation on the Active property.

For your second question:

What I understand is that you want to click on the topics on the left and show the content in the book in the center. You have several buttons on the left with the topics and a static text in the center. You can have something like the following for each button:

Code: WME Script
  1. on "button"
  2. {
  3.         var textBox = this.GetControl("name_of_static_text");
  4.         textBox.Text = "the text you want to show";
  5. }
  6.  

There is a difficult part here, especially if you are new to programming and don't fully understand objects and objects inside objects. This is because you might have your static text (an object) inside a sub-window (another object), in which case you must change the code to something like this:

Code: WME Script
  1. on "button"
  2. {
  3.         var subWindow = this.GetControl("name_of_subwindow");
  4.         var textBox = subWindow.GetControl("name_of_static_text");
  5.         textBox.Text = "the text you want to show";
  6. }
  7.  

If you have difficulties finding the static text you can show us your window in WME's WindowEdit.
Title: Re: Mainmenu scene problem? Book creation.
Post by: TomGamer on August 04, 2015, 11:55:52 AM
anarchist: Thanks so much sir! I will test it soon as possible!