Skip to content

Instantly share code, notes, and snippets.

@Talv
Created November 18, 2017 02:52
Show Gist options
  • Save Talv/95fd1abb56be023d3b15adc9adb13f15 to your computer and use it in GitHub Desktop.
Save Talv/95fd1abb56be023d3b15adc9adb13f15 to your computer and use it in GitHub Desktop.
StarCraft II pre v4 loop elements definitions (Pick Each) for Trigger editor.
<?xml version="1.0" encoding="utf-8"?>
<TriggerData>
<Name>Loops Legacy</Name>
<Root>
<Item Type="Category" Id="C7DA882A"/>
<Item Type="Category" Id="1A13E77C"/>
<Item Type="Category" Id="C99865E1"/>
</Root>
<Element Type="Category" Id="C7DA882A">
<Name>Loops (Numbers)</Name>
<Item Type="FunctionDef" Id="9DE705AA"/>
<Item Type="FunctionDef" Id="D02F7ACF"/>
<Item Type="FunctionDef" Id="119A6AF8"/>
<Item Type="FunctionDef" Id="66474248"/>
</Element>
<Element Type="FunctionDef" Id="9DE705AA">
<Identifier>PickEachInteger</Identifier>
<Name>Pick Each Integer (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000002"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="E8C2EA0E"/>
<Parameter Type="ParamDef" Id="28E710F2"/>
<SubFunctionType Type="SubFuncType" Id="7C4B9D16"/>
<ScriptCode>
IntLoopBegin(#PARAM(s), #PARAM(e));
for ( ; !IntLoopDone() ; IntLoopStep() ) {
#SUBFUNCS(actions)
}
IntLoopEnd();
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="E8C2EA0E">
<Identifier>s</Identifier>
<Name>Start</Name>
<ParameterType>
<Type Value="int"/>
</ParameterType>
<Default Type="Param" Id="6E7F4CC7"/>
</Element>
<Element Type="Param" Id="6E7F4CC7">
<Name></Name>
<Value>1</Value>
<ValueType Type="int"/>
</Element>
<Element Type="ParamDef" Id="28E710F2">
<Identifier>e</Identifier>
<Name>End</Name>
<ParameterType>
<Type Value="int"/>
</ParameterType>
<Default Type="Param" Id="159D0D4A"/>
</Element>
<Element Type="Param" Id="159D0D4A">
<Name></Name>
<Value>10</Value>
<ValueType Type="int"/>
</Element>
<Element Type="SubFuncType" Id="7C4B9D16">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="D02F7ACF">
<Identifier>IntLoopCurrent</Identifier>
<Name>Picked Integer (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000002"/>
<FlagCall/>
<FlagNative/>
<ReturnType>
<Type Value="int"/>
</ReturnType>
</Element>
<Element Type="FunctionDef" Id="119A6AF8">
<Identifier>ForEachInteger2</Identifier>
<Name>For Each Real (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000002"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="AB8608EE"/>
<Parameter Type="ParamDef" Id="831502CC"/>
<Parameter Type="ParamDef" Id="1B5A5B98"/>
<Parameter Type="ParamDef" Id="938EF5BD"/>
<SubFunctionType Type="SubFuncType" Id="CDB3AEAE"/>
<ScriptCode>
#AUTOVAR(ae,fixed) = #PARAM(e);
#AUTOVAR(ai,fixed) = #PARAM(increment);
#PARAM(var) = #PARAM(s);
for ( ; ( (#AUTOVAR(ai) &gt;= 0 &amp;&amp; #PARAM(var) &lt;= #AUTOVAR(ae)) || (#AUTOVAR(ai) &lt;= 0 &amp;&amp; #PARAM(var) &gt;= #AUTOVAR(ae)) ) ; #PARAM(var) += #AUTOVAR(ai) ) {
#SUBFUNCS(actions)
}
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="AB8608EE">
<Identifier>var</Identifier>
<Name>Variable</Name>
<ParameterType>
<Type Value="anyvariable"/>
<VariableType Value="fixed"/>
</ParameterType>
<ParamFlagMatchConst/>
</Element>
<Element Type="ParamDef" Id="831502CC">
<Identifier>s</Identifier>
<Name>Start</Name>
<ParameterType>
<Type Value="fixed"/>
</ParameterType>
<Default Type="Param" Id="255B403B"/>
</Element>
<Element Type="Param" Id="255B403B">
<Name></Name>
<Value>1.0</Value>
<ValueType Type="fixed"/>
</Element>
<Element Type="ParamDef" Id="1B5A5B98">
<Identifier>e</Identifier>
<Name>End</Name>
<ParameterType>
<Type Value="fixed"/>
</ParameterType>
<Default Type="Param" Id="79F9D0C1"/>
</Element>
<Element Type="Param" Id="79F9D0C1">
<Name></Name>
<Value>10.0</Value>
<ValueType Type="fixed"/>
</Element>
<Element Type="ParamDef" Id="938EF5BD">
<Identifier>increment</Identifier>
<Name>Increment</Name>
<ParameterType>
<Type Value="fixed"/>
</ParameterType>
<Default Type="Param" Id="B1210F18"/>
</Element>
<Element Type="Param" Id="B1210F18">
<Name></Name>
<Value>1.0</Value>
<ValueType Type="fixed"/>
</Element>
<Element Type="SubFuncType" Id="CDB3AEAE">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="66474248">
<Identifier>ForEachInteger</Identifier>
<Name>For Each Integer (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000002"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="8CB41668"/>
<Parameter Type="ParamDef" Id="F13E2CDE"/>
<Parameter Type="ParamDef" Id="C25E6187"/>
<Parameter Type="ParamDef" Id="F3144A4A"/>
<SubFunctionType Type="SubFuncType" Id="DAF49931"/>
<ScriptCode>
#AUTOVAR(ae) = #PARAM(e);
#AUTOVAR(ai) = #PARAM(increment);
#PARAM(var) = #PARAM(s);
for ( ; ( (#AUTOVAR(ai) &gt;= 0 &amp;&amp; #PARAM(var) &lt;= #AUTOVAR(ae)) || (#AUTOVAR(ai) &lt;= 0 &amp;&amp; #PARAM(var) &gt;= #AUTOVAR(ae)) ) ; #PARAM(var) += #AUTOVAR(ai) ) {
#SUBFUNCS(actions)
}
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="8CB41668">
<Identifier>var</Identifier>
<Name>Variable</Name>
<ParameterType>
<Type Value="anyvariable"/>
<VariableType Value="int"/>
</ParameterType>
<ParamFlagMatchConst/>
</Element>
<Element Type="ParamDef" Id="F13E2CDE">
<Identifier>s</Identifier>
<Name>Start</Name>
<ParameterType>
<Type Value="int"/>
</ParameterType>
<Default Type="Param" Id="777D3D26"/>
</Element>
<Element Type="Param" Id="777D3D26">
<Name></Name>
<Value>1</Value>
<ValueType Type="int"/>
</Element>
<Element Type="ParamDef" Id="C25E6187">
<Identifier>e</Identifier>
<Name>End</Name>
<ParameterType>
<Type Value="int"/>
</ParameterType>
<Default Type="Param" Id="1B913C60"/>
</Element>
<Element Type="Param" Id="1B913C60">
<Name></Name>
<Value>10</Value>
<ValueType Type="int"/>
</Element>
<Element Type="ParamDef" Id="F3144A4A">
<Identifier>increment</Identifier>
<Name>Increment</Name>
<ParameterType>
<Type Value="int"/>
</ParameterType>
<Default Type="Param" Id="64BDC6CD"/>
</Element>
<Element Type="Param" Id="64BDC6CD">
<Name></Name>
<Value>1</Value>
<ValueType Type="int"/>
</Element>
<Element Type="SubFuncType" Id="DAF49931">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="Category" Id="1A13E77C">
<Name>Loops (Players)</Name>
<Item Type="FunctionDef" Id="B525B112"/>
<Item Type="FunctionDef" Id="5084725D"/>
<Item Type="FunctionDef" Id="8570CA61"/>
</Element>
<Element Type="FunctionDef" Id="B525B112">
<Identifier>ForEachPlayerInGroup</Identifier>
<Name>For Each Player In Player Group (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000011"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="857209C7"/>
<Parameter Type="ParamDef" Id="A4B226A9"/>
<SubFunctionType Type="SubFuncType" Id="DF50D5F0"/>
<ScriptCode>
#AUTOVAR(g, playergroup) = #PARAM(group);
#AUTOVAR(p) = 1;
for ( ; #AUTOVAR(p) &lt;= PlayerGroupCount(#AUTOVAR(g)) ; #AUTOVAR(p) += BoolToInt(#PARAM(var) == PlayerGroupPlayer(#AUTOVAR(g), #AUTOVAR(p))) ) {
#PARAM(var) = PlayerGroupPlayer(#AUTOVAR(g), #AUTOVAR(p));
#SUBFUNCS(actions)
}
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="857209C7">
<Identifier>var</Identifier>
<Name>Player Variable</Name>
<ParameterType>
<Type Value="anyvariable"/>
<VariableType Value="int"/>
</ParameterType>
</Element>
<Element Type="ParamDef" Id="A4B226A9">
<Identifier>group</Identifier>
<Name>Player Group</Name>
<ParameterType>
<Type Value="playergroup"/>
</ParameterType>
<Default Type="Param" Id="B4237C3C"/>
</Element>
<Element Type="Param" Id="B4237C3C">
<Name></Name>
<FunctionCall Type="FunctionCall" Id="8C1516A3"/>
</Element>
<Element Type="FunctionCall" Id="8C1516A3">
<Name></Name>
<FunctionDef Type="FunctionDef" Library="Ntve" Id="00000192"/>
</Element>
<Element Type="SubFuncType" Id="DF50D5F0">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="5084725D">
<Identifier>PickEachPlayerInGroup</Identifier>
<Name>Pick Each Player In Player Group (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000011"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="42AB3EFD"/>
<SubFunctionType Type="SubFuncType" Id="DEA91B62"/>
<ScriptCode>
PlayerGroupLoopBegin(#PARAM(group));
for ( ; !PlayerGroupLoopDone() ; PlayerGroupLoopStep() ) {
#SUBFUNCS(actions)
}
PlayerGroupLoopEnd();
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="42AB3EFD">
<Identifier>group</Identifier>
<Name>Player Group</Name>
<ParameterType>
<Type Value="playergroup"/>
</ParameterType>
<Default Type="Param" Id="F4D458E8"/>
</Element>
<Element Type="Param" Id="F4D458E8">
<Name></Name>
<FunctionCall Type="FunctionCall" Id="04FEA699"/>
</Element>
<Element Type="FunctionCall" Id="04FEA699">
<Name></Name>
<FunctionDef Type="FunctionDef" Library="Ntve" Id="00000192"/>
</Element>
<Element Type="SubFuncType" Id="DEA91B62">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="8570CA61">
<Identifier>PlayerGroupLoopCurrent</Identifier>
<Name>Picked Player (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000011"/>
<FlagCall/>
<FlagNative/>
<ReturnType>
<Type Value="int"/>
</ReturnType>
</Element>
<Element Type="Category" Id="C99865E1">
<Name>Loops (Units)</Name>
<Item Type="FunctionDef" Id="C4DC760C"/>
<Item Type="FunctionDef" Id="00000327"/>
<Item Type="FunctionDef" Id="19CE733E"/>
</Element>
<Element Type="FunctionDef" Id="C4DC760C">
<Identifier>PickEachUnitInGroup</Identifier>
<Name>Pick Each Unit In Unit Group (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000013"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="F96B466D"/>
<SubFunctionType Type="SubFuncType" Id="9441B8B5"/>
<ScriptCode>
UnitGroupLoopBegin(#PARAM(group));
for ( ; !UnitGroupLoopDone() ; UnitGroupLoopStep() ) {
#SUBFUNCS(actions)
}
UnitGroupLoopEnd();
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="F96B466D">
<Identifier>group</Identifier>
<Name>Unit Group</Name>
<ParameterType>
<Type Value="unitgroup"/>
</ParameterType>
<Default Type="Param" Id="DA9ADFC2"/>
</Element>
<Element Type="Param" Id="DA9ADFC2">
<Name></Name>
<FunctionCall Type="FunctionCall" Id="C5C6409E"/>
</Element>
<Element Type="FunctionCall" Id="C5C6409E">
<Name></Name>
<FunctionDef Type="FunctionDef" Library="Ntve" Id="00000141"/>
</Element>
<Element Type="SubFuncType" Id="9441B8B5">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="00000327">
<Identifier>ForEachUnitInGroup</Identifier>
<Name>For Each Unit In Unit Group (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000013"/>
<FlagAction/>
<FlagSubFunctions/>
<FlagAllowBreak/>
<Parameter Type="ParamDef" Id="00000617"/>
<Parameter Type="ParamDef" Id="00000618"/>
<SubFunctionType Type="SubFuncType" Id="00000007"/>
<ScriptCode>
#AUTOVAR(g, unitgroup) = #PARAM(group);
#AUTOVAR(u) = 1;
for ( ; #AUTOVAR(u) &lt;= UnitGroupCount(#AUTOVAR(g), c_unitCountAll) ; #AUTOVAR(u) += BoolToInt(#PARAM(var) == UnitGroupUnit(#AUTOVAR(g), #AUTOVAR(u))) ) {
#PARAM(var) = UnitGroupUnit(#AUTOVAR(g), #AUTOVAR(u));
#SUBFUNCS(actions)
}
</ScriptCode>
</Element>
<Element Type="ParamDef" Id="00000617">
<Identifier>var</Identifier>
<Name>Unit</Name>
<ParameterType>
<Type Value="anyvariable"/>
<VariableType Value="unit"/>
</ParameterType>
</Element>
<Element Type="ParamDef" Id="00000618">
<Identifier>group</Identifier>
<Name>Unit Group</Name>
<ParameterType>
<Type Value="unitgroup"/>
</ParameterType>
<Default Type="Param" Id="00000492"/>
</Element>
<Element Type="Param" Id="00000492">
<Name></Name>
<FunctionCall Type="FunctionCall" Id="00000149"/>
</Element>
<Element Type="FunctionCall" Id="00000149">
<Name></Name>
<FunctionDef Type="FunctionDef" Library="Ntve" Id="00000141"/>
</Element>
<Element Type="SubFuncType" Id="00000007">
<Identifier>actions</Identifier>
<Name>Actions</Name>
<Action/>
</Element>
<Element Type="FunctionDef" Id="19CE733E">
<Identifier>UnitGroupLoopCurrent</Identifier>
<Name>Picked Unit (Legacy)</Name>
<Label Type="Label" Library="Ntve" Id="00000013"/>
<FlagCall/>
<FlagNative/>
<ReturnType>
<Type Value="unit"/>
</ReturnType>
</Element>
</TriggerData>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment