User Tools

Site Tools


modding:xml:api_version

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
modding:xml:api_version [2013/09/02 19:43] gpmmodding:xml:api_version [2013/09/02 19:55] gpm
Line 22: Line 22:
  
 === Dynamic Effects === === Dynamic Effects ===
 +Dynamic effects are visual effects whose parameters are modified at runtime. A dynamic effect uses the <GetParameters> event on an <EventType> to dynamically set the effect parameters. For example:
  
 +  <EffectType UNID="..."
 +        instance="creator"
 +        >
 +     <Effect>
 +        <Ray
 +           style="..."
 +           ...
 +           >
 +           
 +           <Events>
 +              <GetParameters>
 +                 (block Nil
 +                    ...
 +              
 +                    {
 +                       length: ...
 +                       width: ...
 +                       intensity: ...
 +                       }
 +                    )
 +              </GetParameters>
 +           </Events>
 +        </Ray>
 +     </Effect>
 +  </EffectType>
 +
 +In the above example, the parameters for the <Ray> effect are being set by the <GetParameters> function, which returns a struct. Each field in the struct represents a parameter in the <Ray> element to be set.
 +
 +The **instance** parameter on <EffectType> defines when <GetParameters> is called to set the effect parameters. The valid instances are:
 +
 +  * creator: The effect parameters are defined each time the effect is created (e.g., when the weapon is fired).
 +  * game: The effect parameters are defined once at the beginning of the game and shared. For example, if multiple weapons use the same effect, all will use the same parameters.
 +  * owner: The effect parameters are defined once per effect owner. For example, if multiple weapons use the same effect, the effect will be defined separately for each weapon.
 +
 +NOTE: As of API version 14, only the <Ray> effect supports dynamic effects.
  
 === Enhancement Devices === === Enhancement Devices ===
modding/xml/api_version.txt · Last modified: 2017/01/16 19:42 by xephyr