• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

[HELP] Possible to change a <property> value using <triggered_effect>?

So basically what I want is more exploding zombo heads without making them all die instantly. My two ideas for achieving this were adding triggered_effect to zombieTemplateMale effect_group that modifies their head dismemberment multiplier:

1. Using a triggered_effect with <requirement name="StatCompare" stat="HealthLoss" operation="GTE" value="Health"/> (if they take more damage than they have health, DismemberMultiplierHead goes up to x10. I don't know if this would even work or if it would apply the multiplier before the damage is dealt.)

2. If that didn't work, use <requirement name="StatComparePercCurrentToMax" stat="health" operation="LTE" value=".5"/> (When they are at less than or equal to 50% hp, their DismemberMultiplierHead changes to 10.)

The problem is, DismemberMultiplierHead can only be set as a property rather than a passive_effect in the effect_group, and it seems like I can only modify values contained in an effect_group with triggered_effect action="ModifyStat". The only time I've seen a property altered with a triggered_effect is in buffInjuryCrippled1 where action="AnimatorSetInt" is used to change the WalkType value. But trying to use that action didn't work.

Any ideas how to change a property or another way to achieve this goal?

 
The unfortunate thing about wanting to do this...I found this in the A16.4 file. Apparently there was already a property to accomplish what I want but it was removed in A17 and no longer seems to do anything when re-added :(

<property name="HeadDismemberThreshold" value="0.23"/> <!-- if the total damage exceeds that value, there is a chance for dismemberment -->

 
Just talking to myself some more lol. For anyone interested in this type of mod, this is the best I could come up with using xpath:

Added to entityclasses

Code:
<append xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/effect_group">
<triggered_effect trigger="onOtherDamagedSelf" action="AddBuff" target="other" buff="buffHeadshot">
	<requirement name="StatComparePercCurrentToMax" stat="health" operation="LTE" value="0.5"/>
</triggered_effect>
</append>
Then added this to buffs

Code:
  <append xpath="/buffs">
<buff name="buffHeadshot" name_key="Headsplosion" description_key="Next shot is a headsplosion" tooltip_key="" icon="ui_game_symbol_head_shot" icon_color="255,0,0">
	<stack_type value="ignore"/>
	<duration value="10"/>
	<update_rate value="0.5"/>

	<effect_group>
		<passive_effect name="DismemberChance" operation="base_add" value="1" tags="head"/>
		<triggered_effect trigger="onSelfKilledOther" action="RemoveBuff" target="self" buff="buffHeadshot"/>
	</effect_group>
</buff>
 </append>
When a zombie is damaged to 50% hp or below, it adds a buff to the player that increases head dismember chance to 100% until a zombie is killed upon which the buff is removed. Only an issue for weapons that otherwise take more than 3 headshots to kill, which works out for me since I increased base headshot damage to +150% anyway. Hp % buff trigger could be lowered otherwise. I intend to add separate triggers to stronger enemies such as the zombieWightFeral and zombieFatCop base templates with lower hp % to prevent making them too easy. Edit: Or instead of StatComparePercCurrentToMax I could just use StatCompare hp <=75... That's 50% for standard zombies and covers the stronger ones.

Cons:

Don't know if it's even possible through .xml editing to make it so any 1 shot kill from max hp causes a headsplosion. May need SDX...

Can exploit by taking one zombie to <=50% then shooting a different zombie. Oh well.

 
Last edited by a moderator:
Back
Top