Is it possible to invoke the "rename object" routine

Post » Tue Nov 20, 2012 6:36 am

I'm talking about the routine that allows you to rename an object when it is enchanted.

Is it possible?

EDIT: I want to say, invoke a window that accepts input and rename an object, just like that.

and while we're on the matter, can someone explain to me how the game can rename an object and not affect any other object like it?
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Tue Nov 20, 2012 2:01 am

I've been meaning to dissect this mod for awhile http://skyrim.nexusmods.com/mods/24426/ but it requires SKSE so it probable that it couldn't rely on vanilla architecture.

I'd also really like to find out how this is done and what its limitations might be.
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Tue Nov 20, 2012 1:43 am

I've been meaning to dissect this mod for awhile http://skyrim.nexusmods.com/mods/24426/ but it requires SKSE so it probable that it couldn't rely on vanilla architecture. I'd also really like to find out how this is done and what its limitations might be.

This maybe?
http://www.creationkit.com/SetName_-_Form

You can also receive key presses with SKSE, so you can have user input for it like that.
User avatar
Hella Beast
 
Posts: 3434
Joined: Mon Jul 16, 2007 2:50 am

Post » Tue Nov 20, 2012 5:41 am

We can do that in vanilla, is there no script function or something that can be used for that?

At any rate, while the rename function is there, how do you invoke a window for users to type in?
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Mon Nov 19, 2012 11:31 pm

We can do that in vanilla, is there no script function or something that can be used for that?

At any rate, while the rename function is there, how do you invoke a window for users to type in?

(1) Make an array of strings, each containining the character for the keycode that is the same as the character's position in the array.
(2) Make a function with http://www.creationkit.com/RegisterForKey_-_Form to register for every possible character you want. You can do that easily with a loop since it just takes an integer argument.
(3) Call the function and immediately open a messagebox, with something like "Type the name you want to assign, then press OK."
(4) In the http://www.creationkit.com/OnKeyUp_-_Form block you get the string at the position in the array corresponding to the keycode passed and add it to the end of a "new name" string. Or delete the last character if they pressed delete, you can do that with SKSE's substring function.
(5) In the line after the messagebox code, use http://www.creationkit.com/UnregisterForAllKeys_-_Form
(6) Send the new name string to a new messagebox and ask them to confirm it, if they say no then restart the process. If they say yes, change the name.

Also:
and while we're on the matter, can someone explain to me how the game can rename an object and not affect any other object like it?

Either every reference has its own name that doesn't -need- to be inherited from its base object but is by default, and the game has access to that but papyrus doesn't... or the game creates a new base object for it and keeps it in the saved game, which papyrus also can't do I think. I guess you'd have to go check if a game with enchanted weapons has weapon base objects stored in it for those weapons. If it does, I guess it's the second idea. If not, probably the first.

Edit: You might also be able to determine this by trying to use "GetBaseObject" on a player-enchanted weapon. Seems like a waste of time though since you can't do much with it either way.
User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Post » Mon Nov 19, 2012 10:25 pm

That's smart, never thought to do that. I thought there's a specific function for name input. Thanks!
User avatar
Romy Welsch
 
Posts: 3329
Joined: Wed Apr 25, 2007 10:36 pm

Post » Tue Nov 20, 2012 3:12 am

That's smart, never thought to do that. I thought there's a specific function for name input. Thanks!

By the way, I'm not sure how "unregisterforallkeys" would work out with other mods that also register for key presses... it might break them, I've never used the functions before so I don't know if they'd both be called on the same object or what.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Tue Nov 20, 2012 2:42 am

That might very well be problematic. As for the object, I guess I can just enchant something and see the ID via show inventory and compare the ID with the base object.

I'll have a look see for the UnregisterForAllKeys stuff.
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Mon Nov 19, 2012 6:19 pm

I've been meaning to dissect this mod for awhile http://skyrim.nexusmods.com/mods/24426/ but it requires SKSE so it probable that it couldn't rely on vanilla architecture.

