Difference between revisions of "GetName - Form"
Jump to navigation
Jump to search
imported>Sagitarius22 |
imported>Terra Nova2 m (→Notes: typo) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 5: | Line 5: | ||
Returns the name of the passed form. (This function requires SKSE) | Returns the name of the passed form. (This function requires SKSE) | ||
== Syntax == | == Syntax == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
String Function GetName( | String Function GetName() native | ||
</source> | </source> | ||
== Parameters == | == Parameters == | ||
* | *None. | ||
== Return Value == | == Return Value == | ||
*The name of the form as a string. | *The name of the form as a string. | ||
== Examples == | == Examples == | ||
Line 25: | Line 21: | ||
; Obtain Bob's name and show a message using it. | ; Obtain Bob's name and show a message using it. | ||
String BobName = Bob.GetBaseObject().GetName() | String BobName = Bob.GetBaseObject().GetName() | ||
Debug.MessageBox("My name's " +BobName) | Debug.MessageBox("My name's " + BobName + "!") | ||
; My name's Bob! | |||
</source> | </source> | ||
<br> | |||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Remove all the NPC's items if his name's Bob | ; Remove all the NPC's items if his name's Bob | ||
if BobReference.GetBaseObject().GetName() == "Bob" | if BobReference.GetBaseObject().GetName() == "Bob" | ||
BobReference.RemoveAllItems() | BobReference.RemoveAllItems() | ||
endif | endif | ||
</source> | </source> | ||
== Notes == | == 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 using this function, take in account for forms that may not have a name. | |||
== See Also == | == See Also == | ||
*[[Form Script]] | *[[Form Script]] | ||
*[[SetName - Form]] | *[[SetName - Form]] | ||
*[[GetBaseObject - ObjectReference]] |
Latest revision as of 06:36, 27 February 2015
SKSE Member of: Form Script
Returns the name of the passed form. (This function requires SKSE)
Syntax[edit | edit source]
String Function GetName() native
Parameters[edit | edit source]
- None.
Return Value[edit | edit source]
- The name of the form as a string.
Examples[edit | edit source]
; 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[edit | edit source]
- 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 using this function, take in account for forms that may not have a name.