Hi everyone.
I have 2 questions, so here’s the situation…
I have an item system, which means I also have a Data table that contains each of the items information.
Let me make this short and say we only have DT_Weapons.
Which has several rowname of:
Assault_Rifle
Shotgun
Sniper
Bow
Pistol
During basic gameplay, when going to buy an item, I call the DT_Weapons to spawn these items.
I buy any item I want, let’s say Sniper.
The sniper has 20 damage as an example.
Now, here’s the hard part…
Let’s say I saved the game.
But, it seems that I had to balance the Sniper’s damage a bit, because it’s overpowered.
so inside of the DT_Weapons, I change the damage for the Sniper to 15.
But also, maybe I want to rename the Sniper to Operator, so I do that too.
Now the problem is… when I load the game again, the old values are still there.
I still have a weapon named “Sniper” with “20 Damage”
Instead of “Operator” with “15 Damage”.
Now, there is something very important to keep in mind, a weapon can have a rarity, and that rarity might impact its damage…
so I can’t just SET the damage to 15, instead I need to say that the new damage is 20 - 5 = 15
If we assumed the sniper was legendary, and it s 30 damage, it needs to go down to 25 damage, because the base default stat was decreased by 5.
You see, I know I hadn’t made any modifications to the saved data, and that is the entirety of my question.
So… my first question is…
Is there some official or efficient way/method to automatically Patch up the saved data before loading it?
Or is this something I have to figure out on my own?
AKA actually make THE automated system that does this?
So it’d go for all weapons, check which one was changed, and update its values.
Another question that’s related to this…
Let’s assume I can access the DT_Weapons from another DT, say DT_Unit as an example.
In this DT_Unit I can specify for each unit type/class which weapons it has.
Item selection example:
As it stands right now, if I select a weapon, then go to DT_Weapons and change that weapon’s name to something else, it doesn’t get updated in DT_Unit.
Which of course would be tedious to fix for each unit type/class I have.
Example: Unit Scout has Sniper
Sniper is changed to Operator.
Unit Scout is still referencing “Sniper” but it no longer exists…
Therefore, an error would occur.
So, is there a way to avoid this?
While also being able to change the weapon name?
That’s all.