I have been playing the game Forsaken recently, and the Status Effects / Modifiers have really intrigued me. I would love to replicate the same thing for my game, but I don’t know the best way to go around creating them or how they should be managed.
My current idea is to have a module with a dictionary containing the player and their current effects, modifying it from there, but I am not sure how to go about everything else without possibly creating long spaghetti code (such as applying every single effect with different actions depending on the effect) etc. Just want advice on how I should go about making this is all. Thanks!
Hey, could you give a little bit more context? I haven’t played Forsaken, i am not sure what you mean by status effects, if you could list like 2 and how they work, i’d appreciate that.
my totally foolproof super pro way of making this is just making some values inside the player and checking them when they get hit or smthin. (yes, all my code looks like spaghetti. no, I do not know how modules work)
What I have in my mind is having like internal character stats under every player, this would cover most effects present in Forsaken, like Helpless, Weakness or hidden effects, like healing or protection
It’d still be case by case basis, so you’d need a lot of Number and BoolValues, main example being Chance’s coin flip.
An example of how it can be done
-Chance flips his coin 5 times, getting Weakness on 3 of the flips
-The internal counter for Weakness (Weakness XII, XXIV, etc) goes by one
-A separate connection is made to listen to the change of the internal counter’s value (GetPropertyChangedSignal) that enables the Bool Value (think of it as “Weakness Enabled”)
-Establish the connection to the Bool value to set up a timer for the effect, with the timer resetting if the Weakness counter goes up
Other effects, like Shedletsky’s chicken slowly healing him or Dusekkar’s protection effect could all simply be Bool Values, with more complex stuff that requires more than one value (maybe you need to know who actually inflicted an effect on you) using something like a TextLabel object (there’s a lot of properties that you can use there)
Attributes are faster than this and I would also like for my code to be modular to fit in with my framework. I will probably just use a dictionary and make effects as their own modules that can be called under my main one. Thanks for the help everyone!