Jump to content

Need help to trigger buff on zombie when grenade explodes


doughphunghus

Recommended Posts

How/can you get an item/ammo (like a grenade or pipe bomb) to just knock zeds down (but for like 10 seconds not the built in stagger/fall and get back up) without them taking damage? Think "concussion grenade".

 

I'm making some basic mods and I can't seem to get buffs to apply to a zombie (when hit/affected by an explosion) other than the built in buffs that come with the thrown item (a grenade explodes and zeds are affected on its area of explosion, a moltov explodes and makes fire in an area, etc, but i cant get a moltov to apply a buff for a knockdown/ragdoll, or a grenade to explode without damage and just knock zeds down for a determined time (like 10 seconds)

Link to comment
Share on other sites

So you'd want something like this...

 

<item name="thrownGrenadeConcussion">
<property name="Tags" value="ammo,weapon,attPerception,perkDemolitionsExpert"/>
<property name="ItemTypeIcon" value="explosion"/>
<property name="DisplayType" value="ammoGrenadeContact"/>
<property name="Class" value="ItemClassTimeBomb"/>
<property name="HoldType" value="57"/>
<property name="Meshfile" value="#Other/Items?Weapons/Ranged/Grenade/GrenadePrefab.prefab"/>
<property name="DropScale" value="2.5"/>
<property name="Material" value="Mmetal"/>
<property name="Stacknumber" value="25"/>
<property name="EconomicValue" value="41"/>
<property name="Weight" value="0"/>
<property name="Explosion.ParticleIndex" value="13"/>
<property name="Explosion.RadiusBlocks" value="4"/>
<property name="Explosion.RadiusEntities" value="5"/>
<property name="Explosion.DamageBonus.earth" value="0"/> <!-- should work? -->
<property name="Explosion.DamageBonus.water" value="0"/>
<property name="Explosion.BlastPower" value="75"/> <!-- (int,100) how far ragdolls and such are flung -->
<property name="FuseTime" value="6"/>
<property name="FusePrimeOnActivate" value="true"/>
<property name="ExplodeOnHit" value="true"/>
<property name="StickPercent" value=".5"/>
<property name="UnlockedBy" value="perkYeahScience"/>
<property name="Group" value="Ammo/Weapons"/>
<property name="SoundUnholster" value="grenade_unholster"/>
<property class="Action0">
	<property name="Class" value="ThrowAway"/>
	<!-- <property name="Hitmask_override" value="Arrow"/> unfortunately this cannot work without a serious rewrite of the hitmask system -->
	<property name="Delay" value="1.2"/> <!-- obsolete if rounds per minute exists -->
	<property name="Throw_strength_default" value="8"/>
	<property name="Throw_strength_max" value="50"/>
	<property name="Max_strain_time" value="1.25"/>
	<property name="Sound_start" value="grenade_throw"/>
	<property name="Gravity" value="-5"/>
	<requirement name="CVarCompare" cvar="_underwater" operation="LT" value=".98"/>
</property>
<property class="Action1">
	<property name="Class" value="Activate"/>
	<property name="Delay" value="1"/>
	<property name="Sound_start" value="grenade_pullpin"/>
</property>
<property name="ThrowableDecoy" value="true"/>
<effect_group tiered="false">
	<triggered_effect name="onProjectileImpact" action="AddBuff" target="positionAOE" range="5" buff="buffInjuryKnockdown01"/>
</effect_group>
</item>

 

Specifically the triggered effect bit. I removed all damage from the grenade, set it to use a knockdown buff that already exists in the game, and set the range to the same as Explosion.RadiusEntities.

 

That bit of code tells the game to put out a buff within a 5 block radius (positionAOE) at the point of impact (onProjectileImpact). You CAN limit it to just zombies if you want, but that should work for everything. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...