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: How to know if any DialogBranch is running?  (Read 3226 times)

0 Members and 1 Guest are viewing this topic.

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
How to know if any DialogBranch is running?
« on: January 21, 2008, 09:50:54 AM »

Hi, I want know if any DialogBranch is running at current time, is it possible?

Other question: Is necessary to assign a name to DialogBranch? In the WME book documentation, useses Game.StartDlgBranch(); whitout any name [Game.StartDlgBranch("DialogName");], but it seems to work fine.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to know if any DialogBranch is running?
« Reply #1 on: January 21, 2008, 05:33:43 PM »

No, there's no function to query current dialogue branch. I don't see what it would be useful for, but if you need it, you can use a variable.
Dialogue branches are used to define the context of each response, specifically the AddResponseOnce and AddResponseOnceGame. If a single script contains multiple dialogue branches and if some of them are using the AddResponseOnce* methods, you need to explicitly name the dialogue branches. Otherwise you don't have to.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: How to know if any DialogBranch is running?
« Reply #2 on: January 21, 2008, 07:08:07 PM »

I can rewrite the methods StartDlgBrnch and EndDlgBrnch including a variable for example DialogRun=true in Start and DialogRun=false at end. It works, but the problem is when a DlgBrnch is inside another, in this case when the second DlgBrnch ends, it puts the variable DialogRun=false, but the parent DlgBrnch is still running.

Game.StartDlgBrnch("first")
     code....
     blah, blah...
     Game.StartDlgBrnch("second")
          code....
          blah, blah...
     Game.EndDlgBrnch("second")
     code...
Game.EndDlgBrnch("first")

I'm writting a script that runs when any character is talking EXCEPT when the game is inside a dialog.

Any suggestion?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to know if any DialogBranch is running?
« Reply #3 on: January 21, 2008, 07:22:12 PM »

How about overriding the GetResponse() method?

Code: WME Script
  1. method GetResponse(AutoSelectLastResp)
  2. {
  3.   global g_IsInDialog = true;
  4.   var Ret = this.GetResponse(AutoSelectLastResp);
  5.   g_IsInDialog = false;
  6.   return Ret;
  7. }
  8.  


EDIT: And happy birthday, btw ::beer
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: How to know if any DialogBranch is running?
« Reply #4 on: January 22, 2008, 02:11:07 PM »

Thanks, I'll try it and write if this works fine  ;)
Logged
 

Page created in 0.046 seconds with 25 queries.