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"

Cube Generation - Infinite Loop Problem

Afternoon all, Thanks for taking a look at my problem!

I am currently toying around with some very small scale cubed map generation and seem to have come across a bit of a stumbling block, which has had me racking my brian for nearly a week trying to come up with solution to get around this infinite loop problem. At the moment, I am generating blocks using the instanced static mesh component which poses a few problems in regards to storing previous column heights and things, hence why I am trying to implement this work-around.

So the following break-down is a overview of how it should work:

  1. Add x number of cubes to the right and left of the 'Master Cube'. [Working]

  2. For each cube added in step 1, add x number of cubes above array item. [Working]

  3. Add x rows of cubes infront of 'Master Cube' to create rectagular play area. [Working]

  4. For each cube added in step 3, carry out a line trace to identify if there is a blocking hit to the left of the cube, if TRUE then add cube above array item, if FALSE then stop adding cubes above array item and delete the last added cube. [Not Working]

Step 4 is where I am running into problems, as I need the adding of cubes above the array item to continue until the line trace returns a false blocking hit and I just cant seem to jimmie anything together which will not kick up an infinite loop warning.

Below is a snapshot of the blueprint as is, I have added and removed so many different variations of branches and while loops that I had thought would work but I have had no real success thus far. So the image is just the general operation without the looping involved, hence why I have come to you guys to recommend a suitable method.

alt text

Link for ease: http://i.imgur.com/py5sqKp.jpg

My problem seems to be detecting when the line traces are coming up false and then getting out of the loop with that item of the array, if that makes any sense? For example, we enter step 4 of the process and start adding instacnes above item 1 of the array, then once the line trace returns a false a boolean variable would switch to false, completing the while loop, however I need to be able to enter that loop again with the second item of the array, so I set the boolean variable to true for each item of the array and I believe this is where the infinite loop is originating.

Ach, I dont know but if anybody would like to take a look at the wall of text above and try and help out, that would be greatly appreciated!

Thanks, Connor.

Product Version: UE 4.11
more ▼

asked May 09 '16 at 11:45 AM in Blueprint Scripting

avatar image

61 1 4 7

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

0 answers: sort voted first
Be the first one to answer this question
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