I have an npc generator that randomly selects modules from several arrays (one for head pieces, chest, legs, etc.) and merges them. This randomization happens per instance. But I want that when one instace gets spawned, it should retain the data of the modules that conform the NPC.
So if an NPC is spawned with chainmail X, helmet Y and shoes Z, when the NPC gets despawned or the player closes the game and reloads the save file, this NPC should still be wearing X Y Z.
I guess I could make an array with the equipment that has been selected randomly for an NPC and pass the array index to the save game BP and store it in an array there. Then upon load return the index to from the save game to the random character creator BP. But I have three questions:
-
Would this be too much data to be stored in a save slot if I have over 1000 NPCs? This would only be stored once when a new game is started
-
would I need two arrays, one for the index of instance and another one for the index of equipment in order to be able to match which NPC is wearing what cloth?
-
how to prevent re-randomization every time i modify an npc instance? Should I make a bool that detects if the randomization logic has run already and if true it would prevent if from happening again with a branch? Wouldn’t this make the blueprint activate every time an NPC is modified even though it would not pass the brach? Is there a way to turn off the blueprint itself?