Jump to content

Applying a buff to a trap?


Recommended Posts

3 minutes ago, The_Great_Sephiroth said:

I'm working on a new trap and am not sure how to add an effect to it.  When it collides with the player or zeds and does damage I want there to be a chance for an effect, such as bleeding or burning. How can I tie this into a trap? Something like a flaming blade trap or a razor-sharp blade trap.

 

Check how they do with either the electric fences or spike traps, I believe those apply buffs (electric shock, bleeding).

Link to comment
Share on other sites

I checked the "barbedFence" and saw none, didn't think of the "electricfencepost". Thanks for making my brain work again. The example I provided above does make for a cool concept. Elemental blade traps. Applies burning, freezing, or bleeding damage. Yes, blood is now an element!

 

Update:

For others who want to do this, to add a buff (damage like shock) when a trap or whatever hits a target, the following two lines must be in your block definition.

<property name="Buff" value="buffShocked"/>
<property name="BuffChance" value="1"/>

I am assuming that BuffChance is 0.1 through 1.0, with 1 being 100% chance to apply, and 0.1 being a 10% chance to apply.

Edited by The_Great_Sephiroth
Clarity (see edit history)
Link to comment
Share on other sites

Okay, I have a new problem. For whatever reason, I get console errors when the game attempts to apply the bleeding buff to me. See the attached screenshot. I have tried "buffInjuryBleedingBarbedWire", "buffInjuryBleedingTwo", and "buffInjuryBleeding". All three fail to apply but do give errors. The thing is, I am not sure why. Clearly I am doing something wrong, but I do not know what.

 

For reference, I simply made a modlet to test with that contains the following in "Blocks.xml". Nothing else!


<configs>

    <insertAfter xpath="/blocks/block[@name='bladeTrap']/property[@name='TakeDelay']">
        <property name="Buff" value="buffInjuryBleedingBarbedWire"/>
        <property name="BuffChance" value="0.35"/>
    </insertAfter>

</configs>

It applies without warning or error, but when you walk into a blade trap you get the screenshot below.

251570_20230807214238_1.png

Link to comment
Share on other sites

I have tried this with "BuffShocked" and the same thing happens. Not sure what is causing this, but my gut tells me that the fence and barbed wire have special C# code that the blade trap does not have. Maybe it's because the blade trap physically hits you (spinning blades) and needs the buff applied on hit? Is that possible?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...