Find greatest variable

Get help using Construct 2

Post » Tue Feb 12, 2013 6:00 pm

Hey friends,

can you please help me?? I have about 6 global variables and I need to find out which is the biggest at the end of the game.

Is there any other possibility than

Variable 1 > Variable2 --> do this and that
Variable 1 > Variable3
Variable 1 > Variable4
Variable 1 > Variable5
Variable 1 > Variable6

that is not necessary I guess, perhaps someone got a hint for me :)

Greets
Beav
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,152
Reputation: 9,886

Post » Tue Feb 12, 2013 6:17 pm

You could something like this:

global number max_value=0

every tick:
Set max_value to max(var1,var2,var3,var4,var5,var6)

max_value=var1:
    do stuff

max_value=var2:
    do stuff

max_value=var3:
    do stuff

max_value=var4:
    do stuff

etc...
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Tue Feb 12, 2013 7:50 pm

Too bad, that i cant serve a beer via internet, but you would defly deserve it :)

THANKS 1000 TIMES, works super fine :)

used it, to complete my match statistics for my arena shooter



;-)

keep up the good work, everybody and special thx to ROJOhound :)

Greets
Beav
Image
Check out our start-up and configure your own helmet in true 3D.
B
42
S
11
G
11
Posts: 1,152
Reputation: 9,886


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests