Jump to content

CK->Alias: Is there a way to remove "Display Name" from Reference Alias without checked "Clear Name When Removed"?


g2mXagent

Recommended Posts

I'm trying to create a dynamic owner assignment system:

When you point to a "furniture" in a settlement, you can use yourself as the owner of the "furniture" to prevent other NPCs using it. You can also cancel your owner status at any time. A further plan: to allow all companion to enjoy this feature. Eventually you will see a similar "furniture" in the settlement: [Piper's Bed] [Your Chair] [Preston's Power Armor]...


RjnnZTj.png


Currently, I can assign myself as the owner of "furniture" at any time and cancel it at any time. The problem is that I can't modify the name of "furniture" in real time. In fact, I can change "Bed" to "Your Bed" in real time, but I can't cancel it.


Here is my method:

Add a new Perk with two Entries. basically:

when you are not the owner, assign you as the owner: (this is Entry script fragment)



akTargetRef.SetActorRefOwner(Game.GetPlayer())
akTargetRef.AddKeyword(kwPlayerOwned)


when you are the owner, clear the ownership data of "furniture":



akTargetRef.SetActorRefOwner(NONE)
akTargetRef.RemoveKeyword(kwPlayerOwned)



rI5rBqx.png


I can't use "IsOwner==Player" to judge the target status, because when there is no "ownership data", this condition is still valid. so I use my custom keyword "kwPlayerOwner" to judge.


This system works well. but I also need to remind the player who this "furniture" belongs to. so I started to study the Quest Alias system.


I created a simple "Alias" that does only one thing: find the "furniture" that match the filter and rename it.


KjAB6lj.png


the Perk Entry Script becomes like this:



akTargetRef.SetActorRefOwner(Game.GetPlayer())
akTargetRef.AddKeyword(kwPlayerOwned)
ChangeObjectNameRefAlias.Start() ;ChangeObjectNameRefAlias is the Quest which contain the Alias.
ChangeObjectNameRefAlias.Stop()



As the result in the first screenshot, it works fine. now I need to cancel this rename when I clear the ownership data. I tried Reset(), but it either didn't work or let the "furniture" disappear. I don't know what to do.
Edited by g2mXagent
Link to comment
Share on other sites

It is permanent unless clears name when removed is checked. That simply removes any name changes. As you're wanting clear ownership, thereby also removing the name that indicates who the owner is, isn't this what cleaning the name when the alias is removed will do for you?

Link to comment
Share on other sites

Yes [ clear name when removed ] is what you want and probably not [ stores text ] so it can release.

 

I recently published an update to a settler mod that renamed all refcollection members so I could see who was being manged by the mod in test. Forgot to check [ clear name when removed ] which quite rightly upset a bunch of folks using custom names ... good news it is retrospective* :wink:

 

EDIT: (*) that is you need to add then remove for it to take effect, it doesn't revert once they are removed.

Link to comment
Share on other sites

I want the Player to have ownership of multiple "furnitures" at the same time. If I check "clear name when removed", when I finish the quest, all "ownership" is cleared. Maybe I should update the matching filter to get a more accurate match, such as only the "furniture" that the current mouse points to. This seems to be a challenge.

Edited by g2mXagent
Link to comment
Share on other sites

Have a second permanent running quest that never shuts down with collectionaliases that never reset to hold the long term assigned stuff with display name over-ride. AddRef() and RemoveRef() from them as needed.

Link to comment
Share on other sites

Yes [ clear name when removed ] is what you want and probably not [ stores text ] so it can release.

 

I recently published an update to a settler mod that renamed all refcollection members so I could see who was being manged by the mod in test. Forgot to check [ clear name when removed ] which quite rightly upset a bunch of folks using custom names ... good news it is retrospective* :wink:

 

EDIT: (*) that is you need to add then remove for it to take effect, it doesn't revert once they are removed.

 

I checked [stores text], because the wiki told me:

Stores Text: Check this if the alias is used in text replacement. (see Text Replacement)

https://www.creationkit.com/index.php?title=Quest_Alias_Tab

Link to comment
Share on other sites

Display Name Over-Ride = [ Uses Stored Text ]

[ Stores Text ] is if you are using the alias name in text replacement like <Alias=HelloWorld>

 

I have had problems mixing them to pass-through on the same alias. If you do [ Stores Text ] output on a [ Uses Stored Text ] input, it may not release/clear when removed.

Link to comment
Share on other sites

Display Name Over-Ride = [ Uses Stored Text ]

[ Stores Text ] is if you are using the alias name in text replacement like <Alias=HelloWorld>

 

I have had problems mixing them to pass-through on the same alias. If you do [ Stores Text ] output on a [ Uses Stored Text ] input, it may not release/clear when removed.

Thanks for reminding me, I should choose RefCollectionAlias instead of ReferenceAlias.
Thank you so much!!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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