How to Add things into an Array in-game?

Kinda weird question, but let-me explain better

I’m making an “mission” system, where the player pass through the mission points (like the PS2 GTAs and Saints Row), they are Trigger collisions that are able to save the game if you wish, however, I want to store the tag of each one I get through into an Array, so I can use at the LoadGame, then it would read the tags on the index and destroy the unecessary actors.

However, it appears that using something like Get Tags, or even a editable Name Variable will only store and send one actor, if you get through another one, it will end replacing instead of add +1 it to the Array.

Here is a image of what I’m trying to do.

Your mission array is in the “TriggerSave” object which is an object that is used multiple times right?

That means all of your TriggerSaves have a variable of that type, but they have no connection whatsoever.

What you have to do is to create this array in a SaveGameObject and store it in reference there when your character “unlocks” a mission.

Search for “Save Game Tutorials” :wink:

They are actually able to SaveGame too, in fact, i’ve been testing with the condition On, however, the problem is that it will only store one instance, not 2,3 or beyond…

For example I have 3 instances put on the level, yet, it will only Save and Load only 1 instance, even if you went through the other 2, it will consider the last one as the only to be deleted in the Load Game.

An more in depth example is that the MissionName that is connected with the ArrayMissionNameRef on the Add node is reponsible for the reason why I can only save one instance and never do an Add+1 at the Array Index.

What I want is that if I got through one or more instances, then it must save them on the ArrayMissionNameRef, which it would be the reference for the SaveGameObject ArrayMissionName.

Just solved the problem, I decided to check the InventoryUMG project to see what might be with Lengths + Print String, it’s because the array reference was in the trigger itself, it must be instead on the Player Pawn or Controller in order to make the index to increase +1.

For those wondering how it works with names and Tags, the Variable Name called MissionName is inserted into the Array reference, and then it’s passed into the save Array, when he loads it, it will compare with Actors with Tag, so you also need to add a Tag with the same name for each instance to check correctly.