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: self.GoExclusive?  (Read 3875 times)

0 Members and 1 Guest are viewing this topic.

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
self.GoExclusive?
« on: October 01, 2009, 05:22:46 PM »

Hi all,

I have a window with a menu which sets itself up and then goes Exclusive. There I click on buttons to open up a range of other windows on top. Each one of those also has in its script self.GoExclusive();

Yet with any of them onscreen, I can go back to the menu and load another one of them. So the one onscrenn has not excluded the menu. I can also drop the Inventory down (although can't interect with its cells).

The docs say: "The user cannot interact with any other object while the window is in exclusive state."

The way it looks to me, yes I can. So I must have misunderstood GoExclusive? Here's a bit of code from one of the windows:

Code: WME Script
  1. #include "scripts\base.inc"
  2. #include "scripts\keys.inc"
  3.  
  4. Game.Interactive = false;
  5. global StateIntro01;
  6. StateIntro01.NavWindow = true;
  7.  
  8. // Set up buttons, (default to on)
  9. var a;
  10. a = this.GetControl("Map");
  11. if(StateIntro01.Map == false || StateIntro01.MapShown == true)
  12.   {
  13.   a.Disabled = true;
  14.   a.Visible = false;
  15.   }
  16. //
  17. a = this.GetControl("Notes");
  18. if(StateIntro01.Notes == false || StateIntro01.NotesShown == true)
  19.   {
  20.   a.Disabled = true;
  21.   a.Visible = false;
  22.   }
  23. ////////////////////////////////////////////////////////////////////////////////
  24. // infinite loop
  25. while(Game.MouseY > 685)
  26.   {
  27.   Sleep(40);
  28.   }
  29. CloseThis();
  30. self.GoExclusive();
  31. ///////////////////////////////////////////////////////////////////////////////
  32. function CloseThis()
  33.   {
  34.   global StateIntro01;
  35.   StateIntro01.NavWindow = false;
  36.   self.Close();
  37.   Game.UnloadObject(this);
  38.   }
  39.  

While the above window is onscreen, I can open other windows.

Any ideas?

Thanks


« Last Edit: October 01, 2009, 10:41:51 PM by Jyujinkai »
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: self.GoExclusive?
« Reply #1 on: October 01, 2009, 05:34:52 PM »

Quote
CloseThis();
self.GoExclusive();
You close and unload the window and THEN try to make it exclusive? Huh ???
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: self.GoExclusive?
« Reply #2 on: October 01, 2009, 06:08:40 PM »

OK bad example. :-[ Maybe I'm doing something similar in the others. I'll ask the programmer and get back to you...
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: self.GoExclusive?
« Reply #3 on: October 01, 2009, 06:28:54 PM »

In that case I'm not sure where to put the self.GoExclusive();

If I put it before all the other code, the code doesn't execute and the Window won't close. I guess the answer is to make the window the same size as the scene?

Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: self.GoExclusive?
« Reply #4 on: October 01, 2009, 10:14:11 PM »

I guess I don't understand how is this window supposed to close. Is it closed automatically or is it closed by player?

In any case, if you call this.GoExclusive(), it does several things. It pauses the script until the player closes the window. It displays the window in exclusive mode. That means, the window makes everything else underneath the window inaccessible.

In your code, the script is terminated before it even reaches the GoExclusive line (your CloseThis() function unloads the window from memory, which effectively kills the script).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: self.GoExclusive?
« Reply #5 on: October 02, 2009, 07:59:02 AM »

Hi Mnem

Thanks for the attention to this.

Let's take another window then, where I'm having the same problem. My "Interactive Map" is the same size as the scene (1024x768), transparent with a graphic 1024x652 in the centre. It sets itself up then goes self.GoExclusive and waits for user input (a user selection then takes does a ChangeScene and closes the Interactive Map window). But if the user mouses off the 652 graphic, he can pull down the inventory window at the top of the screen - yet not interact with it - but he can also pull up the options menu from the bottom of the screen (watched by the Game Daemon, MouseY > 685) and not only interact with it but from it, call other windows on top of the map.

Code: WME Script
  1. // Reveal relevant map sectors
  2. // Display jump buttons
  3.  
  4. // JumpHollyTree
  5. global StateWP2W;
  6. if(StateWP2W.Visited == true)
  7.   {
  8.   a = this.GetControl("JumpHollyTree");
  9.   a.Disabled = false;
  10.   a.Visible = true
  11.   }
  12.  
  13. self.GoExclusive();
  14.  
  15. on "JumpHollyTree"
  16.   {
  17.   var dest = "scenes\27_Woods\WP2W\WP2W.scene";
  18.   // ambience
  19.   Game.PlayMusicChannel(1, "sounds\AmbienceOutside.ogg", true, Random(1,5000));
  20.   // water
  21.   Jump();
  22.   }
  23.  
  24. function Jump()
  25.   {
  26.   Game.ChangeScene(dest,0,0);
  27.   Game.PlaySound("sounds\Success.ogg");
  28.   CloseThis();
  29.   }
  30.  
  31. function CloseThis()
  32.   {
  33.   Game.PlaySound("sounds\GenObjectTug.ogg");
  34.   StateIntro01.MapShown = false;
  35.   this.Close();
  36.   Game.UnloadObject(this);
  37.   }
  38.  

With the command where it is, would you expect that to happen? I'd like to prevent use of other windows, but I don't want to pause the game.

Cheers



« Last Edit: October 02, 2009, 08:10:49 AM by Jyujinkai »
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: self.GoExclusive?
« Reply #6 on: October 02, 2009, 08:11:03 AM »

It depends on how the inventory and the options window are done.
For example in WME demo, the inventory displays simply if you move the mouse pointer to certain position. It has nothing to do with exclusive windows etc., game_loop.script simply checks for mouse position. If you wanted to prevent this, you'd need to employ some global flag "don't show the inventory at this time" and test it in the piece of code that displays the inventory.


Oh and for the previous example, you can actually make a window exclusive without blocking the script, like this:

Code: WME Script
  1. SomeWindow.Exclusive = true;
  2.  

Unlike GoExclusive() method this just sets the window as exclusive and the script continues its execustion without waiting for the player to close the window.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: self.GoExclusive?
« Reply #7 on: October 02, 2009, 03:19:19 PM »

Thanks Mnem

So the Game Daemon overrides everything. That's OK, I know which Windows are affected, so I'll just check in the Daemon that none of them is open. I was hoping GoExclusive would save me that job, but I see why it can't.

Thanks for the tip about setting the exclusive on calling the window. I'm sure that'll come in handy.

Cheers

Noel
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com
 

Page created in 0.082 seconds with 22 queries.