Changing ActorObject Name in Papyrus?

Post » Tue Jun 19, 2012 5:58 am

Hypothetical example:

My character gets a dog. I have a script that already knows who the dog is, and has a property for it. Let's call it Dog.

I want to do this:

Dog.SetName("Fido")

Of course, this is a fantasy. That function does not exist. Anyone have a solution or work-around?

Thanks in advance for any help I may get on this.
User avatar
jasminε
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Tue Jun 19, 2012 8:47 pm

Use aliases.

EDIT: I mean the alias CK functionality.
User avatar
QuinDINGDONGcey
 
Posts: 3369
Joined: Mon Jul 23, 2007 4:11 pm

Post » Tue Jun 19, 2012 3:23 pm

Thanks... schooling myself now on aliases. Been avoiding them, as they a little confusing. I know how to assign them at Design-time, but not how to change them during run-time. I think I may find my answer by setting match conditions.... so I can apply a condition to the "dog" that the ref-alias should match. So then when I refer to the Alias, I'm then actually referring to the "dog" ?

Anyhow, thanks for the push in the right direction.
User avatar
Marion Geneste
 
Posts: 3566
Joined: Fri Mar 30, 2007 9:21 pm

Post » Tue Jun 19, 2012 6:18 pm

You are probably trying to do the same sort of thing I am...trying to make the name that shows up when you target/cursor over the actor match something other than the original name...like having a script that assigns random names to Bandits when they spawn by picking random sequences from a number of lists, like

FirstNames.Male: Boris, Frank, Harry, Thag, Hans, Fritz, etc.
Firstnames.Female: Inga, Gerda, Susan, Buttercup, Daisy, etc
LastNames.Male: (Firstname.Male)+son, (Firstname.Female)+son, Item+Action (Like Swordslasher, Maceswinger, BloodDrinker, etc)
Lastnames.Female: (Firstname.Male)+datter, (Firstname.Female)+datter, Item+Action (Like Swordslasher, Maceswinger, BloodDrinker, etc)
Nicknames: "...The Gross", "...The Swift", "...The Bold", "...The Strong" etc....
User avatar
Marlo Stanfield
 
Posts: 3432
Joined: Wed May 16, 2007 11:00 pm

Post » Tue Jun 19, 2012 9:57 am

Yes very similar. Amgepo was right... ReferenceAlias is the key. I'm not able to test what I've learned yet, but this is what I understand so far:

If you create a ReferenceAlias in your quest, you can set the DisplayName (pull-down) to a Message. This will rename the Actor assigned to the Alias. the new name will be the "Title" of the message sou selected. This change is supposed to be permanent. So even if you point the ReferenceAlias to a new Actor, the Name-Change should remain in effect.

So what you and I need to do, is something like this
Alias_ChangeNameOf.ForceRefTo(Actor2Rename)
Alias_ChangeNameOf would have DisplayName set to our Custom Message

The custom message would have to use text-replacement in the title, derived from another Alias. (Set the owner quest on the message to the quest with your aliases)

In the Message Title:


then something like this in your script to do the rename.
Alias_GetNameFrom.ForceRefTo(ObjectWithDesiredName)
Alias_ChangeNameOf(Actor2Rename)

Seems like a strange way of doing it, but the only way perhaps. Is there another way to change the title of a message during runtime?

I'll post any success I have (or don't have). I hope you will too.
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am

Post » Tue Jun 19, 2012 12:07 pm

Yeah, that worked. But only once. Can't seem to apply the same routine to the same character a second time.
User avatar
Jamie Moysey
 
Posts: 3452
Joined: Sun May 13, 2007 6:31 am

Post » Tue Jun 19, 2012 8:53 pm

Try enabling Allow Reuse In Quest for the alias to use the same character again?
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am

Post » Tue Jun 19, 2012 7:48 am

Tangentially related: can the player character have a ShortName, and how would she set it?
User avatar
Eve Booker
 
Posts: 3300
Joined: Thu Jul 20, 2006 7:53 pm

Post » Tue Jun 19, 2012 5:25 pm

Try enabling Allow Reuse In Quest for the alias to use the same character again?

I did this, but without luck. Perhaps I didn't revert to an old enough save (prior to adding this quest) I will try again when I get home. Thanks.
User avatar
Eilidh Brian
 
Posts: 3504
Joined: Mon Jun 19, 2006 10:45 am

Post » Tue Jun 19, 2012 7:57 am

Tangentially related: can the player character have a ShortName, and how would she set it?


Hmm... I hadn't thought of a reason to have a Shortname on the Player... so I've not encountered a way to do it. That's an interesting question, and I would love it if you found an answer and posted it here.
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am


Return to V - Skyrim