Category:Conditions: Difference between revisions
Jump to navigation
Jump to search
Added a lot of new info and made some major renovations for the sake of clarity
imported>GregR m (→Comparison: changed "preference" to more appropriate "precedence" which will help people searching for AND/OR precedence find the page) |
imported>Egocarib (Added a lot of new info and made some major renovations for the sake of clarity) |
||
| Line 1: | Line 1: | ||
==Overview== | ==Overview== | ||
Conditions are used in a number of places in the editor to tell the game when certain things should happen. Conditions are simply a list of one or more | Conditions are used in a number of places in the editor to tell the game when certain things should happen, and whether certain events or effects should be applied. Conditions are simply a list of one or more logical statements that specify the circumstances under which the associated editor item should be valid or take effect. In the case that a list of conditions evaluates to be false, the effect or event it is attached to will not happen. Conditions can be used in conjunction with the following editor objects: | ||
{| | |||
|<blockquote>[[Idle Animations]]<br>[[Quest_Data_Tab|Quest Conditions]]<br>[[Quest_Stages_Tab|Quest Stages]]<br>[[Quest_Objectives_Tab|Quest Objectives]]<br>[[:Category:Dialogue|Dialogue]]<br>[[:Category:Packages|Packages]] | |||
*[[:Category:Package_Templates#Procedure_Trees|Package Procedure Trees]] | |||
*[[:Category:Procedures|Procedures]]</blockquote> | |||
|<blockquote>[[Magic_Effect|Magic Effects]]<br>[[Effect_Item|Effect List]] entries for: | |||
*[[Spell|Spells]] | |||
*[[Enchantment|Enchantments]] | |||
*Ingredients | |||
*[[Scroll|Scrolls]] | |||
*[[Potion|Potions]]</blockquote> | |||
|} | |||
==The Condition List== | ==The Condition List== | ||
The condition list displays all of the individual Condition Items | The condition list displays all of the individual Condition Items that make up this set of Conditions. Right-clicking in the list displays a popup menu which you can use to create New condition items, Duplicate or Delete existing condition items, Copy one condition, Copy All Conditions, or Paste conditions that have been copied from another condition list. | ||
The << and >> buttons below the list window are used to move Condition Items up or down in the list, respectively. The right and left keyboard arrows can also be used for this purpose. The order of conditions may be important when combining AND and OR operators (see below). | |||
The 'New' button can be used to create a new item. To edit a Condition Item, double-click its list entry, and a pop-up window will appear allowing you to make changes. | |||
==Condition Items== | |||
When making a new condition, or editing an existing condition, the Condition Item pop-up window will appear. This window allows you to configure the details of one particular condition, by altering the following parameters: | |||
The Condition Function dropdown list is | ===Condition Function=== | ||
The Condition Function dropdown list contains all possible Condition Functions that can be processed or tested against the object that the condition is attached to. See [[:Category:Condition Functions|Condition Functions]] for a complete list of the possible functions and descriptions of how many of them work. The relatively straightforward names of many condition functions may clue you in to their purpose--most commonly, condition functions are used to query the current state, value, or "condition" of a particular object. For instance, IsSneaking or IsSwimming can be used to test--you guessed it--whether an actor is sneaking or swimming at the time the condition is checked. | |||
===Run On=== | ===Run On=== | ||
The "Run | The "Run On" field is used to indicate the actor or object on which the condition function should be "run" or checked. The meaning of these choices (like "Subject" or "Target") can vary somewhat depending on what editor object the condition is attached to. For some types, an additional drop down to the right of the "Run On" field will allow you to specify further data (for example, picking which alias to use when running your condition on a "Quest Alias") | ||
*'''Subject:''' The actor owning the object. In the case of dialogue, it's whoever is saying it. In the case of quest targets, it's the player. In the case of Magic effects, it is the reference being targeted by the effect. | |||
*'''Subject:''' The actor owning the object. In the case of dialogue, it's whoever is saying it. In the case of quest targets, it's the player. | *'''Target:''' For dialogue, this is the actor being spoken to. For Packages, it's the actor/object specified as the target. Magic Effects and Effect Items, it is the reference being targeted by the effect. | ||
*'''Target:''' For dialogue, this is the actor being spoken to. For Packages, it's the actor/object specified as the target. | |||
*'''Reference:''' A specific reference in the world. Use the Select button to find the reference. | *'''Reference:''' A specific reference in the world. Use the Select button to find the reference. | ||
*'''Combat Target:''' If the owning actor is in combat, it is his current combat target. | *'''Combat Target:''' If the owning actor is in combat, it is his current combat target. For Magic Effects and Effect Items, it is the reference being targeted by the effect. | ||
*'''Linked Reference:''' If the reference is linked to another reference, | *'''Linked Reference:''' If the reference is linked to another reference, the condition function will be run on the linked object. | ||
*'''Quest Alias:''' If the condition is being applied to something that is owned by a quest (dialogue in a quest, an alias in a quest, or a package | *'''Quest Alias:''' If the condition is being applied to something that is owned by a quest (dialogue in a quest, an alias in a quest, or a package whose "owning quest" is set to a particular quest) then you can select to run a condition on a reference alias belonging to that quest. | ||
*'''Package Data:''' you can point to package data that is a reference and run condition on that, however, this only works for conditions applied to [[packages]], [[procedures]], and procedure tree branches. | *'''Package Data:''' you can point to package data that is a reference and run the condition function on that, however, this only works for conditions applied to [[packages]], [[procedures]], and procedure tree branches. | ||
*'''Event Data:''' points to references in particular radiant quest event data (for example Actor1 in an ActorDialgoue event), like 'Run on Quest Alias' this only works for things owned by a quest of that type. | *'''Event Data:''' points to references in particular radiant quest event data (for example Actor1 in an ActorDialgoue event), like 'Run on Quest Alias' this only works for things owned by a quest of that type. | ||
=== | ===Swap Subject and Target=== | ||
The | The "Swap Subject and Target" flag is particularly useful for Magic Effects and Effect Items in the Effect Lists associated with Spells, Enchantments, and Scrolls. Condition functions attached to these types of objects that are Run On the '''Subject''', '''Target''', or '''Combat Target''' will all be checked only against the targeted reference. Ticking "Swap Subject and Target" and running the condition on the '''Subject''' will allow you to instead target ''the caster of the effect'' with your condition, assuming that there is a caster. | ||
The | ===Parameters=== | ||
The Parameters button opens up another dialog box in which parameters that are unique to the currently selected Condition Function can be set. This is where the reference for a GetDistance function or the faction for a GetFactionRank function is set, for example. Not all condition functions make use of additional Parameters. | |||
The | ===Comparison and Value=== | ||
The "Comparison" dropdown list includes various logical operators that determine how the return value of the Condition Function should be compared against the provided "Value" to determine whether the condition item is true. For Condition Functions that would return a ''true'' or ''false'' value, setting the "Value" field to 1.00 will check whether the function is ''true'' and setting the "Value" to 0.00 will test whether the Condition Function is ''false''. | |||
The comparison "Value" is (by default) a text field where a numeric value can be entered by the user. However, if the '''Use Global''' checkbox below the "Value" field is checked, you will instead be able to choose any [[Globals|Global Variable]] from the dropdown list to be compared against the Condition Function's return value. | |||
By default, all Conditions are set to be run with an '''AND''' operator between themselves and the condition that follows them. The OR checkbox is used to override this behavior, and replace the operator following this condition with an '''OR''' instead. In the Condition List, consecutive '''OR'''s are treated like a single block when evaluating and have order precedence over '''AND'''. For example, the condition items ( A AND B OR C AND D ) are evaluated as ( A AND ( B OR C ) AND D ) and ''not'' as ( ( A AND B ) OR ( C AND D ) ). | |||
By applying the distributive and other properties complex expressions can be converted into a list of Condition Items that will evaluate as intended. For example, the expression ((A AND B) OR (C AND D)) can be represented as the list of Condition Items (A OR C AND B OR C AND A OR D AND B OR D). As described above, this evaluates as ((A OR C) AND (B OR C) AND (A OR D) AND (B OR D)) which is equivalent to the initial expression. | By applying the distributive and other properties complex expressions can be converted into a list of Condition Items that will evaluate as intended. For example, the expression ((A AND B) OR (C AND D)) can be represented as the list of Condition Items (A OR C AND B OR C AND A OR D AND B OR D). As described above, this evaluates as ((A OR C) AND (B OR C) AND (A OR D) AND (B OR D)) which is equivalent to the initial expression. | ||
[[Category:Quests]] | [[Category:Quests]] | ||