x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

"dynamic?" stockpile mesh

Like the tile says, how would I go about creating a banished like stockpile where a NPC can carry wood into the stockpile and then have a small stack of wood in it? I know that I can't just create a mesh for every single possible combination of resources that would be in the stockpile. Basically my question is how would i go about creating a stockpile that has for example 20% wood, 20% stone, 30% iron and 30% clay and have it show up in that order? The resources should be able to be alllocated in whatever order but still be organized in a way that each resource has it's own section.

So let's say 10% of the wood was allocated before anything else and then everything else was carried there until there was only capacity for another 10% of wood. I still want the new wood to be stacked with the old wood. Like this: alt text

Product Version: UE 4.19
Tags:
more ▼

asked Aug 09 '18 at 09:57 AM in Blueprint Scripting

avatar image

FittFräsen
23 3 3 8

avatar image FittFräsen Sep 02 '18 at 11:38 AM

I've thought about one way of doing this. I have a selection tool that i could use to snap every 100 units, how would I go about spawning one 100x100 "tile" every snap that has a socket and then merge all tiles into 1 mesh and keep all the sockets? I need to do this at runtime and the meshes has to keep all the sockets.

avatar image ThompsonN13 Sep 02 '18 at 12:30 PM

i wouldnt even bother merging things. i would create a actor that is the stockpile and it would basically consist of several containers or sockets. then each time you add a resource you would add a item to an array and create a static mesh and place it in the socket location. using this method you would just need a mesh for each of the individual resources or depending on the art style you could just use different materials.

avatar image FittFräsen Sep 02 '18 at 12:36 PM

So I would create one "plane" for each size available and then spawn the correct one based on the size of the selection?

avatar image ThompsonN13 Sep 02 '18 at 02:01 PM

i wasnt really reading / understanding your question right at first. yes you could do some scale setting but what i was really meaning was that if you knew the increment size beforehand then you could just have that many meshes. so for example if you wanted your stockpile to be 100 resources and you knew it would com in increments of 10 then you could just have 10 meshes. then you could just set the mesh depending on the value. i made a little example of this that i will post below. though im not sure this is the best solution to your issue, there may be a better solution since it seems in your case that its more of a widget kind of thing than something to make with meshes. the example below however does show adding resources and limiting how many can be added, it shows how you can combine allocations for storage as you put it, and can be expanded upon. i made this using 10 cube meshes lined up in a row and a map variable to hold the resources.

alt text

alt text

capture.png (542.9 kB)
capture2.png (421.0 kB)
avatar image FittFräsen Sep 02 '18 at 07:10 PM

alt text My selection tool is 100% in worldspace and though i didn't in this example i can set my cursor to snap every 100 units. So what would be the the best way to set the mesh based on the seleciton? I don't think it would be too much off an issue to create 1 mesh for each size and rotate when needed if i limited the stockpile to a max size of 15*15 snaps and min of 3*3. I'm not worried about allocation or things like that. It's the act of spawning the actor that I am unsure how I want to do. But if you are saying merging is really annoying to debug etc I could easily just create the combinations and rotate them if i need it o be bigger in the X or Y axis for 10*3.

So i could get my selection and divide X and Y values by 100 to determine which stockpile mesh to spawn as well as the transform. And if you are telling me that making one mesh for each combination is a valid solution you have probably given me all the help i need! :)

selectionsystem.png (447.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Looks like youre off by one, missing the last index of your array or something

more ▼

answered Aug 09 '18 at 01:15 PM

avatar image

mightyenigma
3.8k 18 23 20

avatar image FittFräsen Aug 09 '18 at 05:00 PM

I'm more looking for an answer that can push me in the right direction to actually creating this. I currently have no idea how to do it and would be grateful if someone could show me some resource of someone doing something like this. The hard part is the visual not the storing values or w/e, so specifically what i'm looking for is how to create such a mesh that can change based on % or values of ingame resources stored in it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question