Difference between revisions of "GetName - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Sagitarius22
imported>Terra Nova2
Line 34: Line 34:
== Notes ==
== Notes ==
*This function does not work on actors or object references, use the actor base or base object instead.
*This function does not work on actors or object references, use the actor base or base object instead.
*This doesn't return the name in its EditorID form. But name under the name column. If you're search through an array of names, you will could possibly end up with blank entries due to forms not having a name.


== See Also ==
== See Also ==

Revision as of 06:35, 27 February 2015

SKSE Member of: Form Script

Returns the name of the passed form. (This function requires SKSE)

Syntax

String Function GetName() native

Parameters

  • None.

Return Value

  • The name of the form as a string.

Examples

; Obtain Bob's name and show a message using it.
String BobName = Bob.GetBaseObject().GetName()
Debug.MessageBox("My name's " + BobName + "!")
; My name's Bob!


; Remove all the NPC's items if his name's Bob
if BobReference.GetBaseObject().GetName() == "Bob"
  BobReference.RemoveAllItems()
endif

Notes

  • This function does not work on actors or object references, use the actor base or base object instead.
  • This doesn't return the name in its EditorID form. But name under the name column. If you're search through an array of names, you will could possibly end up with blank entries due to forms not having a name.

See Also