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"

Recursion problems - Does unreal use pass by value or pass by value-result?

Hi all,

I'm trying to make a function that calls itself four times at the end. In essence, I'm trying to implement the recursive subdivision algorithm for maze generation - I divide the map randomly into four, place some walls, and repeat on each of the four quadrants (until they get to unit sized at which point they don't recurse). So, my function RecursiveDivision ends with four separate calls, one after the other, to RecursiveDivision; each with slightly different inputs to tell the new function call where each quadrant starts.

But when the first new call happens, it updates the values of various variables in my original call, screwing up the inputs to the rest of my new calls. This surely isn't pass by value, like I though Unreal was meant to use, otherwise it couldn't touch the originals! It's presumably pass by value-result. I definitely have pass-by-reference unticked on the function inputs.

Any ideas, how to either fix this bug or work around it?

Thanks.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 10 '15 at 05:46 PM in Blueprint Scripting

avatar image

fogmike
1 1 3

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

1 answer: sort voted first

Ah, think I have it - had not noticed that my variables were all global to the blueprint rather than local to the function!

more ▼

answered Jul 12 '15 at 10:34 AM

avatar image

fogmike
1 1 3

(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