Difference between revisions of "Operator Element"
Jump to navigation
Jump to search
→Copy Operator
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> <!-- Set the new x position to be 50 pixels --> | ||
<Copy> 50 </Copy> | <Copy> 50 </Copy> | ||
</x> | </x> | ||
<y> <!-- Set the new y position to match y position of "otherimage" --> | |||
<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> <!-- set by script or end user to 1,2, or 3 --> | |||
<_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" /> <!-- current value set to user selection --> | |||
<copy src="me()" trait="_srcfile_"/> <!-- which then determines which file --> | |||
</filename> <!-- path is actually copied --> | |||
</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 == |