grmblf Posted November 2, 2009 Share Posted November 2, 2009 Ok, let's say I want to track when player starts a dialog with a NPC and I don't want to add an object script that runs 'onActivate' to every NPC for compatibility (because if I add a script to an object I'm moddifying that object, right?), so what I want is to track on player MenuMode 1009 (dialog), but then I need to retrieve the NPC reference for the script (I need to find out wich NPC the player is talking to!). Is there any feasible workaround for this (except tracking every NPC reference in that cell and calc later distance to the player or such a bizarre approach)? If that's not feasible, is there any way I could add a script in-game to a NPC (not token scripts, but rather scripts attached to the NPC ref itself so I can run an 'onActivate' block)? Any help is much appreciated as I'm pretty lost here. Link to comment Share on other sites More sharing options...
Pronam Posted November 2, 2009 Share Posted November 2, 2009 Use the resultscript in dialogue, it'll run from the character that's talking. Link to comment Share on other sites More sharing options...
documn Posted November 2, 2009 Share Posted November 2, 2009 Or maybe you can use getcrosshairref? Problem with this is that it might not work if an NPC initiates the conversation. Link to comment Share on other sites More sharing options...
grmblf Posted November 2, 2009 Author Share Posted November 2, 2009 hey thanks for the tips, I think I'm gonna track getCrosshairRef because I need to run code for a few seconds. But it sounds to me quite a waste of code as this function has to run constantly on gameMode to be used just a few times a conversation is started, but yeah it solves my problem so by now that's the way to go. Oh I forgot to mention, I want to use this when the player try to buy a spell, perhaps once in the spell barter screen there's a way to get the owner of the spells? I guess if I could change them once the screen is open. Link to comment Share on other sites More sharing options...
Recommended Posts