Is there any way to use 'else' for triggered_effects?
For example:
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="SetItemMetaFloat" change="2" relative="true" key="charge">
<requirement name="IsAlive" target="other"/>
<requirement name="CompareItemMetaFloat" operation="LTE" value="2" key="charge"/>
</triggered_effect>
In this XML when I trigger secondary action, it adds two charges if the current charge is equal to or less than 2.
But if it is greater than 2, it does nothing!
I was wondering if I could make it do another action in the same triggered_effect!
Or, I'd like to know if it's possible to use 1 triggered_effect inside another, as in this example:
<triggered_effect trigger="onSelfSecondaryActionRayHit">
<requirement name="RandomRoll" seed_type="Random" min_max="1,50" operation="LTE" value="100"/><!-- This RandomRoll -->
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="SetItemMetaFloat" change="2" relative="false" key="charge">
<requirement name="IsAlive" target="other"/>
<requirement name="CompareItemMetaFloat" operation="Equals" value="2" key="charge"/>
</triggered_effect>
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="AddPart" part="Sparks" prefab="ParticleEffects/p_electric_shock_small" parentTransform="Handle" localPos="0,0,0" localRot="0,0,0">
<requirement name="CompareItemMetaFloat" operation="Equals" value="4" key="charge"/></triggered_effect>
</triggered_effect>
And if this really works, for example, what I wanted in this one is that if RandomRoll gives true, then the other trigger_effects would be triggered.
For example:
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="SetItemMetaFloat" change="2" relative="true" key="charge">
<requirement name="IsAlive" target="other"/>
<requirement name="CompareItemMetaFloat" operation="LTE" value="2" key="charge"/>
</triggered_effect>
In this XML when I trigger secondary action, it adds two charges if the current charge is equal to or less than 2.
But if it is greater than 2, it does nothing!
I was wondering if I could make it do another action in the same triggered_effect!
Or, I'd like to know if it's possible to use 1 triggered_effect inside another, as in this example:
<triggered_effect trigger="onSelfSecondaryActionRayHit">
<requirement name="RandomRoll" seed_type="Random" min_max="1,50" operation="LTE" value="100"/><!-- This RandomRoll -->
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="SetItemMetaFloat" change="2" relative="false" key="charge">
<requirement name="IsAlive" target="other"/>
<requirement name="CompareItemMetaFloat" operation="Equals" value="2" key="charge"/>
</triggered_effect>
<triggered_effect trigger="onSelfSecondaryActionRayHit" action="AddPart" part="Sparks" prefab="ParticleEffects/p_electric_shock_small" parentTransform="Handle" localPos="0,0,0" localRot="0,0,0">
<requirement name="CompareItemMetaFloat" operation="Equals" value="4" key="charge"/></triggered_effect>
</triggered_effect>
And if this really works, for example, what I wanted in this one is that if RandomRoll gives true, then the other trigger_effects would be triggered.
Last edited by a moderator: