Jump to content

Get player's dialogue 'target'


alphaniner

Recommended Posts

I'm trying to create a 'passive' speechcraft mod that conditionally modifies an NPC's disposition to the player when the player talks to the NPC. But the only way I've found for a global script to get the player's dialogue 'target' is to use GetCrossHairRef in Gamemode, and that's a nasty kludge. Someone please tell me there's a better way!
Link to comment
Share on other sites

It looks like TapKey stimulates a keypress. I think I'd need GetKeyPress to do what you're suggesting.

 

But in any case, I'm really hoping there's a way to get the 'target' after dialogue has commenced. That way I could nix the GameMode block altogether, and instead of running ~100% of the time the script would only run in menumode 1009 (approximately 0% of the time :) ).

Edited by alphaniner
Link to comment
Share on other sites

Major mistake,sorry! I haven't messed with those commands for quite awhile. I should've read the command's description first. :sweat:

 

Here's an idea: Make two quest scripts,one of them disabled from the beginning. The enabled one will only have the menumode,from there the second one will get enabled which will be in gamemode. The second one can get the ref,do the thing you want it to do and then stop itself with StopQuest.

Link to comment
Share on other sites

No worries about the mistake.

 

If I understand your idea correctly, the disposition change would occur after exiting dialogue. That's not how I 'envisioned' it, but it's a clever solution and a reasonable compromise. Thanks!

 

Edit: I may have come up with a decent way to do it in MenuMode. Using GetNextRef, GetDistance, and GetCurrentAIPackage I think it will be possible to determine the nearest NPC to the player who is using a 'Dialogue' AI package. Need to do some testing though.

Edited by alphaniner
Link to comment
Share on other sites

I haven't had any bug reports, and I know at least one person has been running it for a while now. All things considered the script is pretty straightforward though, so there's very little opportunity for surprises.

 

Thanks again for your suggestion. Even though I went a different route, knowing there was something better than an 'always on' GameMode solution kept me motivated.

Edited by alphaniner
Link to comment
Share on other sites

Wait, maybe you're searching for this function: GetActiveMenuRef

 

You simply need to do this:

ref actor
Begin MenuMode 1008
   ...
   Let actor := GetActiveMenuRef 1008
   ...
End
"actor" variable will contain the actor you're talking to.
Edited by forli
Link to comment
Share on other sites

  • Recently Browsing   0 members

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