Lanceor Posted October 25, 2011 Share Posted October 25, 2011 Is there any script function or other method of copying the player's name onto an NPC (in effect, giving the NPC the same name as the player)? Link to comment Share on other sites More sharing options...
fg109 Posted October 25, 2011 Share Posted October 25, 2011 OBSE has the GetName and SetName functions. Link to comment Share on other sites More sharing options...
Lanceor Posted October 26, 2011 Author Share Posted October 26, 2011 Thanks for the suggestion! I finally found a solution, but it wasn't using the above functions. GetName works well to obtain a string... but the Oblivion Script engine doesn't really provide a convenient way to store string variables for use later. (There's probably a way to do it, but I haven't discovered it at the time of writing this.)setname StringVar NPCObject sets the NPC's name literally to "StringVar" and doesn't recognise "StringVar" as a variable. The solution I used was to create a dummy inventory object (a gem or something carriable) and then used the CopyName function. After which... Set TempPlayerCopy to PlayerRef.CreateFullActorCopy CopyName TempPlayerCopy DummyInventoryObject CopyName DummyInventoryObject NPCToBeRenamed TempPlayerCopy.DeleteFullActorCopy Why not just CopyName PlayerRef NPCToBeRenamed? It turns out that Player and PlayerRef are invalid objects for the CopyName function. Because of the problems that CreateFullActorCopy can create, the above solution probably should be used sparingly. Fortunately for me, I needed to create a copy of the player in that particular quest anyway. Unless someone comes up with a more elegant solution, I'll consider this scripting problem solved. :) Link to comment Share on other sites More sharing options...
fg109 Posted October 26, 2011 Share Posted October 26, 2011 Vanilla Oblivion doesn't allow the use of string variables. You need OBSE or other plug-ins for that. It's easy to do: string_var Name --------------- let Name := Player.GetName ActorRef.SetName Name If that doesn't work, you might need to use this instead: string_var Name --------------- let Name := Player.GetName ActorRef.SetName $Name Link to comment Share on other sites More sharing options...
HeyYou Posted October 26, 2011 Share Posted October 26, 2011 If you use OBSE, it has the ability to use string variables...... Link to comment Share on other sites More sharing options...
Lanceor Posted October 27, 2011 Author Share Posted October 27, 2011 Thanks for the additional tidbits - that should do the trick! :thumbsup: Would you believe that I spent several hours over two days looking up strings in the CS wiki and Google and all I got was Pluggy info? Link to comment Share on other sites More sharing options...
Recommended Posts