I want to unify the processing between a fixed loadout for AI and an editable loadout for the player, but is there any way to do this other than adding the same variables?
Since it’s still in the initial build stage, it needs frequent editing, and coordinating actor events while editing these two things is a bit tedious.
Custom structures are easily broken during editing, SaveGame cannot be templated, and DataAsset cannot be edited and saved. This means that none of the features can accommodate cases where you want to have both custom and fixed data.
Is there a better way?It’s a minor detail, but I think it would be very convenient if this could be done.
Could use a DA to set variables in your pawns on begin play (or cons script) instead of having equipment look it up directly from the DA. And for player, have it so the DA only sets vars on begin play if it isn’t set in the save. IE load save, get vars, then branch off of my_equip_var = none , if true set var from DA. Then player would get default loadout in a new game or match.
I think that would require separate processes to extract values from DA and SaveGame.Get is required for all values.To minimize these issues, I thought it would be great if we could implement a common container for both sides and put all the values into it.
Currently, the only editable containers available are custom structures, but these break frequently, so they’re not a viable option.
Structures are viable. Lots of games use them. You just need to nail down the layout early and avoid touching it again. Or use an intermediary class that deals with structs and use an interface or something to move member vars between objects, so that you only really need to fix pins and recompile the middleman class if you change the struct. For something like inventory, that could (and arguably should) be an actor component that’s used by all characters and such. Then if you change a struct to add another var, just recompile the AC blueprint.