Difference between revisions of "SetName - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Sagitarius22
imported>Sagitarius22
Line 20: Line 20:
<source lang="papyrus">
<source lang="papyrus">
; Set Bob's name to be Bobinsky
; Set Bob's name to be Bobinsky
Bob.GetBaseObject().SetName("Bobinsky")
BobReference.GetBaseObject().SetName("Bobinsky")
; My name's now Bobinsky!
; My name's now Bobinsky!
</source>
</source>
Line 26: Line 26:
<source lang="papyrus">
<source lang="papyrus">
; Set the Bob's name to be Bob + player's name (here, player is named Bobby
; Set the Bob's name to be Bob + player's name (here, player is named Bobby
Bob.GetBaseObject().SetName("Bob "+Game.GetPlayer().GetBaseObject().GetName())
BobReference.GetBaseObject().SetName("Bob "+Game.GetPlayer().GetBaseObject().GetName())
; Bob is now named Bob Bobby!
; Bob is now named Bob Bobby!
endif
endif

Revision as of 11:41, 28 May 2012

SKSE Member of: Form Script

Sets the name of the form. (This function requires SKSE)

Syntax

Function SetName(String akString) native

Parameters

  • akString: the new name for this form.

Return Value

  • none

Examples

; Set Bob's name to be Bobinsky
BobReference.GetBaseObject().SetName("Bobinsky")
; My name's now Bobinsky!


; Set the Bob's name to be Bob + player's name (here, player is named Bobby
BobReference.GetBaseObject().SetName("Bob "+Game.GetPlayer().GetBaseObject().GetName())
; Bob is now named Bob Bobby!
endif

Notes

  • This function does not work on actors or object references, use the actor base or base object instead.
  • This will affect all instances of the passed form. It's better to be used on a unique actor.

See Also