alphaniner Posted November 27, 2014 Share Posted November 27, 2014 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 More sharing options...
Legotrash Posted November 27, 2014 Share Posted November 27, 2014 The only idea that comes to me right now is to combine GetCrossHairRef with TapKey so if you have a NPC in your crosshair while you press your "activate" button,your disposition gets changed to what your script says so. Link to comment Share on other sites More sharing options...
alphaniner Posted November 27, 2014 Author Share Posted November 27, 2014 (edited) 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 November 27, 2014 by alphaniner Link to comment Share on other sites More sharing options...
Legotrash Posted November 27, 2014 Share Posted November 27, 2014 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 More sharing options...
alphaniner Posted November 27, 2014 Author Share Posted November 27, 2014 (edited) 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 November 27, 2014 by alphaniner Link to comment Share on other sites More sharing options...
alphaniner Posted November 30, 2014 Author Share Posted November 30, 2014 I've got a working and [seemingly] reliable solution, though I had to add GetHeadingAngle to the mix. I've uploaded the mod - Small Talk - for testing. Link to comment Share on other sites More sharing options...
Legotrash Posted December 1, 2014 Share Posted December 1, 2014 Well done! I've already seen your upload,I'm glad things worked out for you. :)How are the tests going so far? Link to comment Share on other sites More sharing options...
alphaniner Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) 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 December 5, 2014 by alphaniner Link to comment Share on other sites More sharing options...
Legotrash Posted December 5, 2014 Share Posted December 5, 2014 Meh,I couldn't help you find what you wanted so no need to thank me. I like the direction you took with this mod,trying to make it less "mechanical" that it was. Link to comment Share on other sites More sharing options...
forli Posted December 5, 2014 Share Posted December 5, 2014 (edited) 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 April 1, 2015 by forli Link to comment Share on other sites More sharing options...
Recommended Posts