GAE/Projectile Particle XML

From MegaGlest
Revision as of 14:24, 26 March 2011 by Hofmic (talk) (Adding categories)
Jump to: navigation, search

The Projection Particle XML defines the visual effects as well as part of the mechanics used to for ranged attacks between units. As of GAE 0.3, a projectile particle system more broadly defines a special effects system that may be used for any skill, even if the skill has no target. The <trajectory> node allows you to specify the start and end points of the projectile system with offsets and variance.

<?xml version="1.0" standalone="yes"?>
<projectile-particle-system>

<!-- GAE Only  -->

    <blend-mode src="mode" dest="mode"/>  <!-- (Optional) Available in 0.2.13. Sets the blend mode for the particle
                                               system.  For details, see the OpenGL reference for the glBlendFunc()
                                               function.  Legal values are:
                                                   zero
                                                   one                       (dest default)
                                                   src_color
                                                   one_minus_src_color
                                                   dst_color
                                                   one_minus_dst_color
                                                   src_alpha                 (src default)
                                                   one_minus_src_alpha
                                                   dst_alpha
                                                   one_minus_dst_alpha
                                                   constant_color
                                                   one_minus_constant_color
                                                   constant_alpha
                                                   one_minus_constant_alpha
                                                   src_alpha_saturate.
                                               Note that dest may not be set to src_alpha_saturate.  If not specified,
                                               the default is the same as classic Glest behavior, equivalent to

                                                   <blend-mode src="src_alpha" dest="one"/>

                                               However, to enable particles to contain dark colors (and not have the
                                               brightness used as an alpha value), you should use

                                                   <blend-mode src="src_alpha" dest="one_minus_src_alpha"/>

                                          -->
    <blend-equation mode="mode"/>         <!-- (Optional) Available in 0.2.13. Sets the blend equation for the particle
                                               system.  For details, see the OpenGL reference for the glBlendEquation()
                                               function.  Legal values are:
                                                   func_add                  (default)
                                                   func_subtract
                                                   func_reverse_subtract
                                                   min
                                                   max
                                          -->

<!-- /GAE Only  -->
                                     <!-- A bitmap file used to map the alpha of the particles. -->
    <texture value="true" luminance="true|false" path=".../texture_name.bmp"/>
                                     <!-- Model used as the projectile. -->
    <model value="true|false" path=".../model_name.g3d"/>
    <primitive value="line|quad"/>
    <offset x="0" y="0.2" z="1"/>    <!-- Offset the origin of the attack; +X is to the right of the attacker, +y is
                                          above the attacker, +z is to the front of the attacker. Make no difference
                                          to the endpoint -->
                                     <!-- Starting color/transparency, ranges from 0-1  -->
    <color red="1.0" green="0.5" blue="0.0" alpha="0.5" />
                                     <!-- Ending Color, same range -->
    <color-no-energy red="0.0" green="0.0" blue="0.0" alpha="0.2" />
    <size value="6" />               <!-- size of texture when particle is created -->
    <size-no-energy value="4" />     <!-- size of texture when particle has emitted all energy -->
    <speed value="0" />              <!-- The speed (distance moved really) of the particle over their lifetime -->
    <gravity value="0"/>             <!-- How much particles are effected by gravity -->
    <emission-rate value="1" />      <!-- The amount of particles emitted -->
    <energy-max value="20" />        <!-- Maximum Energy -->
    <energy-var value="0" />         <!-- Variation -->

        <!-- The following trajectory type definitions are mutually exclusive -->

    <trajectory type="linear">
        <speed value="14"/>          <!-- Speed of the projectile - negative values and 0 have interesting, but not
                                          terribly useful effects.  Bug Notice: currently, in both Glest 3.1.2 and GAE
                                          0.2.8a, very high values for speeds may cause the engine to fail to detect a
                                          collision, resulting in an attack that both appears visually wrong and will
                                          not always (or ever) harm their intended targets. -->
        <!-- Note: scale & frequency unused -->
    </trajectory>

        <!-- or -->

    <trajectory type="parabolic">
        <speed value="16"/>
        <scale value="2.5"/>         <!-- Height of the parabolic arc -->
        <!-- Note: frequency unused -->
    </trajectory>

        <!-- or -->

    <trajectory type="spiral">
        <speed value="4"/>
        <scale value="1"/>           <!-- Width of the spiral -->
        <frequency value="0.5"/>     <!-- How often the spiral, uh, spirals -->
    </trajectory>

<!-- GAE Only  -->

        <!-- or -->

    <trajectory type="random">                <!-- Still fairly experimental, but used for lightening effects (has lots
                                                   of room for improvement!) This snippet taken from the FPM v0.2
                                                   priestess unit (unreleased at the time of this writing). -->
        <speed value="100.0"/>
        <scale value="0.3125"/>               <!-- The degree to which the trajectory at each elbow may vary, 1 = 360
                                                   degrees (the example of 0.3125 being 112.5 degrees of possible
                                                   variance) -->
        <frequency value="8"/>                <!-- How often the attack particle system randomizes it's path,
                                                   creating an elbow. -->
    </trajectory>

    <trajectory type=any>                     <!-- This section shows common parameters that have been added in GAE for
                                                   all trajectory types.  -->
        <start value="target"/>               <!-- (Optional) May be "self" or "target" (default is self) -->
        <start-offset x="0" y="30" z="0"/>    <!-- (Optional) Specify an offset from where the attack starts. -->
        <start-offset-var x="4" y="0" z="4"/> <!-- (Optional) Allows you to randomize the offset of the start location of the
                                                   attack. -->
        <end value="target"/>                 <!-- (Optional) May be "self" or "target" (default is target) -->
        <end-offset x="0" y="0" z="0"/>       <!-- (Optional) Same as start-offset -->
        <end-offset-var x="0" y="0" z="0"/>   <!-- (Optional) Same as start-offset-var -->
        <tracking value="true"/>              <!-- Attack never misses target (will track endpoint as they move).
                                                   This also counteracts the afore mentioned bug where very fast
                                                   attacks can fail to detect a collision. -->
    </trajectory>

<!-- /GAE Only  -->

</projectile-particle-system>

Back to GAE XML Reference