Jump to content

Retrieving "active" reference while on MenuMode


grmblf

Recommended Posts

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

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

  • Recently Browsing   0 members

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