GetIsCurrentPackage

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Syntax:

[ActorID.]GetIsCurrentPackage PackageID 

Example:

GetIsCurrentPackage AnvilGuardPatrolDay8x7

Returns 1 if the actor is currently running the specified package, 0 otherwise.


Notes:

  • This is only 100% reliable when there are no interrupt packages active.
  • Interrupt packages that override the current package with combat or flight (including crime detection/reaction) do not affect the results of this function. If an actor is running MyPackage and goes into combat, GetIsCurrentPackage MyPackage will still return true.
  • Interrupt packages that implicate a Follow Package (e.g. initiating dialog, pursuing tresspassers) will become the new active package until they're finished, and thus GetIsCurrentPackage will return 0. If you need to be sure a package is not active, you should to test for these AI Procedures as well.
Example:
if getIsCurrentPackage MyPackage == 0 
  message "MyPackage is not active"
endif
When the actor is currently following a trespasser or initiating dialog, the message will be displayed even when "Mypackage" is the active package.
if getIsCurrentPackage MyPackage == 0 
  if  getCurrentAIProcedure != 4 && getCurrentAIProcedure != 15
    message "MyPackage is not active"
  endif
endif
Now the message will only be displayed when the package is not active and the actor is neither initating dialog nor following a trespasser.