I'd also really like to find out how this is done and what its limitations might be.

Jesus, that mod looks like magic! Unique Rename that persists after uninstallation? Even http://www.creationkit.com/SetName_-_Form says that's not how it works.It's at this time that I wish I can decode the pex and stuff
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Mon Nov 19, 2012 9:30 pm

That might very well be problematic. As for the object, I guess I can just enchant something and see the ID via show inventory and compare the ID with the base object.

I'll have a look see for the UnregisterForAllKeys stuff.

The ID would never be the base object either way, that's why you have to use getbaseobject. I don't think you can do that in the console?
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Tue Nov 20, 2012 8:02 am

The ID would never be the base object either way, that's why you have to use getbaseobject. I don't think you can do that in the console?

Really? It's just that I see the FormID in the CK and the same (or is it?) can be used with player.additem, so I thought...
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Mon Nov 19, 2012 9:12 pm

Jesus, that mod looks like magic!
Is this sarcasm ? I really don't like this tone.

Unique Rename that persists after uninstallation? Even http://www.creationkit.com/SetName_-_Form says that's not how it works.It's at this time that I wish I can decode the pex and stuff

An ObjectReference can be renamed via Alias & Message. But doing this has a bad side. From the Alias Wiki page :

Display Name (optional): Can be used to rename the reference when it is assigned to the alias.The dropdown is a list of Messages - the Message Title will replace the reference's name.Note that this change is permanent - the reference will retain the new Display Name even when it is removed from the alias.

GetName() value is always correct. It's a problem of display.
User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm

Post » Tue Nov 20, 2012 9:35 am

Is this sarcasm ? I really don't like this tone.



An ObjectReference can be renamed via Alias & Message. But doing this has a bad side. From the Alias Wiki page :

Display Name (optional): Can be used to rename the reference when it is assigned to the alias.The dropdown is a list of Messages - the Message Title will replace the reference's name.Note that this change is permanent - the reference will retain the new Display Name even when it is removed from the alias.

GetName() value is always correct. It's a problem of display.

No, it's not sarcasm. I looked at SetName and it says it will rename the base object and will not persist, which is 180 degrees from what your mod do (Unique name and persistent). Besides, I'm not good with sarcasm. Never have been.Thanks for the info! :) gonna have a look at Alias. By the way, why did you say it won't work with horses? (I mean, you said renaming horses will not persist)
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Mon Nov 19, 2012 11:51 pm

My apologies then. I thought that you were mocking with "magic".

Well, as Player's Horse is named through a vanilla Alias the same way, the change can be reverted. When the SR Alias is removed, the old Name is correctly displayed.

In an SKSE thread PLB said a few times ago that he succeeded to rename an ObjectReference without this awful Alias trick. The problem is for now that the new Name doesn't stick, but maybe it's something that can be fixed. Fingers crossed.
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Mon Nov 19, 2012 10:30 pm

My apologies then. I thought that you were mocking with "magic".

Well, as Player's Horse is named through a vanilla Alias the same way, the change can be reverted. When the SR Alias is removed, the old Name is correctly displayed.

In an SKSE thread PLB said a few times ago that he succeeded to rename an ObjectReference without this awful Alias trick. The problem is for now that the new Name doesn't stick, but maybe it's something that can be fixed. Fingers crossed.

Well, since I thought the implementation is through SetName, and you did exactly as the opposite of what SetName does (that is, the impossible to me), it looks like magic :P

Again, thanks for the info, I thought Alias only works for Radiant Quests, I still have a lot to learn
User avatar
roxxii lenaghan
 
Posts: 3388
Joined: Wed Jul 05, 2006 11:53 am

Post » Tue Nov 20, 2012 8:39 am

You could add each renamed object and each new name to arrays, then re-assign them in the "onplayerloadgame" block. Although the array length limit would be annoying, and it is a bit silly to have to do this every time the game loads.
User avatar
Janeth Valenzuela Castelo
 
Posts: 3411
Joined: Wed Jun 21, 2006 3:03 am


Return to V - Skyrim