Difference between revisions of "OnPackageDone"
Jump to navigation
Jump to search
imported>Ecaponi |
(Script) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
'''Syntax:''' | '''Syntax:''' | ||
begin OnPackageDone PackageID | begin OnPackageDone PackageID | ||
begin OnPackageEnd PackageID | |||
'''Example:''' | '''Example:''' | ||
begin OnPackageDone FollowPlayerPackage | begin OnPackageDone FollowPlayerPackage | ||
Line 8: | Line 9: | ||
Note also that certain package types, such as wanders, sleeps and eats, cannot "complete", as they have no Done state, so OnPackageDone will never be triggered for these package types. | Note also that certain package types, such as wanders, sleeps and eats, cannot "complete", as they have no Done state, so OnPackageDone will never be triggered for these package types. | ||
==Notes== | |||
*This block has been known to contribute to the [https://en.uesp.net/wiki/Shivering:Reference_Bug Reference Bug] by potentially using up FormIDs at an extremely fast rate. To prevent the block from causing issues, a known workaround is to have a GameMode block before the OnPackageDone blocks, where the GameMode block checks if the NPC is in the same cell as the player, and uses [[Return]] if not. | |||
Begin GameMode | |||
if ( player.GetInCell SENSDukesQuarters != 1 ) | |||
return | |||
endif | |||
End | |||
==See Also== | ==See Also== | ||
[[OnPackageChange]] | [[OnPackageChange]] | ||
[[Category: | [[Category: Blocktypes]] |
Latest revision as of 05:46, 3 February 2023
Syntax:
begin OnPackageDone PackageID begin OnPackageEnd PackageID
Example:
begin OnPackageDone FollowPlayerPackage
This block will be run once when the scripted actor completes the specified package. Note that a package can be completed due to failure (pathfinding, or inability to Find the specified number of generic objects, or the duration has expired), unless the Must Reach Location or Must Complete flags are checked on the package.
Note also that certain package types, such as wanders, sleeps and eats, cannot "complete", as they have no Done state, so OnPackageDone will never be triggered for these package types.
Notes[edit | edit source]
- This block has been known to contribute to the Reference Bug by potentially using up FormIDs at an extremely fast rate. To prevent the block from causing issues, a known workaround is to have a GameMode block before the OnPackageDone blocks, where the GameMode block checks if the NPC is in the same cell as the player, and uses Return if not.
Begin GameMode if ( player.GetInCell SENSDukesQuarters != 1 ) return endif End