Name of ObjectReference ?

Post » Mon Apr 14, 2014 2:02 pm

How can I display the name (not the ID) of an ObjectReference in a simple Debug.Notification("Object's Name is:" + myObjName)?

SKSE's "GetName" does not work for ObjectReferences, only actors.

I tried the following but it either does not compile or shows nothing :

(Where objRef is a variable containing an objectreference)

objRef.Name

objRef.GetName()

objRef.DisplayName

objRef.GetDisplayName()

objRef.GetBaseObject().Name

objRef.GetBaseObject().GetName()

objRef.GetBaseObject().DisplayName

objRef.GetBaseObject().GetDisplayName()

thanks!

User avatar
Jordyn Youngman
 
Posts: 3396
Joined: Thu Mar 01, 2007 7:54 am

Post » Mon Apr 14, 2014 1:39 pm

You would want to use objRef.GetDisplayName().

objRef.GetBaseObject().GetName() would also work as long as the object reference does not have a custom name different from its base object. If it compiles but doesn't work, make sure your objRef actually has a variable in it (e.g. doesn't equal NONE). If it doesn't compile you probably haven't installed the SKSE modified script (psc) files correctly.

User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm


Return to V - Skyrim