Gord

AA Deletion Trigger

Oct 3rd, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.02 KB | None | 0 0
  1.   <!--Single-use AAs; Auto Turret and Regen Field-->
  2.  
  3. <PlayerVariables> <!--implement this immediately after </GlobalVariables>-->
  4.   <Numeric>
  5.     <Var networkState="HighPriority" name="PlayerNumeric0" varRefType="Int16">0</Var>
  6.   </Numeric>
  7. </PlayerVariables>
  8.  
  9.  
  10. <Trigger execMode="OnEachPlayer" name="Trigger20"> <!--change the trigger number as necessary-->
  11.  <Elements>
  12.   <E type="Action" name="VariableOperation"> <!--clear scratch-->
  13.     <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  14.     <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="NONE" />
  15.     <Param type="OperationType">Set</Param>
  16.   </E>
  17.   <E type="Action" name="PlayerGetArmorAbility"> <!--get reference to player's AA-->
  18.     <Param type="PlayerReference" varRefType="ExplicitPlayerType" dataType="Iterator.Player" />
  19.     <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  20.   </E>
  21.   <E type="Action" name="Branch"> <!--flagged AA deletion-->
  22.     <Param type="VirtualTrigger">
  23.       <VT type="VirtualTrigger">
  24.         <E type="Condition" name="Comparison" unionGroupID="-2"> <!--if usage flag active-->
  25.           <Param type="VarReference" varRefKind="Custom" varRefType="Player.NumericVar" dataType="Iterator.Player">PlayerNumeric0</Param>
  26.           <Param type="VarReference" varRefKind="Custom" varRefType="Int16">1</Param>
  27.           <Param type="ComparisonType">Equal</Param>
  28.         </E>
  29.         <E type="Condition" name="ObjectIsSameType" unionGroupID="-2"> <!--and the AA is auto turret-->
  30.           <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  31.           <Param type="ObjectTypeIndex">auto_turret</Param>
  32.         </E>
  33.         <E type="Condition" name="ObjectIsSameType" unionGroupID="-3"> <!--or the AA is regen-->
  34.           <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  35.           <Param type="ObjectTypeIndex">regen_field_equipment</Param>
  36.         </E>    
  37.         <E type="Action" name="Branch">
  38.           <Param type="VirtualTrigger">
  39.             <VT type="VirtualTrigger">
  40.               <E type="Condition" name="EquipmentIsInUse" unionGroupID="-2" invert="True"> <!--if equipment is not in use-->
  41.                 <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  42.               </E>
  43.               <E type="Action" name="DeleteObject"> <!--delete referenced object/the player's AA-->
  44.                 <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  45.               </E>
  46.               <E type="Action" name="VariableOperation"> <!--reset player's usage flag-->
  47.                 <Param type="VarReference" varRefKind="Custom" varRefType="Player.NumericVar" dataType="Iterator.Player">PlayerNumeric0</Param>
  48.                 <Param type="VarReference" varRefKind="Custom" varRefType="Int16">0</Param>
  49.                 <Param type="OperationType">Set</Param>
  50.               </E>
  51.             </VT>      
  52.           </Param>
  53.         </E>
  54.       </VT>
  55.     </Param>
  56.   </E>
  57.   <E type="Action" name="Branch"> <!--flag in-use AAs-->
  58.     <Param type="VirtualTrigger">
  59.       <VT type="VirtualTrigger">
  60.         <E type="Condition" name="EquipmentIsInUse" unionGroupID="-2"> <!--if the equipment is in use-->
  61.           <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  62.         </E>
  63.         <E type="Condition" name="ObjectIsSameType" unionGroupID="-2"> <!--and it's an autoturret-->
  64.           <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  65.           <Param type="ObjectTypeIndex">auto_turret</Param>
  66.         </E>
  67.         <E type="Condition" name="ObjectIsSameType" unionGroupID="-3"> <!--or it's regen-->
  68.           <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="ObjectScratch0" />
  69.           <Param type="ObjectTypeIndex">regen_field_equipment</Param>
  70.         </E>
  71.         <E type="Action" name="VariableOperation"> <!--activate usage flag-->
  72.           <Param type="VarReference" varRefKind="Custom" varRefType="Player.NumericVar" dataType="Iterator.Player">PlayerNumeric0</Param>
  73.           <Param type="VarReference" varRefKind="Custom" varRefType="Int16">1</Param>
  74.           <Param type="OperationType">Set</Param>
  75.         </E>
  76.       </VT>
  77.     </Param>
  78.   </E>
  79.  </Elements>
  80. </Trigger>
  81.  
  82. <!--Additional AAs - thruster works okay but the rest need additional code to work properly with this script-->
  83. <!-- <Param type="ObjectTypeIndex">jet_pack_equipment</Param> -->
  84. <!-- <Param type="ObjectTypeIndex">thruster_pack_equipment</Param> -->
  85. <!-- <Param type="ObjectTypeIndex">xray</Param> --> <!--Promethean vision-->
  86. <!-- <Param type="ObjectTypeIndex">reflective_shield</Param> --> <!--Hardlight shield-->
  87. <!-- <Param type="ObjectTypeIndex">hologram_equipment</Param> --> <!--DOES NOT WORK WITH THIS SCRIPT-->
  88. <!-- <Param type="ObjectTypeIndex">active_camo_equipment</Param> -->
Advertisement
Add Comment
Please, Sign In to add comment