Jump to content

Changing an actors name in game.


Recommended Posts

As the titles says, I'd like to make it possible for the player to change an actor's name in game. The problem I have is that I have no clue on how to make some sort of popup-box where the player can type, like how you name your character when creating it. Does anyone happen to know how I can get this popup-box to open or another way to do this?

 

Thanks!

 

 

Link to comment
Share on other sites

In order to change it, you'll need to use SKSE's SetName function, which is easy enough. (Make sure you've installed the 7z archive version of SKSE to use its functions in a script.) For the pop up messagebox, you'll need:

 

http://www.nexusmods.com/skyrim/mods/57308/?

 

My mod Name Your Horse uses a method VERY similar to what you're looking for, with some added conditions to make sure the NPC being named is a bought horse. It also includes an MCM, which you don't need, but the basic script (I modified it to fit your needs):

Scriptname NYHControlScript extends Quest  
{Governs all horse naming-related functions.}

Message Property RenameHorse Auto; message property, points to a message of type messagebox
GlobalVariable Property HorseRenameKey Auto 
Actor Property ActorToRename Auto; fill this property http://skyrimmw.weebly.com/skyrim-modding/how-to-fill-properties-skyrim-modding-tutorial

Event OnKeyDown(Int KeyCode); change the event as you see fit, this one is sent when the appropriate, MCM set hotkey is sent
	If KeyCode == HorseRenameKey.GetValueInt()
		If !Utility.IsInMenuMode()
			String NewName = ((Self as Form) as UILIB_1).ShowTextInput("Change Actor Name", ""); "" means the initial value of the box will be nothing
			If NewName != ""; if player entered SOMETHING
				ActorToRename.SetDisplayName(NewName)
				RenameHorse.Show(); shows a messagebox saying you've renamed teh actor
			EndIf
		EndIf
	EndIf
EndEvent

Link to comment
Share on other sites

  • 2 weeks later...

There are limitations on renaming actors though.

If the Actor is in an Alias that has the flag set as Stores Text then the rename will fail.

Also side effects of renaming actors that are followers is they may lose their activate to talk to option.

 

There is no be all never fail way to rename any actor from the research and experimented with.

Some actors will rename without issue, some will rename with issues eg: broken dialogue, some just will not rename.

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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