Difference between revisions of "Operator Element"

Jump to navigation Jump to search
1,203 bytes added ,  17:56, 8 April 2010
imported>JRoush
m
imported>JRoush
Line 45: Line 45:
The only unary (single-operand) operator.  The <copy> operator ''replaces'' the current property value with its contents:
The only unary (single-operand) operator.  The <copy> operator ''replaces'' the current property value with its contents:
  <image>
  <image>
   <x>
   <x> &lt;!-- Set the new x position to be 50 pixels --&gt;
      &lt;!-- Set the new x position to be 50 pixels --&gt;
       <Copy> 50 </Copy>
       <Copy> 50 </Copy>
   </x>
   </x>
  <y> &lt;!-- Set the new y position to match y position of "otherimage" --&gt;
      <Copy src="otherimage" trait="y" />
  </y>
  </image>
  </image>
There is a special mechanic built in for copying values from 'custom' property elements that have types of the form ''_CustomPropertyName_#'', where # is an integer greater than zero.  In this case, it is possible to set the '[[Traits|trait]]' to just ''_CustomPropertyName_'' and the engine will ''automatically'' append the current value of the property to the end.  For example:
<image>
    <user0> </user0> &lt;!-- set by script or end user to 1,2, or 3 --&gt;
    <_srcfile_1> MyMod\apple.dds  </_srcfile_1>
    <_srcfile_2> MyMod\pear.dds  </_srcfile_2>
    <_srcfile_3> MyMod\banana.dds </_srcfile_3>
    <filename>
      <copy src="me()" trait="user0" /> &lt;!-- current value set to user selection --&gt;
      <copy src="me()" trait="_srcfile_"/> &lt;!-- which then determines which file --&gt;
    </filename>                            &lt;!-- path is actually copied --&gt;
</image>
As implied by the example above, the Copy operator is the only operator that will work with string values, both as literals and copied from other string-type properties.


== Algebraic Operators ==
== Algebraic Operators ==
Anonymous user

Navigation menu