The_Great_Sephiroth Posted August 8, 2023 Share Posted August 8, 2023 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. Link to comment Share on other sites More sharing options...
BFT2020 Posted August 8, 2023 Share Posted August 8, 2023 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 More sharing options...
The_Great_Sephiroth Posted August 8, 2023 Author Share Posted August 8, 2023 (edited) 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 August 8, 2023 by The_Great_Sephiroth Clarity (see edit history) Link to comment Share on other sites More sharing options...
The_Great_Sephiroth Posted August 8, 2023 Author Share Posted August 8, 2023 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. Link to comment Share on other sites More sharing options...
The_Great_Sephiroth Posted August 9, 2023 Author Share Posted August 9, 2023 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 More sharing options...
BFT2020 Posted August 9, 2023 Share Posted August 9, 2023 I will see if I recall anyone adding traps with buffs, but at the top of my head, I can't think of any Link to comment Share on other sites More sharing options...
The_Great_Sephiroth Posted August 10, 2023 Author Share Posted August 10, 2023 The electric fence does it, and I literally copy/pasted at one point to test the shock buff. It did not work. I cannot figure out why that buff only works on the fence. My gut again tells me something in C# makes the electric fence work with buffs but nothing else. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now