Difference between revisions of "Effect"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(Generated by Sunjammer's Dragon Age Script Paser)
Line 1: Line 1:
An Effect is a modifier that can be applied to a game object.  When the effect is removed (usually because the duration on the effect expires) the modifier is removed.  These modifiers can be rule or stat based or more complicated visual and game effects.
+
{{Generated with errors}}
 +
{{dafunction
 +
|name=Effect
 +
|brief=Creates a blank effect
 +
|param1type=int
 +
|param1name=nType
 +
|param1desc=
 +
|returntype=effect
 +
|returndesc=
 +
|sourcefile=script.ldf
 +
|sourcemodule=
 +
}}
  
Every effect has a type set on it that determines how it affects the object it is applied to. They also have a number of parameters on them, which vary based on the type, that change the specific behaviour.
+
== Description ==
 +
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
 +
Creates an empty effect
  
They can be assigned different duration types which affect how they're applied and removed:
+
<!-- == Remarks == -->
 +
<!-- This section contains additional comments, observations and known issues. -->
  
# '''Temporary:''' Applied for a short duration (measured in seconds)
+
<!-- == Examples == -->
# '''Permanent:''' Applied until manually removed through scripting
+
<!-- This section contains examples transcluded from the snippet library. -->
# '''Instant:'''  These are one-shot modifiers that are not stored on the object (the death effect is an instant modifier for example)
+
# '''Equipped:''' Associated with an equipped item. The effect is removed when the item is unequipped.
+
  
Some effect types can only be applied as instant effects.  These effects will delete themselves after they've been applied no matter what duration type was set for them.  All other duration types will be stored in a list on the object they're applied to.
+
<!-- == See also == -->
 +
<!-- This section contains links to articles, functions or constant groups. -->
  
Effects are usually created and applied through the [[script|scripting language]].  The list of effects applied to an object can also be examined and modified through scripting.  The game engine itself will apply some instant effects when appropriate (like death or damage during combat).
+
[[Category: Effect access functions]]
 
+
When an effect is applied through scripting, the designer has the option of specifying a sub-type on it.  The subtype, which can be either "normal" or "magical", affects whether a "Dispel Magic" spell should clear the effect or not (Dispel Magic is an instant effect type).  Magical effects are usually tagged with the spell id that created it so that more rules checking can be done when they're cleared.
+
 
+
Some effects trigger [[event]]s to the object that they're applied to.  This is especially important for hostile effects like damage or death.  Each effect is tagged with the object id of the creator so that the target can react appropriately. 
+
 
+
All stat modifiers stack with each other.  If an object has two bonuses of the same type applied, they will get the full bonus from each.
+
 
+
When a game is reloaded, all the effects on an object are re-applied but with a special "loading" flag turned on.  Most effects will see this and do nothing, since the object they're applying themselves to has already had the modifiers applied.  A few effects will need to re-apply themselves if their effect is not easily saved.
+
 
+
Packages of effects can be constructed by "linking" them in the scripting language before they're applied.  Any effects that are linked together will be given the same unique id when they're applied.  If any effect in this group is then removed, either through expiry or scripting, then the entire group will go with them. This is most often used to tie a visual effect to a stat modifier.  When the modifier expires the visual effect will disappear.
+
 
+
Effects are applied internally by signalling an "apply effect" event with pointer to the effect attached.  They are usually removed in the same way because you don't know what else is linked to that effect and what dispelling them will do to the object.
+
 
+
The check to see if an effect has expired is done as part of an object's AI Update.  Some effect types also have timers that are checked here to see if they need to be given an update (used for regeneration type effects).
+
 
+
Party members will have a series of "effect icons" that appear on their character sheets so that the player can see what effects are on them.  These icons will be controlled by a special "Effect Icon" effect that will be linked to the spell's effects and managed by the scripter.
+
 
+
== Effect Behaviour ==
+
 
+
Behaviour for effects can be defined in either the engine or in scripting.  When an effect is applied or removed, the game will check for a defined handler for that effect type.  If none exists, then the object will receive an event to their script with the effect attached.
+
 
+
To access the effect in an onApply or onRemove event, use the <code>effect GetCurrentEffect()</code> scripting command.  The properties on this effect can be examined to determine type, duration and other parameters.  If your script handles the effect properly and you want it to be stored (so that you get the onRemove event later) you need to call the special <code>void SetIsCurrentEffectValid(int nValid)</code> function.  This will add it to the effect list on that object.
+
 
+
Effects will usually be handled by the core scripts rather than by an object's AI script.
+
 
+
[[Category:Data types]]
+

Revision as of 02:40, 29 July 2009

This page was generated by Sunjammer's Dragon Age Script Parser.

The parser was unable to extract and/or match all the information required and has flagged this page as containing one or more errors. The source file was not formatted correctly and the information presented is incomplete or incorrect.

This page must be reviewed by a knowledgeable scripter as it will need to be updated. Once identified, the issue in the source file should be reported to BioWare.

Please remove the {{Generated with errors}} tag once the page has been corrected.

Creates a blank effect

effect Effect(
int nType
);
Parameters:
nType
[Undocumented]
Returns:

[Undocumented]

Source:

script.ldf

Description

Creates an empty effect