I’ve been having a play around and think I’ve answered a 2/3 of my own questions.
Question #2
Using an enum array for the ammo types and the firing mode works well. The array variables can be edited without changing the blueprint logic and the in both cases, the next enum in the sequence can be stepped through (dynamically based on the values in the array) by cycling through the array indices. Useful forum post + image of my logic in case it helps anyone else:
(Same logic for the fire modes, just using a separate set of variables)
Question #3:
I was attempting to use a blueprint interface to ‘send’ the relevant ammo type from the weapon component to the projectile. I had a few issues with this:
-
My blueprint interface setup not firing. Using an ‘enum to string’ node does work correctly with the ‘get data table row’ node, I just had mistakes in my setup.
-
I was trying to setup these parameters (via the blueprint interface) before the projectile actor had spawned. I believe this makes sense, since the actor doesn’t exist to receive this information before it is spawned. Since the projectile spawn logic is contained in the Weapon blueprint component, the solution was to create a ‘Current Ammo Type’ variable and tick ‘Expose on Spawn’ within the variable details panel. This feeds the information from the weapon blueprint to the projectile as it is spawned and has resolved my issue.
I’m still not 100% sure about Question #1, but I will continue to have a play around and see if I can improve my understanding. If anyone has any info on how this works it would be much appreciated, but otherwise I’m going to set this question to resolved. Hopefully the above might help someone else out