I’m having issues in my project. I’ve spent hours trying to figure it out but with no result.
I’m trying to assign unique debuffs/effects to NPCs on my level (Each NPC gets a different debuff than the other NPCs). When I interact with the NPC, I clear the debuff, and make the debuff available again, so that it can be applied again, but there can never be duplicates.
I’ve got arrays of All debuffs and Active debuffs, BP for the NPC, and a BP for a manager that handles the debuffs. I believe I’m having issues managing the arrays.
I think I might be complicating the project too much. Would you be so kind and provide me with a general idea of how could I tackle the logic?
Thank you for your reply. Let me be more precise, I want to implement a simple system, that:
-assigns a debuff to a single random NPC periodically,
-it can target only unaffected NPCs,
-2 NPCs can’t be affected by the same debuff at the same time,
-debuff starts a timer for the NPC, after the timer ends, the NPC dies,
-each debuff requires that the player brings a different item to the npc (debuffs are permanently linked with those items)
-if the player brings the correct item, it clears the debuff
-the debuff goes back to a pool of “available debuffs” and can be applied again
-after certain time, the NPC can be again affected by the debuff
-there’s 5 NPCs and 5 debuffs
I believe I’m having issues moving the debuffs between “Available” arrays, and “Used” arrays. I’m getting really strange results after “clearing” the debuff. It’s like the debuffs disappear from the array, even though each time I’m “healing” the NPC, I add the debuff back to the Available Array.
I would greatly appreciate your help. Maybe you have a better idea of how I could approach this task. Thank you!
each buff is a component and has a life of its own; you get a full graph and support for inheritance - complexity of their functionality (what they do) is not an issue. It’s all fully dynamic.
the buff manager keeps track of things but we never add / remove stuff, merely flag what’s available:
Thanks so much, filtering active debuffs just got much easier. Now I’m wondering what would be the best way to make sure that the debuff doesn’t get replaced. Is there a way to check if the target npc already has the component? Thanks, I really appreciate your support.
I want to then remove the debuff by interacting with the affected NPC. However, whenever I enter the trigger box of any of the NPCs, I remove the debuff. How can I allow interaction with only the affected NPC? Can the debuff itself have a trigger volume?
If the debuff is already present then it would probably be more optimal to keep it and just extend the existing debuff’s time.
Less GC movement.
If they can stack then just up the multiplier.