Jump to content

Copying the player's name


Lanceor

Recommended Posts

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

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

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

  • Recently Browsing   0 members

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