(FIXED) Can't set a variable to a random number

When I try to set a variable to a random number (1 or 2), the event that needs the variable to be at 1 and the one that needs it to be at 2 both trigger

At the beginning of the scene

Do = RandomInRange(1, 2) to variable wallgeneration1 of wall

Variable wallgeneration1 of wall is = 1

Create objects from the external layout named terrain1

Variable wallgeneration1 of wall is = 2

Create objects from the external layout named terrain2

use the “trigger once” condition.

Doesn’t work, I just tried

Before we can help you, let’s do a simple exercise and please answer me a couple of hypothetical questions:

Suppose you are an expert in calculators. You know a lot about old and new, simple and scientific calculators, about the electronic components that compose them and about the failures that they can suffer.

Now suppose I have a problem with a calculator and I make a post on a forum that contains the following text and nothing else:

I write 1 + 1 on the calculator and the result is 3. The result should be 2, why is not 3? Please help me.

And you, despite being a calculator expert, can’t tell me right away what the mistake is.

Why can’t you tell me immediately what’s wrong? What do you need to be able to help me in that situation?

I can already tell that is is going to end up to these 5 “rules”

  1. What you are trying to achieve/what you expect to happen.
  2. What actually happens.
  3. A screenshot of the specific events in question.
  4. Patience. Not everyone is available at all times.
  5. Understanding. No one may know the answer to your question.

But if not,

Why can’t you tell me immediately what’s wrong? What do you need to be able to help me in that situation?

not entirely sure

By your answer I can see you already now what you need to do in order to make others able to help you.

  1. Only one triggers (Just read between the lines, you can guess it easily)
  2. Two triggers (Said it)
  3. I’ve put in text basically everything that would be in the screenshot
  4. Patience, got that
  5. Understanding, got that

Edit: Nevermind about 1

The text don’t replace the screenshot, or a shared copy of your project in the better of the cases.

Just think about it, without that nobody can magically guess what is happening an help you further.


Same exact thing as the text
At the beginning of the scene

Do = RandomInRange(1, 2) to variable wallgeneration1 of wall

Variable wallgeneration1 of wall is = 1

Create objects from the external layout named terrain1

Variable wallgeneration1 of wall is = 2

Create objects from the external layout named terrain2
And, I said
“When I try to set a variable to a random number (1 or 2), the event that needs the variable to be at 1 [to work] and the one that needs it to be at 2 [to work] both trigger”

I give up with this post I’ll find a way myself

Ok, but that’s a shame because seeing your events I already had the first suggestion to solve the issue.

Anyways, I was already testing and working on your issue. Here is a working example of the events you are showing:

Random layouts

That means the problem is not in that events but in other section of the events… that’s why we need to take a broader look at your events in order to help you.

Oh, well uh, I know I said I give up but, what’s your suggestions?

In fact, I have more ideas about what may be failing in your project, but I will let other users offer their help.

If the example I made for you (downloadable in the link in the previous comment) helps you, that’s great, and if not, well, no way.

For the next occasion I suggest you abide by the advice that you yourself quoted. In summary and said in another way:

  • Always add screenshots
  • Be patient
  • To have a good attitude

It is good to cooperate with those who we intend to cooperate with us.

I can’t really open the files since I, uh, don’t have a zip extractor, can you send a screenshot/picture instead?

you should pull the secound and third events as a sub-event of the fitst event. or you should add the “beginning of the scene” to all events.

1 Like

There isn’t much going on with walls in other events, and that’s the only use of the external layouts and that variable, though

Fixed it