Jump to content


Any danger in SetDialogue("",Myself)?


6 replies to this topic

#1 Xyx

  • Members
  • 26 posts

Posted 20 March 2012 - 01:08 AM

I wrote a script that has Thieves automatically Hide In Shadows when the player turns on stealth mode (with a hotkey.) Because hidden characters cannot be healed and leaving the shadows can take such a long time, I have the Thief initiate dialogue with himself (PlayerDialog(Myself)) when stealth mode is turned off. This instantly reveals him.

This works fine for the main character and for the NPCs that I tried it on. You get a little red "<GABBER>- has nothing to say to you" line in the text area, but that's not a big deal.

However, if you start a multiplayer game and make more than one custom character, the not-Player1 character will actually initiate dialogue and say "Why do you waste my time with idle banter?", complete with pausing the game and forcing you to click End Dialogue. It would appear that the not-Player1 characters have MULTIG.DLG assigned, which handles being kicked out of the party.

I can SetDialogue("",Myself) before initiating dialogue. This seems to work fine. However, I'm afraid it'll mess something up that I don't know about... break the game somehow. I'm not familiar with how the game handles dialogues. Is there any danger in doing this?

#2 argent77

  • Members
  • 230 posts
  • Gender:Male

Posted 20 March 2012 - 02:53 AM

You should create a spell with effect 47 (Remove Invisibility) and call it from your script. It's much easier and doesn't have any side effects.

Using SetDialogue("",Myself) on a party member is dangerous because mods or the game itself could change it any time.

#3 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 20 March 2012 - 03:53 AM

Plus, it will break Multi-player kickout dialogues and any mods that depend on non-protagonist PCs using multig.dlg.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#4 Xyx

  • Members
  • 26 posts

Posted 20 March 2012 - 04:03 AM

View Postargent77, on 20 March 2012 - 02:53 AM, said:

You should create a spell with effect 47 (Remove Invisibility) and call it from your script. It's much easier and doesn't have any side effects.
I'm a bit of a purist and I wouldn't want my script to do anything that the player (or one of the default scripts) couldn't also order the character to do.

View Postberelinde, on 20 March 2012 - 03:53 AM, said:

Plus, it will break Multi-player kickout dialogues and any mods that depend on non-protagonist PCs using multig.dlg.
Well, that's the funny thing... I did actually kick someone out after that and it still seemed to work fine.

Maybe the game resets the dialogue when someone gets kicked out. Wouldn't that be necessary anyway, considering other parts of the game can call SetDialogue() as well?

Edited by Xyx, 20 March 2012 - 04:08 AM.


#5 argent77

  • Members
  • 230 posts
  • Gender:Male

Posted 20 March 2012 - 05:33 AM

View PostXyx, on 20 March 2012 - 04:03 AM, said:

I'm a bit of a purist and I wouldn't want my script to do anything that the player (or one of the default scripts) couldn't also order the character to do.
The game doesn't offer many ways to make oneself noticeable at will, so I personally don't have a problem (ab)using a spell effect as long as it's in the spirit of AD&D rules. But this is up to you.

By using PlayerDialog(Myself) you're merely exploiting a side effect which works in BG2 but might work or not in GemRB or the upcoming BGEE.

#6 Xyx

  • Members
  • 26 posts

Posted 20 March 2012 - 06:48 AM

View Postargent77, on 20 March 2012 - 05:33 AM, said:

The game doesn't offer many ways to make oneself noticeable at will
No, but it does offer this one. You can press F1 and then click on yourself and it'll immediately make you visible. You can also open a container or click on an item on the ground.

View Postargent77, on 20 March 2012 - 05:33 AM, said:

By using PlayerDialog(Myself) you're merely exploiting a side effect which works in BG2 but might work or not in GemRB or the upcoming BGEE.
This is undoubtedly blasphemous, but I have never heard of either. What are the odds of anyone wanting to use my script with those?

#7 Xyx

  • Members
  • 26 posts

Posted 20 March 2012 - 07:33 AM

Right... it should be SetDialogue(""), not SetDialogue("",Myself). I'd edit my first post and the topic title if I could.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users