OnPackageEnd - Actor

From the CreationKit Wiki
Revision as of 15:07, 22 November 2023 by Jadkai (talk | contribs) (This page previously indicated that the package "stopped running" when this event is fired. That is not the case. This event just means the completion conditions have been met, but that does not stop the actor from running the package.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: Actor Script

Event called when the actor finishes a package.

Syntax

Event OnPackageEnd(Package akOldPackage)

Parameters

  • akOldPackage: The Package that just completed.

Examples

Event OnPackageEnd(Package akOldPackage)
  Debug.Trace("We just completed the " + akOldPackage + " package")
endEvent


Notes

  • This event only occurs for packages that have completion conditions, and it does not mean the actor is no longer running the package. For example, an actor running a package based on the Travel template will receive this event upon reaching the package's destination, but the actor will continue running the package for as long as it is the highest priority package whose conditions are met. To find out when an actor is no longer running the package, use OnPackageChange.
  • This can be used in a ReferenceAlias script attached to the player that is currently controlled via SetPlayerAIDriven, and has finished a package.

See Also