Announcement

Collapse
No announcement yet.

How to Add things into an Array in-game?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Click image for larger version

Name:	array.png
Views:	1
Size:	116.4 KB
ID:	1213060

    #2
    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"
    [Released] Multiplayer Combat Editor
    A-RPG Sacred Swords
    Auto-Chess Live Development
    Youtube Tutorials

    Comment


      #3
      Originally posted by Yun-Kun View Post
      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"


      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.
      Last edited by Pavomba; 03-14-2017, 09:49 PM.

      Comment


        #4
        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.

        Comment

        Working...
        X