Creating a list of enemy information

I’m not sure how to really go by doing this and I’ve been stumped for the better part of the evening. I have 3 enemy sprites actor that I want to be able to access some form of list that has all the information it needs such as:

  • sprite image (so I can update the
    source sprite)
  • multiple ints (for
    various stats)
  • and a couple floats
    (so I can set their location relative
    to the player)…

I just don’t even know where to even start working on this. Can someone help point me in the right direction. Like my idea is to have an enemy blueprint just keeps track of all the information something like.

Then have my 3 enemy sprites blueprint have access and update the enemy information before battle starts.

So
Enter combat > Decide what enemy will spawn (Enemy Cx2, Enemy D) > Enemy Sprite 1 fires EnemyC custom event > Enemy Sprite 2 fires EnemyC custom event > Enemy Sprite 3 fires EnemyD custom event > Begin Combat.

Have a look at data tables. They take a struct for columns, you can store all your information in there.

Then an actual enemy bp will have a constructor and have that struct available at spawn. When you create your enemies, they get the struct from the table row and they will know how to compose themselves and their stats.

It can all be done with blueprints.

85998-datatable.png

This sounds exactly what I need but I’m having a slight issue where I can’t import .csv files into unreal. It just keeps giving me an error, I’ve made sure to keep a1 empty.

I’ve also tried with a literally empty .csv file, do you know any solution to solving this? The only result I can find here is someone saying it just magically worked after a while which is not a useful solution.

I’ve tried restarting unreal and my computer and that didn’t solve my issue.

EDIT: I solved my issue by moving the .csv into the same drive as my project. i.e my .csv was on C:.…\MyDocuments and I moved it to F:.…\MyProjects and then hit import.

If you’re not using multiple drives and have this issue I recommend trying to move it to different folders or directly into your project folder itself.