Var in "initial text" of global event Var [solved]

Get help using Construct 2

Post » Sat Sep 28, 2013 6:57 pm

How do I use variables in the "initial text" field of event variable?

I'my trying to do global event variable ABC = NodeWebkit.UserFolder.

I testing things and change that NodeWebkit.UserFolder. Its extra work to go through everything and change paths.Jase5z2013-09-28 23:17:18
B
6
S
1
Posts: 24
Reputation: 549

Post » Sat Sep 28, 2013 8:45 pm

Is the variable type set as text? Like here
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sat Sep 28, 2013 9:05 pm

@ 7Soul yes. I just tried something else weird with no luck either....str(NodeWebkit.AppFolder) with type set to number.

It's treating the variable name as text(not surprising). I need to force it to use the contents of the variable.

I can go through the capx and change my paths manually but I'd rather just change one global variable.
B
6
S
1
Posts: 24
Reputation: 549

Post » Sat Sep 28, 2013 10:08 pm

Something like NodeWebkit.AppFolder isn't a variable, but an expression. Expressions are only available in runtime, not in edittime. Such expression is a bunch of code that executes to return a value.

What is wrong with
on start of layout -> set ABC to NodeWebkit.AppFolder
?

You could even place it in an every x seconds event.tulamide2013-09-28 22:10:18
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sat Sep 28, 2013 11:18 pm

@ tulamide   Thank you! It makes sense why it wasn't working, great explanation.
B
6
S
1
Posts: 24
Reputation: 549


Return to How do I....?

Who is online

Users browsing this forum: diamantico21, ratboy3, TRMG and 30 guests