Problems with math

Get help using Construct 2

Post » Thu Dec 20, 2012 11:41 pm

Hmm for organization is there any way to put global variables in a group while still allowing the other groups access to them?

Part of what I am trying to learn now is organization and keeping things grouped so that I can focus on one thing at a time.

It may not be a problem though, it will be nice to have variables that are only within certain groups, but would be nice to have a collapsible group for the global ones shared by all the groups as well.

*edit* It also seems you cant set Global Variables as Boolian?narfi2012-12-20 23:46:10
Posts: 7
Reputation: 339

Post » Sat Dec 22, 2012 6:29 pm

Yeah random(a,b) gives you a random number in the [a;b[ range.

For global variables, as soon as you nest them under an event or a group they become local variables and their scope is only in this event (and related sub-events) or group.
Now, if you set your local variable as static, they will behave like global variables (meaning their value won't be reset at each tick)
As far as boolean goes, inded you can't have boolean global variables. But you know, booleans are just 1 or 0 under the hood.
If you really want to use TRUE and FALSE instead of number, you can still define them as constant of value 1 and 0.
Posts: 1,479
Reputation: 16,336


Return to How do I....?

Who is online

Users browsing this forum: clarkkentnicdao, hyem, Lancifer, Mysternof, R0J0hound, Yahoo [Bot] and 26 guests