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: problem with StopTalking() function  (Read 2744 times)

0 Members and 1 Guest are viewing this topic.

donamin

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
problem with StopTalking() function
« on: November 15, 2012, 08:14:31 AM »

hi every one.
i'm having a problem with entity talking which i have no idea why it's happening.
i set the game so that with right click, StopTalking() of entity is called.
before talking starts, i set talking sprite with SetTalkSprite() function. my code is like this:

Code: [Select]
talkingObject.Talk("text", voice);
Game.Msg("Done");

the problem is, the first time i press right click in the middle of talking, the talking stops, but "Done" message isn't being shown, meaning that code still remains in the "Talk" part.
but after that, when i repeat this, code works fine! i mean this problem just appears the first time i try to stop the entity's talking with right click, any one knows how to solve this?
thanx
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: problem with StopTalking() function
« Reply #1 on: November 16, 2012, 11:53:55 AM »

I am not sure why it is but sometimes slipping in a short sleep statement helps
Logged

donamin

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 27
    • View Profile
Re: problem with StopTalking() function
« Reply #2 on: November 16, 2012, 11:57:50 AM »

yeah, it seems to be a bug!
i did this and it's working fine:

Code: [Select]
talkingObject.TalkAsync("");
talkingObject.StopTalking();
talkingObject.Talk("text", voice);

thanx anyway for reply :)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: problem with StopTalking() function
« Reply #3 on: November 23, 2012, 09:03:45 AM »

If you want some part of the game unskippable, you need to make the game non-interactive, so that the player cannot interrupt the action. Like this:

Code: WME Script
  1. Game.Interactive = false;
  2. talkingObject.Talk("text", voice);
  3. Game.Msg("Done");
  4.  

Always use this pattern when you need a sequence of actions to complete without being interrupted.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.049 seconds with 20 queries.