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: Problems with scene change via doubleclick  (Read 3283 times)

0 Members and 1 Guest are viewing this topic.

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Problems with scene change via doubleclick
« on: August 24, 2007, 06:03:48 PM »

Hi there its me again.

Following when clicking on a scene exit region with one click our actor walks there and the scene change starts. Nice, anyway, this lasts sometimes very long so it has been added that the scene cuts immediately when double clicking on the exit region. This works mostly fine but sometimes the following happens:
The fade out starts, the new scene fades in you see also the actor than a very short fadeout-fade in happens and the actor gets "beamed" to its default position set for the scene. The debugger shows that the last scene and the actual scene are the same, in short: The scene gets loaded two times. The problem is, that it happens nearly radomly which makes it nearly impossible to reproduce the problem or the reason which is behind this behaviour. Has anybody any idea or the same strange behaviour?

Thanks for upcoming answers

Amo

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with scene change via doubleclick
« Reply #1 on: August 25, 2007, 05:17:34 PM »

You mean like the ChangeScene gets called from both the LeftClick and LeftDoubleClick handlers? Hmm, that shouldn't be possible. Is there something special about your code? Can you post the two handlers?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: Problems with scene change via doubleclick
« Reply #2 on: August 25, 2007, 06:02:40 PM »

As far as I know they are the same as the ones in the WME 3d demo, only some stuff added.

Code: [Select]

#include "script\user\functions.script"

on "LeftClick"
{
actor.GoToObject(this);
Game.goto_scene_single("...........");
}

on "LeftDoubleClick"
{
actor.GoToObjectAsync(this);
Game.goto_scene_double("...........");
}


///////// defined in "script\user\functions.script"////////////////

method goto_scene_single(new_scene)
{
Game.FadeOut();
ExitScene = true;
Game.ChangeScene(new_scene);
}

method goto_scene_double(new_scene)
{
Game.FadeOut();
ExitScene = true;
Sleep(800);
Game.ChangeScene(new_scene);
}




Hope that helps

regards

Amo

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with scene change via doubleclick
« Reply #3 on: August 26, 2007, 09:16:20 AM »

I see. Well if the code is written like this, then I suppose it can happen.
I'd try two changes:

Code: WME Script
  1. #include "script\user\functions.script"
  2.  
  3. on "LeftClick"
  4. {
  5.   actor.GoToObject(this);
  6.   Game.goto_scene_single("...........");
  7. }
  8.  
  9. on "LeftDoubleClick"
  10. {
  11.   actor.Reset(); // if the leftclick handler is already running, it will get killed by this
  12.   actor.GoToObjectAsync(this);
  13.   Game.goto_scene_double("...........");
  14. }
  15.  
  16.  
  17. ///////// defined in "script\user\functions.script"////////////////
  18.  
  19. method goto_scene_single(new_scene)
  20. {
  21.   if(Game.ChangingScene) return;
  22.   ExitScene = true;     
  23.   Game.ChangeScene(new_scene);
  24. }
  25.  
  26. method goto_scene_double(new_scene)
  27. {
  28.   if(Game.ChangingScene) return;
  29.   ExitScene = true;     
  30.   Sleep(800);
  31.   Game.ChangeScene(new_scene);
  32. }
  33.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: Problems with scene change via doubleclick
« Reply #4 on: August 27, 2007, 12:49:33 PM »

Hi Jan,

Thanks a lot it runs great. If something changes I write again.

Regards

Amo
 

Page created in 0.053 seconds with 21 queries.