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"

Blueprints - Dealing with Random Numbers

Hi all,

I am doing some work using the Random Integer In Range node. I have the following code:

alt text

But it is giving me some strange results. What I think may be happening is that when SET A Variable is called, it is picking the random number, doing the timespan addition, and then setting the value. Then, when SET Another Variable is called, it is doing it again therefore picking a DIFFERENT random number.

Can someone who knows more about blueprints verify if this is the cause of my problem or not? If it is, what workaround could I use to ensure that both variables are being set based on the same random integer?

Many thanks in advance!

Product Version: Not Selected
Tags:
bp-problem.png (121.4 kB)
more ▼

asked Mar 04 '18 at 12:52 PM in Blueprint Scripting

avatar image

MarsMiner
52 6 12 22

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

1 answer: sort voted first

Whilst I was waiting for an answer to this question I decided to try some tests for myself - and I fixed it! I made a struct to contain A Variable and Another Variable and that way, it was using the same random number for each. A note to any staff who may be reading this - I think that this shouldn't be a problem! If a Get Random Number node has multiple outputs, it should pass the same output to each rather than executing Get Random Number multiple times. If it is possible to change I think it would save lots of time for many people.

more ▼

answered Mar 04 '18 at 12:59 PM

avatar image

MarsMiner
52 6 12 22

(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