Difference between revisions of "SetClass - ActorBase"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Sagitarius22
(Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' ActorBase Script Set the class of this actor. (This function requires SKSE) == Syntax...")
 
imported>DreamKing
(Added note that class skills are not immediately updated after SetClass is used.)
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
== Notes ==
== Notes ==
*This is a function performed on an ActorBase, meaning all Actors derived from this will have this class.
*This is a function performed on an ActorBase, meaning all Actors derived from this will have this class.
*Like most SKSE functions performed on an ActorBase, the change will not persist across gaming sessions. If you want a class change for an Actor to persist, you will need to implement the class change via the [[OnPlayerLoadGame - Actor|OnPlayerLoadGame()]] event or a similar mechanism.
*In most cases, the skills of an Actor whose class has been changed via SetClass will not immediately update to reflect the distribution specified by their new class. An actor set to a PC level multiplier will update their skills the next time the PC levels up. Other techniques, such as toggling the actor's race, can be used to induce a more immediate re-evaluation of skills.





Latest revision as of 13:26, 27 November 2013

SKSE Member of: ActorBase Script

Set the class of this actor. (This function requires SKSE)

Syntax[edit | edit source]

Function SetClass(Class c) native

Parameters[edit | edit source]

  • Class: the new class for this Actor.

Return Value[edit | edit source]

None.

Notes[edit | edit source]

  • This is a function performed on an ActorBase, meaning all Actors derived from this will have this class.
  • Like most SKSE functions performed on an ActorBase, the change will not persist across gaming sessions. If you want a class change for an Actor to persist, you will need to implement the class change via the OnPlayerLoadGame() event or a similar mechanism.
  • In most cases, the skills of an Actor whose class has been changed via SetClass will not immediately update to reflect the distribution specified by their new class. An actor set to a PC level multiplier will update their skills the next time the PC levels up. Other techniques, such as toggling the actor's race, can be used to induce a more immediate re-evaluation of skills.


Examples[edit | edit source]

Class Property Berserker Auto

ActorBase pActorBase = Game.GetPlayer().GetActorBase()
pActorBase.SetClass(Berserker)

See Also[edit | edit source]