[Blueprint] Array Table

Hey together!

lastly i was about to set up an Inventory, with different arrays. Structure is fairly simple, lets take the Players Weapons for example.

ID (Byte Array) Weapon Name (Name Array) Weapon Class (Class Array) Primary Ammo (Int Array) Primary Ammo Max (Int Array) Secondary Ammo (Int Array) Secondary Ammo Max (Int Array)

All those gets Saved in an Equal ID Number of each Array, so lets Say, The pistol is ID0, and all the info gets inserted at Position 0 of each array. The Second Weapon is the Assault Rifle, and becomes ID1.

So the Player chooses the ID of the desired Weapon, and all the Info Required is at the same position in the other arrays, Name, Class, Current Ammo etc.

Just an Usage example.

So my thought was, it coult be much more Handy, when there would be something like a “Table” Function, where each column, can be an different array, and access it like Excel through 1C, 3D, etc.

There lots of ways this could become in usefull.

I think you didn’t discover structures yet, structure is a data object with set of properties and you can create array of structure objects, also didn’t you thouth of making normal weapon objects and have functions related to weapons there?

@
There is actually a tiny bit of fetaure-request “worthiness” in there. :slight_smile:
Currently, the “Arrays” in Blueprint are basically only glorified lists. They have one dimension only.
Multidimensionality needs to be achieved by nesting them with one parental structure per additional dimension.
While this is possible, its quite cumbersome.:rolleyes:

I see it’s not the case by looking what he is trying to make, even if you could make Map in Array or Array in Map (which Maps is still is not officially implemented in blueprints) i would say he is doing it wrong anyway. From description he gave he should at least create array with structure, or even class as a weapon (but you can access default properties via blueprint so it might not be easy to do it with classes)

But i also think multidimensional array, at least static dimensions number once should be implemented

I was aiming at the option to use a kind of (n dimensional) vector as array index…

but he was doing something like this :stuck_out_tongue:

ID (Byte Array) Weapon Name (Name Array) Weapon Class (Class Array) Primary Ammo (Int Array) Primary Ammo Max (Int Array) Secondary Ammo (Int Array) Secondary Ammo Max (Int Array)

Yeah. The approach for his goal is somewhat noobistic :wink:
Depends on how he later wants to access his weapons… by name? by ID?, I would make all other values members of a struct and wrap it in a second struct with the “key” value.
Then a simple loop can find the “key” and spit out the “data” struct…

PS: If he adds the index to each array he intended to create, then he would have implemented the rudimentary form of a relational database :stuck_out_tongue:

There other containers in C++ which gives more options like TMap or TPair i’m not sure if you can combine them with TArrays i never tried that

and yes, im a blueprint begginner ;D

I attached a simple table from open office, because you know… about being visual :wink:

so, the idea is having for your game 10 weapons, means ID 0-9, when the player is choosing ID2, via an Key Input necessary Data is here in one Table, while each color in this example represents a possible seperate Array.

The ID2 in this example is the Shotgun, so if the Player Fires (Event) it could mean if D4 >0 (Event: Fire)

if the player tries to pickup Ammo for the Shotgun, the check might look like if E4 <40 (etc…)

Fairly basic way and probably not the most necessary enchancement at all, but might just be Handy.

Another example, an wave based invasion Game.

Wave 1, Max Enemys, Current Enemys, Class, …

PS: i lacked some time, but will go now in structures ^^

You definitly want to use struct, there DataTable asset but it limited to strings and numbers and asset pointers in text form (not class pointers)

And it might not change. Sadly some datatable improvements were 86ed… (first point on the list)
https://trello.com/c/XxJWYAzM/549-fortnite-requested-editor-improvements-removed-overbroad
was really hoping fortnite would cause them to make some improvements there :wink:

And that thing use structs, so structs are they way here one way or another