portbash Posted December 16, 2014 Share Posted December 16, 2014 Right now I'm using setName on a current references baseObject: ActionRef.getBaseObject().setName("Name") Now, by renaming an object, lets say, the reference is the common bed furniture, all(!) common beds in the world will use that new name. How to create an unique "copy" of this reference to apply the new name to just this reference? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 16, 2014 Share Posted December 16, 2014 If you have already placed the reference object...Edit the reference objectClick on the button that says "Edit Base"The base form will open upChange the ID name of the base formChange the display name of the form to what you wantOK to save the changesYou'll be asked about creating a new form because the ID name changedSay yesYour reference will now be pointing to this new base form. If you have multiple references already placed...Do the above for one of them, then you'll need to replace all the others with references of the new base form. If you have not placed any references...Go to the location in the Object window that has the pre-existing base forms which are similar to what you wantEdit oneChange the ID name and any other informationPress OK to save the changesYou'll be asked about creating a new form because the ID name was changedSay YesUse this new form to drag-n-drop into the render window for placement of your reference(s) If this is a stock placed reference...The above still works simply remember that if another mod edits the same reference, the last loaded gets to work in the game. Link to comment Share on other sites More sharing options...
portbash Posted December 17, 2014 Author Share Posted December 17, 2014 Thx Ishara... but I was talking about ingame =] Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 17, 2014 Share Posted December 17, 2014 Next time, please specify in or out of game so time is not wasted.... No, you cannot change the name of just one specific instance using SKSE's SetName. SKSE's SetName changes the name on the base form and thus it will affect all instances. You could in theory use the OnCellAttach event to store the previous name and set the name so that it displays what you want and then use the OnCellDetach event to revert the name. You'd need to toggle a global variable between 0 & 1 so that your OnPlayerLoadGame event can set it to display the correct name. But there may be an issue with that, papyrus is case insensitive and as a result it will store the previous name in all lower case. If you knew that the original base name was always going to be the same (i.e. no other mod changing the name) then you could pre-store the name with the upper case letters. Another possibility would be to create a quest and put the reference into an alias and have the name changed via the alias (Display Name). Downside (and may be beneficial to you) is that the name change is permanent even if the reference is removed from the alias. See Quest Alias Tab for more info. Link to comment Share on other sites More sharing options...
portbash Posted December 18, 2014 Author Share Posted December 18, 2014 Next time, please specify in or out of game so time is not wasted.... Didn't the code example made that clear? Anyway... thx for the reply. +A pitty. Link to comment Share on other sites More sharing options...
smashly Posted December 18, 2014 Share Posted December 18, 2014 SKSE has SetDisplayName that only sets the display name of the object reference and doesn't effect the BaseObject name.ObjectRef.SetDisplayName("My Bed, Keep Off!") SKSE also has GetDisplayNameSo if your using SetDispalyName, use GetDisplayName to retrieve the object reference display name. I'm honestly not sure how persistent the SetDispalyName is, so it may need maintenance code to check or renew the display name on cell loads. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 18, 2014 Share Posted December 18, 2014 There is a new one. No page for it on the wiki. Doesn't help that I forget to actually look at the modified scripts whenever I update SKSE. It might do the job for you, portbash. Worth testing anyway. Link to comment Share on other sites More sharing options...
smashly Posted December 18, 2014 Share Posted December 18, 2014 I only found the SKSE Set/GetDisplayName in someone elses code.After looking high and low and everywhere but the skse scripts, I thought it must have been a custom user function called from another script.After scrutinising 11 scripts of someone else code, I slapped my forehead and did what I should have done in the start!Checked the source of the skse scripts....lol Link to comment Share on other sites More sharing options...
jaxonz Posted January 6, 2015 Share Posted January 6, 2015 My Renamer mod has good examples of how to use SetDisplayName to rename individual instances and SetName to rename base objects (all instances that don't otherwise have an instance-specific name). The source code is included in the .BSA Link to comment Share on other sites More sharing options...
Recommended Posts