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"

Arrays not dropping data between play sessions?

Edit: Updated this question with new information.

My map generator recently began generating 2200 extra tiles on top of the 200 it was supposed to generate. For some reason these tiles were set to the last tile placed and were relaid over every vector in the map.

I think I see how it is generating extra tiles, but I am not sure why.

Possibly related to exposing and referencing my Vector Field in other blueprints? That is when the problems started.

I noticed in the level editor that if I select my map generator asset in the Scene Outliner, then it has a tab in the Details panel that shows my Vector Field.

Instead of 200 elements, it shows 2400 elements.... With a Map Size of 10, it generates 200 tiles(0-199). As you can see in the picture it starts over at 200. It generates 12 times for a total of 2400 tiles.

alt text

So essentially my ForEachLoop was running on a Vector Field that had 12 times more vectors than it was supposed to have, and after it ran through the first 200, it merely kept the last tile set and laid them out 11 deep on top.

In the Details panel, it allowed me to reset the variable to Default which cleared the 2400 elements in the vector field to 0 and allowed me to generate a map properly without using the Do N nodes to cull the generation.

I am afraid that it will happen again and fill my Vector Field with garbage vectors. Apart from setting a ClearArray node in front of my Vector Field Generator, anyone know how to stop this from happening again?

Product Version: Not Selected
more ▼

asked May 04 '14 at 01:35 AM in Blueprint Scripting

avatar image

1.8k 131 68 110

avatar image Zeustiak May 05 '14 at 11:47 AM

Here is a picture of my strings printing to screen. As you can see, my Object Array is keeping past play session data. Every time I hit play and the map generates, those numbers increment by the amount of relevant tiles generated in the map.

Each time I play, 200 tiles are generated so for it to hit 900 on water means it has to be storing them between play sessions.

alt text

Right now, my Vector Field Array is not keeping data between play sessions but my Object Array is.

avatar image Zeustiak May 05 '14 at 11:53 AM

I seem to remember this problem first occuring after I put a Switch on Enum into my generator: alt text

avatar image Zeustiak May 07 '14 at 08:36 AM

Anyone ever seen this? It hasn't come back, but I would like to know how it could...

avatar image Zeustiak May 08 '14 at 12:17 PM

I just now remembered that I had a case where I had my Add nodes completely disconnected, hit play, and somehow STILL had tiles generate based on what should be been empty arrays.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you intend to generate this array each time you run, you probably want to set your array to be transient. If it is a blueprint variable, you can do this in the Details window, behind the arrow-down in the advanced options.

more ▼

answered May 08 '14 at 12:30 AM

avatar image Zeustiak May 08 '14 at 12:15 PM

Thanks, that is a good tip for my array that is just counting the number of tiles generated.

What about my vector array?

Ideally my Vector Array generates at the beginning of a game and does not generate again. Many other arrays are generated based on this Vector Array and are modified all throughout the game.

Do you know how it happened to gain so many extra additions?

Is it good practice to do put a Clear Array node in front of any array the first time you generate 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