Jump to content
ℹ️ Intermittent Download History issues ×

[LE] Is there a script condition for checking if player is in dialogue


Recommended Posts

My mod (Tiefling) is set up to automatically make game saves at 3, 10, or 30 minute intervals (players choice). This works fine except if the player is in dialogue with an NPC. It will attempt to save and then give an error message that it can't save at this time.

 

I have tried scripting the "isTalking" condition, but CK doesn't seem to recognise it.

 

I have tried:

if mySelf.isTalking

if mySelf.isTalking==1

if game.getPlayer().isTalking==1

 

Is there any other way to check if your player is in dialogue with another NPC ?

 

Thanks,

dePog

Link to comment
Share on other sites

It's a pain, but it can be done.

 

The reason your approach failed is that: a. IsTalking only works on NPCs/talking activators and b. is a condition with no equivalent papyrus function, so you can't call it directly from a script (the usual workaround for accessing such things from a script involves putting it as a condition on a spell and checking for that, or potentially firing a quest with search aliases).

 

There are some other approaches here, too:

 

https://www.creationkit.com/index.php?title=Talk:GetDialogueTarget_-_Actor

Edited by foamyesque
Link to comment
Share on other sites

Good grief! Makes you wonder about the sanity of whoever created Papyrus, lol.

 

Thanks foamyesque, I'll give that scripted link a try.

I question his sanity(Jeff Lundin) all the time, but he's also said that papyrus was not intended to be used in the way that we're using it and that he only created it for the purpose of the various puzzles you come across in the game. It only just so happens that the functions made could be taking much further the he expected.

 

So if you feel there should have been a script function for X but there is a condition function for X, minus an important bit to go with it(IsTalking is a good example).. most likely because the team didn't have a need for it.

 

Papyrus wasn't designed with detailed and advanced scripting in mind.

Edited by Rasikko
Link to comment
Share on other sites

 

 

 

Good grief! Makes you wonder about the sanity of whoever created Papyrus, lol.

Thanks foamyesque, I'll give that scripted link a try.

I question his sanity(Jeff Lundin) all the time, but he's also said that papyrus was not intended to be used in the way that we're using it and that he only created it for the purpose of the various puzzles you come across in the game. It only just so happens that the functions made could be taking much further the he expected.

So if you feel there should have been a script function for X but there is a condition function for X, minus an important bit to go with it(IsTalking is a good example).. most likely because the team didn't have a need for it.



"Papyrus wasn't designed with detailed and advanced scripting in mind."

 


lol, yeah, I figured that. But it feels good to have a whinge now and then :smile:

Edited by dePog
Link to comment
Share on other sites

 

Good grief! Makes you wonder about the sanity of whoever created Papyrus, lol.

 

Thanks foamyesque, I'll give that scripted link a try.

I question his sanity(Jeff Lundin) all the time, but he's also said that papyrus was not intended to be used in the way that we're using it and that he only created it for the purpose of the various puzzles you come across in the game. It only just so happens that the functions made could be taking much further the he expected.

 

So if you feel there should have been a script function for X but there is a condition function for X, minus an important bit to go with it(IsTalking is a good example).. most likely because the team didn't have a need for it.

 

Papyrus wasn't designed with detailed and advanced scripting in mind.

 

 

My favourite bit is that it shipped without arrays, so if you look at, say, the script for some of the major quests, you get property declarations for days. Hundreds of lines of duplicated code because you couldn't just make a list.

Link to comment
Share on other sites

Oh yes, yes. The CW scripts immediately come to mind.

 

There was some funny script comments about that from the person coding one of the CW scripts. Unfortunately for him, arrays were implemented long after he finished those scripts.

Link to comment
Share on other sites

A good workaround is to just check if the player's looking controls are enabled. If they are they won't be in the dialogue choice menu.

 

https://www.creationkit.com/index.php?title=IsLookingControlsEnabled_-_Game

This is a nice workaround!

 

Another more direct approach would be to use the SKSE function IsMenuOpen("Dialogue Menu")

https://www.creationkit.com/index.php?title=IsMenuOpen_-_UI

If that string "Dialogue Menu" doesn't work, there's tonnes of others on that page to listen for.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...