I’m working on a top down shooter and I’m coming in a bit of a struggle right now.
My animation flipbooks are divided into lower body (idle, walking, running, strafing) and upper body (idle, moving, shooting, etc.).
I have an Enumeration for the MovementState (idle, walking, running) and another one for the EquipmentState (which weapon currently is equipped).
The lower body doesn’t cause any problems, but the upper body animation is dependent on both the Movement and the Equipment. When I start/stop shooting, I have to select idle/shooting plus dependent on which weapon I am holding… This slowly becomes a load of flipbooks (and branches) as I have 3 different animations for each of the #insert_number# different weapons.
So I thought I could use dictionaries for this sort of thing and it seems pretty convenient to me… simple key-value pairs, you’d feed it your current EquipmentState and get the associated animation flipbook.
But now I’d need this as a table, one Key would be the EquipmentState, the other one would be the MovementState (in order to switch back to idle when I stop shooting or whatever). Basically like a table, every row is a different weapon, every column a different MovementState… Is that possible?
Or do you know of any other way for doing something like this?
Thanks in advance!
PS - other thoughts on solving this:
- I could add in one dictionary for each weapon there is to equip (EquipmentState enum, Flipbook ref) and select the appropriate dictionary using a switch on MovementState (but that would lead to, like, 13 different dictionaries in my Character BP)
- I tried making the UpperBody a ChildActorComponent and making every Weapon a different Actor, all derived from a parent class UpperBody, so I always call the same functions (shoot, move, whatever) but I can feed it different flipbooks… (which again leaves me with, like, 13 different Actors for all my equipment…)
- I read about DataTables, but those are only for base values, not for Flipbook (or other) references, are they?