Yep, I’ve thought the same thing. A card system is basically just the ability system with a random number of abilities drawn from an array every turn which cannot be reused on the same turn. One of the changes I made in the last update was actually done with just this sort of thing in mind. Previously in order to have an ability accessible it had to be spawned at the beginning at the game (or at BeginPlay of a newly spawned unit) and then references assigned to these spawned abilities which were used by the ability system.
I changed this so that the ActivateAbility event in the player controller takes an ability class as input and not a reference and then it intelligently spawns a new ability or uses an already spawned one if it is accessible. This frees you from having to spawn all possible abilities that might be used during your game at the beginning (which in digital card games with random card gain effects etc. would need you to store a lot in memory).
Without checking I don’t this should require more than changing the array of ability class references in the ability system component at the start of a unit’s turn, though there might be some things I’m forgetting since I have not tested it myself. I think the ability bar might still make use of an array of hard references to abilities, which would prevent the UI from updating properly if you only use the array of classes. If so this is something I should look into changing in a future update. Let me know how it works out ![]()