if then else issue [image attached]

Get help using Construct 2

Post » Mon May 05, 2014 2:11 pm

The sound is not playing :(
NONE of the sound is playing.
What did I do wrong ?

I know for a fact that this function is being called.
You do not have the required permissions to view the files attached to this post.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 05, 2014 2:15 pm

Why do you use only one event for all RandomNumber condition ?

use one event for one condition
B
38
S
13
G
4
Posts: 152
Reputation: 5,147

Post » Mon May 05, 2014 2:21 pm

I don't understand what you mean anata, I only want to check the value of RandomNumber once to see if they match any of this value after the function PlayRandomScrollingSound() has done manipulating the number.

In any other programming language it would be a simple:

Switch Case [C++]

or Select Case in Visual Basic.

Example:
Code: Select all
switch (floor(random(8)))
{
case 0:
PlaySound0;
break;

case 1:
PlaySound1;
break;


case 2:
PlaySound2;
break;
}

Why is the simplest thing so difficult in this drag and drop paradigm ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 05, 2014 2:30 pm

Event 12 is an AND! Separate them into separate events/actions.
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Mon May 05, 2014 2:32 pm

Oh I understand what you mean now anata, will updated corrected pic if anyone wants to learn in a while.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 05, 2014 2:34 pm

Image

same as this ^^
B
38
S
13
G
4
Posts: 152
Reputation: 5,147

Post » Mon May 05, 2014 2:58 pm

This is the correct image.

Thanks to anata :D You are Awesome :D
You do not have the required permissions to view the files attached to this post.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 05, 2014 3:03 pm

You could place the Stop under the Set RandomNumber action, so it doesn't need to be repeated 8 times.
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Mon May 05, 2014 3:19 pm

radomaudio.JPG

Just another way to do it.
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Mon May 05, 2014 3:25 pm

Thanks blackhornet for the tip :D

DUTOIT, you are awesome thanks !
B
12
S
3
Posts: 288
Reputation: 1,694

Next

Return to How do I....?

Who is online

Users browsing this forum: max2612 and 28 guests