Scripting:Targeting: Difference between revisions
Jump to navigation
Jump to search
The Watcher [PHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) No edit summary |
The Watcher [PHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
== Target syntax == | |||
This page shows all the possible forms of value you can specify for a <code>target</code> type parameter. The values supported by a given script will vary depending on the situation, and sometimes it may not make much sense to use a given value even if the script does not explicitly prohibit it. In general the script documentation will indicate which values are likely to be appropriate. | This page shows all the possible forms of value you can specify for a <code>target</code> type parameter. The values supported by a given script will vary depending on the situation, and sometimes it may not make much sense to use a given value even if the script does not explicitly prohibit it. In general the script documentation will indicate which values are likely to be appropriate. | ||
; <code>parameter=[me]</code> | ; <code>parameter=[me]</code> | ||
Line 18: | Line 17: | ||
; <code>parameter=<''distance'':''archetype''</code> or <code>parameter=>''distance'':''archetype''</code> | ; <code>parameter=<''distance'':''archetype''</code> or <code>parameter=>''distance'':''archetype''</code> | ||
: Targets all descendants of the specified archetype that are less than (<code><</code> version) or greater than (<code>></code> version) the specified distance from the script's host object. Distances are given in Dromed units, and may be decimal values. For example, <code>parameter=<5.3:Chest</code> will target all direct and indirect concrete descendants of the Chest archetype that are less than 5.3 Dromed units from the script host object. By default, all direct or indirect concrete descendants are targeted, however you can include <code>*</code> before the archetype name to restrict the targeting to direct descendants only, eg: <code>parameter=<5.3:*Chest</code> will target '''only''' concrete Chest objects within 5.3 Dromed units, not including concrete Safe, VicHopeChest or other indirect concrete descendants of Chest. | : Targets all descendants of the specified archetype that are less than (<code><</code> version) or greater than (<code>></code> version) the specified distance from the script's host object. Distances are given in Dromed units, and may be decimal values. For example, <code>parameter=<5.3:Chest</code> will target all direct and indirect concrete descendants of the Chest archetype that are less than 5.3 Dromed units from the script host object. By default, all direct or indirect concrete descendants are targeted, however you can include <code>*</code> before the archetype name to restrict the targeting to direct descendants only, eg: <code>parameter=<5.3:*Chest</code> will target '''only''' concrete Chest objects within 5.3 Dromed units, not including concrete Safe, VicHopeChest or other indirect concrete descendants of Chest. | ||
; <code>parameter=&''linkdef''</code> | |||
: Targets objects linked to the script host object based on the specified link definition. The syntax for the link definition is given in the next section. | |||
== Link definition syntax == | |||
{{Scripting:Navbox}} | {{Scripting:Navbox}} | ||
{{:Site Navigation}} | {{:Site Navigation}} | ||
<references /> | <references /> |
Revision as of 21:45, 20 June 2014
Target syntax
This page shows all the possible forms of value you can specify for a target
type parameter. The values supported by a given script will vary depending on the situation, and sometimes it may not make much sense to use a given value even if the script does not explicitly prohibit it. In general the script documentation will indicate which values are likely to be appropriate.
parameter=[me]
- Targets the object the script is attached to.
parameter=[source]
- All actions taken by scripts happen in response to messages received by the object the script is attached to. This option allows the script to target the object that sent the message that is currently being handled by the script. Note that this should be used with caution
parameter=*archetype
- Targets all direct concrete descendants of the specified archetype. So, for example,
parameter=*Chest
will target all concrete Chest objects in your level, but not any concrete Safe, VicHopeChest, LC_Chest, or other indirect descendants of the Chest archetype.
parameter=@archetype
- Targets all direct or indirect concrete descendants of the specified archetype. For example,
parameter=@Chest
will target all concrete Chest objects in your level and any concrete Safe, VicHopeChest, or other indirect descendants of the Chest archetype.
parameter=<distance:archetype
orparameter=>distance:archetype
- Targets all descendants of the specified archetype that are less than (
<
version) or greater than (>
version) the specified distance from the script's host object. Distances are given in Dromed units, and may be decimal values. For example,parameter=<5.3:Chest
will target all direct and indirect concrete descendants of the Chest archetype that are less than 5.3 Dromed units from the script host object. By default, all direct or indirect concrete descendants are targeted, however you can include*
before the archetype name to restrict the targeting to direct descendants only, eg:parameter=<5.3:*Chest
will target only concrete Chest objects within 5.3 Dromed units, not including concrete Safe, VicHopeChest or other indirect concrete descendants of Chest.
parameter=&linkdef
- Targets objects linked to the script host object based on the specified link definition. The syntax for the link definition is given in the next section.
Link definition syntax
|
|