Variables linking to other variables

Discussion and feedback on Construct 2

Post » Mon Apr 23, 2012 8:37 pm

Hi!
If theres already a way of doing this, please forgive me, Ive not found it on the foruns or the manual.
Would it be possible to define a variable like:

Var01 = stage.Height;
or
Var01 = Var03 - Var02;

?
Thanks!
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Mon Apr 23, 2012 8:58 pm

Is there a real need? I mean, that's kind of redundant...

You can always create a variable and assign values of other variables to it whenever necessary, e.g. each tick.Mipey2012-04-23 20:59:57
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Apr 23, 2012 9:08 pm

Well, it would be more of a shortcut than anything else.
Maybe for defining a variable like that:
Velocity = 30 * dt;
instead of having to write
Enemy - Move forward Velocity * dt;
just writing
Enemy - Move forward Velocity;
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Mon Apr 23, 2012 9:30 pm

So just use a local variable and assign a desired value to it. You can create those variables at start of each event group. That's what local variables can be used for... to avoid repetitive use of expressions, if the value isn't going to change during the tick.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests