List of Actors (Pawn) in a Widget

Hi there ,
In a “Widget” I would like to put a list of “Pawn” present in the game Is the “List View” a good way to do it?

Thank you for your help

The List View is great if you have a lot of widgets - hundreds, thousands or more, and you do not want to pay the cost of having all of them loaded all the time. The List View is also better at re-ordering stuff - is it important here?


If you’re working with a list of Pawns that will have just a handful of elements, or the entire content of the list is always displayed anyway, the List View may be an overkill.

A Vertical / Horizontal Box would suffice. A Wrap Box may also be a good choice.

Hello and thank you for your answer.

It is a simulation of an ant’s nest, the number of individuals is increasing and can reach several thousand. The lioste would allow me to take knowledge of the variables contained in the Bleuprint Pawn, if I am not mistaken.

You’d be scrolling through the list and viewing only some of the several thousand of them, right? The List View it is then, for sure.

Yes indeed only some.
Do you have a tutorial showing how to do it all?

For a fully fledged tut, you’d be better off searching on YT; for a quick-start overview, you can check this out:

Thanks for your help; I will do with what you give me and what I will find next.
I might come back to bother you :wink:

Hello Everynone;
I’m coming back to you after a few inconclusive attempts. I followed the explanation you gave, plus others, but my limited knowledge does not allow me to achieve what I want.
How to connect the list and the different instances of the pawn, so that they are available each time the list is called.

In fact what I’m looking for is a list of variables contained in instances of a BP Pawn. In order to visualize the creation of a worker (creation of the instance) in a colony (of ants), and to be able to follow its evolution until its end (deletion of the instance).

I think I need to make a backup of the list and the instances associated with it, but I couldn’t find how to do it…

I rely on your kindness and your knowledge

The start of operations



Hey, I’m having trouble visualising an overview of what’s needed:

  • there’s a colony of (how many, roughly?) ants
  • each (pawn?) ant tracks and stores its own evolution progress (what data are we storing)
  • we want to visualise this data in through widgets
  • are we looking at one ant at a time or the colony as a whole?

Hello and thank you for stopping by.

The colony starts with a queen who lays and grows over time without having a pre-defined limit.

The data is that contained in a “pawn”, which represents all ants as a whole, all castes combined. That of the nest (a colony that can contain several nests)

The widgets show us a colony in its entirety, but I don’t want to have the “pawn” moving on the screen, it will only be represented on the ListView (at first… )

Thanks in advance for your answer

Don’t really know how to answer, though. How are you storing the data, what data? Assuming you’re storing it all in a struct array (for saving purposes), what is stopping you from adding the content of the array to the list view?

What’s not working about the above? Are you having issues with saving (because the above does not save anything) or displaying it.

Could a structure be related to variable data and indexed to the instance of the pawn?
Because each “ant” must have a different age from that of the others, since they are not all born at the same time.
the list must include the data contained in each ant and display the update of the variables during the games

Yes, I indeed have a saving and loading problem, how to make the list resume each time the previous entries and add new ones and save them.

Each ant needs its own set of data, it could be simple struct:

image

The Pawn can hold an array of those structs - that’s your colony.

In your save game object, create the same array for saving purposes:

image

As the colony develops and we get more ants, the Pawn adds and keeps them in an array. When it’s time to save the game, we save that struct in the game object.


Technically, you could use the List View as storage but it seems quite unnatural.


When it comes to loading, saving and updating save games, this explains it better than I ever could:

Saving and Loading Your Game | Unreal Engine 4.27 Documentation.

I can’t match structure, pawn and list. In the list the structure which is in reference in the pawn is eject

I am really sorry but I don’t know what that means.

The better would surely be a pretty drawing with windows and everything, because there I’m broke I don’t know how to explain what I don’t understand…
Could you make me a “bleuprint” with explanations to place the different things in their place, please?
sorry im a newbie :wink:

Sadly, I do not really fully understand what is required.


newbie

Consider breaking it down into smaller pieces first to get the basics right:

  • make sure you can use save games correctly - load, save, update
  • make sure you understand how structs work and how to update them
  • learn about arrays and looping
  • make sure you can display a struct in a widget
  • make sure you can propagate struct updates to widgets
  • make sure you can display an array of structs in widgets
  • only then start working with List View

Lets say I spend the next 2 hours making something for you, you’ll be stuck on the next thing you need to do anyway :expressionless:

Thanks :slight_smile:

Hello Everynone, all,

I followed your advice, I reviewed my knowledge about “Backup” (remaining gaps…, see below=>). I have more knowledge of Tableau, although…. I have doubts on how to use certain things like Add (Copy /Ref). I acquired the basics that I lacked about “Structure”. I found a tutorial on the View list and managed to link a Structure to it, Display the List on the screen and work on it (change values and copy the list in order to display it afterwards.



The structure is placed in an “Object blueprint”







The Problem still remains on the backup of the data of the list and that of the structure. My List saves well in the location reserved for it, but it comes out empty, just the Indexes are present.


I hope you can tell me about the rest, I’m out of search on the web, fault of my mother tongue (french) Because traductor.