Random number generate without repeat.

Get help using Construct 2

Post » Sat Dec 21, 2013 3:35 pm

My problem is very simple:

How do I create a random number between two value one time.
(Not repeat again n again... only once generate random number!)


So if I wrote that:

System - Set value: Set Glo_temp_vari to floor(random(3,13))

It will to generate a number between 3 and 13, but after it will to repeat again and again to infinitium. I want that it doesn't repeat again.

Something simple solution? Thx
B
5
S
1
Posts: 37
Reputation: 441

Post » Sat Dec 21, 2013 4:41 pm

[QUOTE=Scap] My problem is very simple:

How do I create a random number between two value one time.
(Not repeat again n again... only once generate random number!)


So if I wrote that:

System - Set value: Set Glo_temp_vari to floor(random(3,13))

It will to generate a number between 3 and 13, but after it will to repeat again and again to infinitium. I want that it doesn't repeat again.

Something simple solution? Thx[/QUOTE]

Maybe a 'trigger once while true' (a system condition)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Dec 21, 2013 4:59 pm

If you search on your own topic name you will find multiple answers.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sun Dec 22, 2013 12:59 pm

Thanks Aphrodite!

It's work.
B
5
S
1
Posts: 37
Reputation: 441

Post » Sun Dec 22, 2013 2:11 pm

Sorry, misread the question. If you just need something done once per layout, you use:
System:On start of layout.

You put all of your startup code in there, rather than adding 'Trigger once' to all of your conditions.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sun Dec 22, 2013 10:06 pm

No problem! Thx, it's also good idea.
B
5
S
1
Posts: 37
Reputation: 441


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 27 guests