ladies and gentlemen, im having some issues with a function to level up some stats for an rpg system. Im trying to go this route because I would rather not have 30 functions that could -potentially- be summed up with one nice one.
anyway, onto the code:
for the sake of writing this Im going to say that the stat im passing is Strength and the original value is 3.
void AParallelCharacter::StatIncrease(int32 Stat)
Stat += 1;
was the first thing I tried, which doesnt work, I -think- it initializes a new variable with the value of 3 and increments that by 1, an onscreen debug message gives me the value of 4, but if I run the function again, it stays at 4.
so then I started testing with pointers, and that ended up the same way, a bunch of 4’s on the screen, but the strength value was left unchanged.
so any thoughts on how I could go about having 1 simple function be called several times without needing a bunch of switch/case/if statements layered in there?