Difference between revisions of "AddScriptPackage"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JOG
m (see also)
imported>QQuix
(Added a note about interrupt packages)
 
(11 intermediate revisions by 9 users not shown)
Line 1: Line 1:
=='''Description'''==
'''Syntax'''


Add a script package to the calling actor. This package takes precedence over all other packages until it is done. Note that unless the added package has some constraint on it ("must complete" and/or "must reach location"), it will be removed the next time the actor reevaluates his package.
  ''[ActorRefID.]''AddScriptPackage PackageID:ref


=='''Syntax'''==
Adds a script package to the calling actor.  This package takes precedence over all other packages until it is done.


AddScriptPackage ''PackageID''


=='''Examples'''==
==Examples==


  AddScriptPackage MQ07BeggarToTavern
  AddScriptPackage MQ07BeggarToTavern


==Notes==
* An actor can have only one script package at a time. When calling the function twice on the same actor, the second package replaces the first one added.


==See Also==
* Unless the added package has some constraint on it ("must complete" and/or "must reach location"), it will be removed the next time the actor reevaluates his package.
[[RemoveScriptPackage]]


* This function does not work if the actor is currently running an interrupt package (e.g. dialogue). You may detect if the current package is an interrupt package by checking if the current package mod index is 255 (see [[GetSourceModIndex]]) or by comparing [[GetCurrentPackage]] (which returns an interrupt package) with [[GetCurrentEditorPackage]] (which will ignore interrupt packages and return the active package - the one that has been interrupted and will resume later). If they return different packages, the actor is running an interrupt package.


=='''Reference'''==
==See Also==
*[[RemoveScriptPackage]]
*[[EvaluatePackage]]


[[AddScriptPackage_Reference|List of functions that use AddScriptPackage]]  (wiki)




[[Category: Functions]]
[[Category: Functions]]
[[Category:Functions (CS)]]
[[Category: Functions (CS 1.0)]]
[[Category: AI Functions]]
[[Category: AI Functions]]
[[Category: AI Functions (CS 1.0)]]
[[Category: Actor Functions]]
[[Category: Actor Functions (CS 1.0)]]
<!-- Begin Search Terms
Add
Script
Package
End Search Terms -->

Latest revision as of 13:56, 29 March 2015

Syntax

[ActorRefID.]AddScriptPackage PackageID:ref

Adds a script package to the calling actor. This package takes precedence over all other packages until it is done.


Examples[edit | edit source]

AddScriptPackage MQ07BeggarToTavern

Notes[edit | edit source]

  • An actor can have only one script package at a time. When calling the function twice on the same actor, the second package replaces the first one added.
  • Unless the added package has some constraint on it ("must complete" and/or "must reach location"), it will be removed the next time the actor reevaluates his package.
  • This function does not work if the actor is currently running an interrupt package (e.g. dialogue). You may detect if the current package is an interrupt package by checking if the current package mod index is 255 (see GetSourceModIndex) or by comparing GetCurrentPackage (which returns an interrupt package) with GetCurrentEditorPackage (which will ignore interrupt packages and return the active package - the one that has been interrupted and will resume later). If they return different packages, the actor is running an interrupt package.

See Also[edit | edit source]