Help with appending new entries to array with blueprint.

Currently trying to mod a game to have additional entries in the array used as a loot table, however I’m clueless as to how exactly I should go about appending new entries to the array. A way to both be able to replace existing entries and create new entries without affecting other entries in the array would be optimal, but right now I’m more focused on just adding new entries.

I have a ModActor that references itself to Actor called newblueprint5 which contains the array I need to manipulate. Called “a” with two values being Name type and Float type.
newblueprint5 variable

In my main mod actor class, I currently have this node structure to call all actors in the newblueprint5 actor class, but I don’t know exactly how I am supposed to append new entries to this class.
ModActor

Below are some example entries that would fit my usecase.
“Key”: “drive”,
“Value”: 10.0

      "Key": "burger",
      "Value": 5.0

      "Key": "batts",
      "Value": 10.0

Any help would be greatly appreciated, or links to tutorials that are directly related to this topic.

That’s actually a Map, not an Array.

Is there only one of these objects in the game? You are using Get All Actors of Class which returns an array of actors of that class, if there is more than one you will need to figure out which one you want to add to. If there is only one, use Get Actor of Class.

Adding to a Map and modifying something already in a Map is exactly the same process:

If there is no entry for ‘burger’ in the map, it will be added; if ‘burger’ is already in the map, then the value will be updated.

1 Like

Oh wow, thats really simple lmao. I understand what I need to do, but I’m having trouble finding the ‘Target’ node that you use. Could you provide the specific name for that node?

Also I do believe I need to use an allactors class since this will spawn multiple times, but if it doesn’t work I can try using a single actor. Thank you

EDIT-Found it under variables, thanks for the help.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.