SetPackageTarget

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function added by the Oblivion Script Extender.

Syntax:

(void) SetPackageTarget package:ref targetReference:ref 
(void) SetPackageTarget package:ref baseObject:ref quantity:short 
(void) SetPackageTarget package:ref objectCode:short quantity:short

Sets the target of the specified package. Target can be of several types, leading to several syntaxes for this command. The first listed usage sets the target to a specific reference.

The second sets it to a particular base object with a specified quantity; when the package executes the actor will look for references to that base object to use as the target(s).

The third usage sets the target to a Package Object Code (see below) representing the type(s) of objects to be used as targets, along with a quantity. This command does not change the targets of actor references currently executing the package unless they re-evaluate their package after the change has been made.


Package Object Codes

The following values are shorts that are used and/or returned by this function, as indicated by its Syntax. These values correspond to the listed type of package object:

 1	Activator
 2	Apparatus
 3	Armor
 4	Book
 5	Clothing
 6	Container
 7	Door
 8	Ingredient
 9	Light
10	Misc
11	Flora
12	Furniture
13	Weapon (Any)
14	Ammo
15	NPC
16	Creature
17	Soulgem
18	Key
19	Alchemy
20	Food
21	Combat Wearable
22	Wearable
23	Weapon None
24	Weapon Melee
25	Weapon Ranged
26	Spells (Any)


Notes

  • If the Package is of Follow type, the distance in feet (integer returned with "Value" key from the StringMap returned by GetPackageTargetData) to follow the Target will be automatically set to 1. So in this case, it will be better to use SetPackageTargetData instead.