Difference between revisions of "RemoveScriptPackage"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>MentalElf
m (Just adding note of a problem with this operator)
imported>QQuix
m (Adjusting page to standard format)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=='''Description'''==
'''Syntax'''
⚫
Removes the currently running script package from the calling actor. Only necessary if you added a script package which was set to run indefinitely.


⚫
[ActorRefID.]RemoveScriptPackage


⚫
Removes the currently running script package from the calling actor. Only necessary if you added a script package which was set to run indefinitely. When the script package is removed, the actor will automatically choose a new package.
=='''Syntax'''==


⚫
RemoveScriptPackage


⚫
==Example==

⚫
; from MS45DarMaScript
⚫
==''' Example''' ==
⚫
if getIsCurrentPackage MS45DarMaPrisonerGreetPlayer == 1
⚫
(Out of MS45DarMaScript)
⚫
If getInSameCell player == 0
⚫
if getiscurrentPackage MS45DarMaPrisonerGreetPlayer == 1
removeScriptPackage
⚫
If getinsamecell player == 0
removescriptpackage
endif
endif
endif
endif


==''' Notes''' ==
==Notes==
* Removing a script package on an actor that has no script package can cause the script to stop running on all instances of that actor. It is preferable to use a package(s) attached to the actor in its AI definition with one or more conditions specified.
Removing a script package on an actor that has no
** Also, it will prevent the player starting or acquiring new packages or procedures which are triggered by functions. For instance, calling [[forceFlee]] while [[removeScriptPackage]] is being called will prevent the fleeing behavior from triggering.
script package can cause the script to stop running
** Conversely, calling [[removeScriptPackage]] will stop and remove the actor's current package/procedure had it been triggered by a function. For an example, calling the function on a fleeing actor will cancel the flee procedure.
on all instances of that actor. It is preferable to
* Parameter usage is accepted by the script compiler, but has no effect during run-time.
use a package(s) attached to the actor in its AI
* This function cannot be used to remove Editor-added packages.
definition with one or more conditions specified.


==See Also==
==See Also==
[[AddScriptPackage]]
* [[AddScriptPackage]]
* [[EvaluatePackage]]



[[Category: Functions]]
[[Category: Functions]]
[[Category:Functions (CS)]]
[[Category: Functions (CS 1.0)]]
[[Category: Actor Functions]]
[[Category: Actor Functions (CS 1.0)]]
[[Category: AI Functions]]
[[Category: AI Functions]]
[[Category: AI Functions (CS 1.0)]]

<!-- Begin Search Terms
Remove
Script
Package
End Search Terms -->

Latest revision as of 07:04, 6 February 2011

Syntax

[ActorRefID.]RemoveScriptPackage

Removes the currently running script package from the calling actor. Only necessary if you added a script package which was set to run indefinitely. When the script package is removed, the actor will automatically choose a new package.


Example[edit | edit source]

; from MS45DarMaScript
if getIsCurrentPackage MS45DarMaPrisonerGreetPlayer == 1
  If getInSameCell player == 0
    removeScriptPackage
  endif
endif

Notes[edit | edit source]

  • Removing a script package on an actor that has no script package can cause the script to stop running on all instances of that actor. It is preferable to use a package(s) attached to the actor in its AI definition with one or more conditions specified.
    • Also, it will prevent the player starting or acquiring new packages or procedures which are triggered by functions. For instance, calling forceFlee while removeScriptPackage is being called will prevent the fleeing behavior from triggering.
    • Conversely, calling removeScriptPackage will stop and remove the actor's current package/procedure had it been triggered by a function. For an example, calling the function on a fleeing actor will cancel the flee procedure.
  • Parameter usage is accepted by the script compiler, but has no effect during run-time.
  • This function cannot be used to remove Editor-added packages.

See Also[edit | edit source]