supreme kotor Posted December 22, 2013 Share Posted December 22, 2013 Hey guys Supreme Kotor here I would first like to apologize for how my previous mods ended and for my leaving of the community, I gave up on modding. A few days ago I realized my mistake and would like to return to modding. Now for my question, I was wondering what would be the code for a script that starts a dialog with the closest NPC? If this isn't possible I understand why, but I know that you can get NPC's, placables, and etc... Through code like this: Show spoiler (hidden content - requires Javascript to show) object oPc=GetFirstPC(); object oRand=GetNearestObject(OBJECT_TYPE_ALL,oPc,1); So I feel as if what I am asking should be just an adaption of this code. Thanks- Supreme Kotor Link to comment Share on other sites More sharing options...
Fallen Guardian Posted December 22, 2013 Share Posted December 22, 2013 It should look a little like this: void main() { object oPC = GetFirstPC(); object oNearest = GetNearestObject(OBJECT_TYPE_CREATURE, oPC); AssignCommand(oNearest, ActionStartConversation(oPC)); } I haven't tested this at all but it should work. Also, I made the object a creature as I'm assuming you only want to talk with NPCs, not placeables or anything of that sort. Link to comment Share on other sites More sharing options...
supreme kotor Posted December 23, 2013 Author Share Posted December 23, 2013 Yeah that script works! Thanks FG Link to comment Share on other sites More sharing options...
Fallen Guardian Posted December 24, 2013 Share Posted December 24, 2013 Yeah that script works! Thanks FG Glad I could help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.